ARMY PUBLIC SCHOOL NO.
2 JAK RIF RC
PROJECT REPORT ON
HOSPITAL MANAGEMENT SYSTEM
Submitted to the
Central Board of Secondary Education
Submitted to
DEPARTMENT OF COMPUTER SCIENCE
Army Public School No 2 JAK RIF RC
Jabalpur (M.P.)
Submitted by
PRIYANSHU SINGH
CLASS XII(commerce) SESSION 2024-25
ARMY PUBLIC SCHOOL NO.2
CERTIFICATE
This is to certify that PRIYANSHU SINGH of class 12th
commerce of Army Public School No.2 has successfully
completed the project work on computer science , titled
“HOSPITAL MANAGEMENT SYSTEM” ,under my
supervision. He has taken proper care and shown utmost
sincerity in the completion of his project file.
I certify that this file is up to my expectations as per the
guidelines issued by CBSE.
SHEELA PANDEY VIKAS KHARE
(PRINCIPAL) (COMPUTER SCIENCE TEACHER)
ARMY PUBLIC SCHOOL NO.2
CERTIFICATE
This is to certify that PRIYANSHU SINGH of class 12th
commerce of Army Public School No.2 has successfully
completed the project work on computer science , titled
“ HOSPITAL MANAGEMENT SYSTEM” ,under my
supervision. He has taken proper care and shown utmost
sincerity in the completion of his project file.
I certify that this file is up to my expectations as per the
guidelines issued by CBSE.
INTERNAL EXAMINER EXTERNAL
EXAMINER
DATE: DATE:
ACKNOWLEDGEMENT
Apart from the efforts of me, the success of any project depends largely on the
encouragement and guidelines of many others. I take this opportunity to express my
gratitude to the people who have been instrumental in the successful completion of this
project.
I express deep sense of gratitude to almighty God for giving me strength for the
successful completion of the project.
I express my heartfelt gratitude to my parents for constant encouragement while
carrying out this project.
I gratefully acknowledge the contribution of the individuals who contributed in bringing
this project up to this level, who continues to look after me despite my flaws,
I express my deep sense of gratitude to the luminary The Principal, ARMY PUBLIC
SCHOOL NO 2, JAK RIF RC who has been continuously motivating and extending
their helping hand to us.
I am overwhelmed to express my thanks to The Administrative Officer for providing me
an infrastructure and moral support while carrying out this project in the school.
My sincere thanks to MR. VIKAS KHARE, PGT Computer Science, Teacher Incharge,
A guide, Mentor all the above a friend, who critically reviewed my project and helped
in solving each and every problem, occurred during implementation of the project.
The guidance and support received from all the members who contributed and
who are contributing to this project, was vital for the success of the project. I am grateful
for their constant support and help.
TABLE OF CONTENTS
SER DESCRIPTION PAGE NO
01 ACKNOWLEDGEMENT 06
02 INTRODUCTION 07
03 OBJECTIVES OF THE PROJECT 07
04 PROPOSED SYSTEM 08
05 SYSTEM DEVELOPMENT LIFE CYCLE (SDLC) 10
06 PHASES OF SYSTEM DEVELOPMENT LIFE CYCLE 11
07 HARDWARE AND SOFTWARE REQUIREMENTS 19
08 FLOW CHART 24
09 SOURCE CODE 25
10 OUTPUT 35
11 TESTING 41
12 BIBLIOGRAPHY 44
ACKNOWLEDGEMENT
In the accomplishment of this project successfully, many people have bestowed upon their
blessings and the whole hearted support ,I sincerely thank all the people who have been connected
with this project.
Primarily I would thank God for being able to complete this project with success.
On completion of my project I express my gratitude towards our Principal Mrs. Sheela
Pandey for her inspiration and guidance.
Then I would like to thank my guide Mr. VIKAS KHARE whose valuable guidance has
been the one that helped me to complete this project and make it full proof success, has suggestion
and instructions has served as the major contributor towards the completion of project.
Then I would like to thank my parents and friends who have helped me with their valuable
suggestions and guidance also has been helpful in various phases of completion of project.
PRIYANSHU SINGH
Class- 12 'Commerce'
HOSPITAL MANAGEMENT SYSTEM
1. Introduction
The Hospital Management System is a software application designed to streamline the
management of hospital operations. The system enables efficient handling of
administrative, medical, and patient-related tasks. It provides modules for different
user roles, including administrators, doctors, and patients, and uses Python as the
programming language and MySQL as the database backend.
2. Objective
The primary objective of this project is to develop a comprehensive system that:
• Simplifies hospital operations such as managing doctors, patients, and
appointments.
• Provides a user-friendly interface for different roles (Admin, Doctor,
Patient).
• Ensures secure and efficient data storage and retrieval using MySQL.
3. System Architecture
3.1 Components
• Frontend: Command-line interface for interacting with the system.
• Backend: Python scripts to implement the application logic.
• Database: MySQL database for storing user, doctor, patient, and appointment
information.
3.2 Modules
The system is divided into the following modules:
3.2.1 Admin Module
• Add new doctors to the system.
• View, update, and delete doctor records.
• View and manage patient records.
• Discharge patients from the system.
• View scheduled appointments.
3.2.2 Doctor Module
• View assigned patients.
• Mark appointments as completed.
3.2.3 Patient Module
• Book appointments with available doctors.
• View personal medical records and appointment history.
PROPOSED SYSTEM
The proposed Hospital Management System is designed to address inefficiencies in
traditional hospital operations. The system will streamline patient management, doctor
schedules, and appointment bookings while ensuring secure and organized data
handling. Key features of the proposed system include modular architecture, role-based
access, and a command-line interface for ease of use. The use of Python and MySQL
ensures a robust and scalable solution that can be enhanced in the future.
Key aspects of the proposed system include:
1. Role-Based Access: Each user type (Admin, Doctor, Patient)
has dedicated functionalities tailored to their needs.
2. Efficient Data Management: MySQL database is utilized to
store and manage all hospital data, ensuring accuracy and quick
access.
3. Scalability: Modular design allows for easy addition of new
features or roles.
4. Security: User authentication ensures that only authorized
personnel can access sensitive data.
5. SYSTEM DEVELOPMENT LIFE CYCLE (SDLC)
The systems development life cycle is a project management technique that divides
complex projects into smaller, more easily managed segments or phases. Segmenting
projects allows managers to verify the successful completion of project phases before
allocating resources to subsequent phases.
Software development projects typically include initiation, planning, design,
development, testing, implementation, and maintenance phases. However, the phases
may be divided differently depending on the organization involved.
For example, initial project activities might be designated as request,
requirements-definition, and planning phases, or initiation, conceptdevelopment, and
planning phases. End users of the system under development should be involved in
reviewing the output of each phase to ensure the system is being built to deliver the
needed functionality.
PHASES OF SYSTEM DEVELOPMENT LIFE CYCLE
INITIATION PHASE
The Initiation Phase begins when a business sponsor identifies a need or an opportunity.
The purpose of the Initiation Phase is to:
• Identify and validate an opportunity to improve business accomplishments of the
organization or a deficiency related to a business need.
• Identify significant assumptions and constraints on solutions to that need.
• Recommend the exploration of alternative concepts and methods to satisfy the
need including questioning the need for technology, i.e., will a change in the
business process offer a solution?
• Assure executive business and executive technical sponsorship. The Sponsor
designates a Project Manager and the business need is documented in a Concept
Proposal. The Concept Proposal includes information about the business process
and the relationship to the Agency/Organization.
• Infrastructure and the Strategic Plan. A successful Concept Proposal results in a
Project Management Charter which outlines the authority of the project manager
to beginthe project.
Careful oversight is required to ensure projects support strategic business
objectives and resources are effectively implemented into an organization's enterprise
architecture. The initiation phase begins when an opportunity to add, improve, or correct
a system is identified and formally requested through the presentation of a business
case. The business case should, at a minimum, describe a proposal’s purpose, identify
expected benefits, and explain how the proposed system supports one of the
organization’s business strategies. The business case should also identify alternative
solutions and detail as many informational, functional, and network requirements as
possible.
SYSTEM CONCEPT DEVELOPMENT PHASE
The System Concept Development Phase begins after a business need or opportunity is
validated by the Agency/Organization Program Leadership and the
Agency/Organization CIO.
The purpose of the System Concept Development Phase is to:
• Determine the feasibility and appropriateness of the alternatives.
• Identify system interfaces.
• Identify basic functional and data requirements to satisfy the business need.
• Establish system boundaries; identify goals, objectives, critical success factors,
and performance measures.
• Evaluate costs and benefits of alternative approaches to satisfy the basic
functional requirements
• Assess project risks
• Identify and initiate risk mitigation actions, andDevelop high-level technical
architecture, process models, data models, and a concept of operations. This
phase explores potential technical solutions within the context of the business
need.
• It may include several trade-off decisions such as the decision to use COTS
software products as opposed to developing custom software or reusing software
components, or the decision to use an incremental delivery versus a complete,
onetime deployment.
• Construction of executable prototypes is encouraged to evaluate technology to
support the business process. The System Boundary Document serves as an
important reference document to support the Information Technology Project
Request (ITPR) process.
• The ITPR must be approved by the State CIO before the project can move
forward.
PICTORIAL REPRESENTATION OF SDLC:
PLANNING PHASE
The planning phase is the most critical step in completing development,
acquisition, and maintenance projects. Careful planning, particularly in the early stages
of a project, is necessary to coordinate activities and manage project risks effectively.
The depth and formality of project plans should be commensurate with the
characteristics and risks of a given project. Project plans refine the information gathered
during the initiation phase by further identifying the specific activities and resources
required to complete a project.
A critical part of a project manager’ job is to coordinate discussions between user,
audit, security, design, development, and network personnel to identify and document
as many functional, security, and network requirements as possible. During this phase,
a plan is developed that documents the approach to be used and includes a discussion
of methods, tools, tasks, resources, project schedules, and user input. Personnel
assignments, costs, project schedule, and target dates are established.
A Project Management Plan is created with components related to acquisition
planning, configuration management planning, quality assurance planning, concept of
operations, system security, verification and validation, and systems engineering
management planning.
REQUIREMENTS ANALYSIS PHASE
This phase formally defines the detailed functional user requirements using high-
level requirements identified in the Initiation, System Concept, and Planning phases. It
also delineates the requirements in terms of data, system performance, security, and
maintainability requirements for the system. The requirements are defined in this phase
to a level of detail sufficient for systems design to proceed. They need to be measurable,
testable, and relate to the business need or opportunity identified in the Initiation Phase.
The requirements that will be used to determine acceptance of the system are captured
in the Test and Evaluation Masterplan.
The purposes of this phase are to:
• Further define and refine the functional and data requirements and document
them in the Requirements Document,
• Complete business process reengineering of the functions to be supported (i.e.,
verify what information drives the business process, what information is
generated, who generates it, where does the information go, and who processes
it),
• Develop detailed data and process models (system inputs, outputs, and the
process.
• Develop the test and evaluation requirements that will be used to determine
acceptable system performance.
DESIGN PHASE
The design phase involves converting the informational, functional, and network
requirements identified during the initiation and planning phases into unified design
specifications that developers use to script programs during the development phase.
Program designs are c constructed in various ways. Using a top-down approach,
designers first identify and link major program components and interfaces, then expand
design layouts as they identify and link smaller subsystems and connections. Using a
bottom-up approach, designers first identify and link minor program components and
interfaces, then expand design layouts as they identify and link larger systems and
connections. Contemporary design techniques often use prototyping tools that build
mock-up designs of items such as application screens, database layouts, and system
architectures. End users, designers, developers, database managers, and network
administrators should review and refine the prototyped designs in an iterative process
until they agree on an acceptable design. Audit, security, and quality assurance
personnel should be involved in the review and approval process. During this phase, the
system is designed to satisfy the functional requirements identified in the previous
phase.
Since problems in the design phase could be very expensive to solve in the later stage
of the software development, a variety of elements are considered in the design to
mitigate risk. These include:
• Identifying potential risks and defining mitigating design features.
• Performing a security risk assessment.
• Developing a conversion plan to migrate current data to the new system.
• Determining the operating environment.
• Defining major subsystems and their inputs and outputs.
• Allocating processes to resources.
• Preparing detailed logic specifications for each software module. The result is a
draft System Design Document which captures the preliminary design for the
system.
• Everything requiring user input or approval is documented and reviewed by the
user. Once these documents have been approved by the Agency CIO and Business
Sponsor, the final System Design Document is created to serve as the
Critical/Detailed Design for the system.
• This document receives a rigorous review by Agency technical and functional
representatives to ensure that it satisfies the business requirements. Concurrent
with the development of the system design, the Agency Project Manager begins
development of the Implementation Plan, Operations and Maintenance Manual,
and the Training Plan.
DEVELOPMENT PHASE
The development phase involves converting design specifications into
executable programs. Effective development standards include requirements that
programmers and other project participants discuss design specifications before
programming begins. The procedures help ensure programmers clearly understand
program designs and functional requirements. Programmers use various techniques
to develop computer programs. The large transactionoriented programs associated
with financial institutions have traditionally been developed using procedural
programming techniques. Procedural programming involves the line-by-line
scripting of logical instructions that are combined to form a program. Effective
completion of the previous stages is a key factor in the success of the Development
phase.
The Development phase consists of:
• Translating the detailed requirements and design into system components.
• Testing individual elements (units) for usability.
• Preparing for integration and testing of the IT system.
INTEGRATION AND TEST PHASE
• Subsystem integration, system, security, and user acceptance testing is conducted
during the integration and test phase. The user, with those responsible for quality
assurance, validates that the functional requirements, as defined in the functional
requirements document, are satisfied by the developed or modified system. OIT
Security staff assess the system security and issue a security certification and
accreditation prior to installation/implementation.
Multiple levels of testing are performed, including:
• Testing at the development facility by the contractor and possibly supported by
end users
• Testing as a deployed system with end users working together with contract
personnel
• Operational testing by the end user alone performing all functions.
Requirements are traced throughout testing; a final Independent
Verification & Validation evaluation is performed and all documentation is
reviewed and accepted prior to acceptance of the system.
IMPLEMENTATION PHASE
This phase is initiated after the system has been tested and accepted by the user.
In this phase, the system is installed to support the intended business functions. System
performance is compared to performance objectives established during the planning
phase. Implementation includes user notification, user training, installation of hardware,
installation of software onto production computers, and integration of the system into
daily work processes. This phase continues until the system is operating in production
in accordance with the defined user requirements.
OPERATIONS AND MAINTENANCE PHASE
The system operation is ongoing. The system is monitored for continued
performance in accordance with user requirements and needed system modifications are
incorporated. Operations continue as long as the system can be effectively adapted to
respond to the organization’s needs. When modifications or changes are identified, the
system may re-enter the planning phase.
The purpose of this phase is to:
• Operate, maintain, and enhance the system.
• Certify that the system can process sensitive information.
• Conduct periodic assessments of the system to ensure the functional requirements
continue to be satisfied.
• Determine when the system needs to be modernized, replaced, or retired.
HARDWARE AND SOFTWARE REQUIREMENTS
[Link] SYSTEM : WINDOWS 10 AND ABOVE
II. PROCESSOR : Core I5
III. MOTHERBOARD :
1.845 OR 915,995 FOR PENTIUM 0R MSI
K9MM-V VIA K8M800+8237R PLUS
CHIPSET FOR AMD ATHALON
IV. RAM : 512MB+
V. Hard disk : SATA 40 GB OR ABOVE
VI. CD/DVD r/w multi drive combo: (If back up required)
(If Backup required)
VII. FLOPPY DRIVE 1.44 MB :
VIII. MONITOR 14.1 or 15 -17 inch
IX. Key board and mouse
X. Printer : (if print is required – [Hard copy])
SOFTWARE REQUIREMENTS:
• Windows OS
• Python
• MySQL connector module
Introduction Of Python
Python is a high-level, interpreted programming language that is known
for its simplicity, readability, and versatility. It was created by Guido van
Rossum and first released in 1991. Python emphasizes code readability
and a clean, straightforward syntax, making it an excellent choice for
beginners as well as experienced developers.
Key Features of Python:
1. Easy to Learn and Use: Python's syntax is clear and readable, reducing
the complexity of learning and writing code.
2. Interpreted Language: Python code is executed line by line, making
debugging easier. It doesn't require compilation before execution.
3. Dynamically Typed: You don't need to declare variable types, as
Python handles this automatically at runtime.
4. High-Level Language: Python abstracts many complex details of
computer programming, allowing developers to focus on solving
problems.
5. Extensive Standard Library: Python comes with a wide range of built-
in modules and libraries, making it easy to perform tasks like working
with files, databases, and web services.
6. Cross-Platform: Python is available on most operating systems
(Windows, macOS, Linux), making it highly portable.
7. Object-Oriented: Python supports object-oriented programming,
allowing developers to organize code into reusable components.
8. Extensible: Python can integrate with other languages like C and C++,
and it can be embedded into applications written in other languages.
Python Applications:
• Web Development: Python is widely used in web development with
frameworks like Django, Flask, and Fast API.
• Data Science & Machine Learning: Libraries such as Pandas, NumPy,
SciPy, and TensorFlow make Python a leading choice in data analysis
and AI/ML development.
• Automation: Python is great for scripting and automating repetitive
tasks, such as file management, web scraping, or data processing.
• Software Development: Python is used for building both small scale
and large-scale software applications.
• Game Development: Libraries like Pygame allow developers to build
simple games.
Introduction of MySQL
MySQL is an open-source relational database management system (RDBMS) that
uses Structured Query Language (SQL) to manage and interact with data. It is one of
the most popular database systems in the world, widely used for web applications,
software development, and managing large-scale data.
Key Features of MySQL:
1. Relational Database: MySQL is based on the relational model, where data is
organized into tables with rows and columns. These tables can be related to one
another using keys (primary, foreign).
2. Open Source: MySQL is open-source software, meaning it is freely available
and can be modified or customized by users. It is released under the GNU
General Public License (GPL).
3. SQL-based: MySQL uses SQL (Structured Query Language) to query and
manage data. SQL is a standard language for interacting with relational
databases.
4. Cross-platform: MySQL is compatible with a variety of operating systems,
including Windows, Linux, macOS, and others.
5. Scalability: MySQL can handle large amounts of data and high traffic loads,
making it suitable for both small and large-scale applications.
6. High Performance: MySQL is designed for speed and efficiency, with support
for indexing, query optimization, and caching to deliver fast data retrieval and
manipulation.
7. Data Integrity: MySQL provides features like ACID compliance (Atomicity,
Consistency, Isolation, Durability) to ensure data integrity, even in the case of
system failures.
8. Security: MySQL has robust security features such as user authentication,
access control, encryption, and secure connections to protect data from
unauthorized access.
9. Replication and Backup: MySQL supports data replication, allowing for data to
be mirrored across multiple servers for redundancy and backup purposes.
Key Components of MySQL:
• Database: A collection of related tables that store data.
• Table: A structured collection of data organized in rows and columns.
• Query: A request to interact with the database, such as retrieving, inserting,
updating, or deleting data.
• Index: A structure that improves the speed of data retrieval.
• Stored Procedures and Triggers: These are pre-defined SQL commands that can
be executed automatically or at specified times.
MySQL Use Cases:
• Web Development: MySQL is commonly used as the database engine behind
dynamic websites and web applications, often in combination with PHP, Python,
or other server-side languages (as part of the LAMP stack:
Linux, Apache, MySQL, PHP/Python).
• Data Management: It’s widely used in applications requiring structured data
storage, such as content management systems (CMS), e-commerce platforms,
and customer relationship management (CRM) software.
• Business Applications: MySQL is used for enterprise resource planning (ERP),
financial systems, and data warehousing applications.
• Embedded Systems: MySQL can be embedded in software applications that
require database functionality.
• FLOW CHART
SOURCE CODE
[Link]
from database import connect_to_database, close_database
import admin import doctor import patient
def login(connection):
username = input("Enter username: ")
password = input("Enter password: ") cursor = [Link](dictionary=True)
query = "SELECT * FROM users WHERE username = %s AND password =
%s" [Link](query, (username,
password))
user = [Link]() if user:
print(f"Welcome, {user['username']}!")
return user else:
print("Invalid credentials. Please try again.") return
None
def main():
connection = connect_to_database() if
not connection:
return
user = None
while not user:
user = login(connection) if
user['role'] == 'admin': while
True:
print("\nAdmin Menu") print("1. Add
Doctor") print("2.
View Doctors") print("3. Delete Doctor")
print("4. Add Patient") print("5. View
Patients") print("6.
Discharge Patient") print("7. View
Appointments") print("8. Logout")
choice = int(input("Enter your choice: "))
if choice == 1:
admin.add_doctor(connection) elif choice == 2:
admin.view_doctors(connection) elif choice == 3:
admin.delete_doctor(connection) elif
choice==4:
admin.add_patient(connection) elif
choice == 5:
admin.view_patients(connection)
elif choice == 6:
admin.discharge_patient(connection) elif choice ==
7:
admin.view_appointments(connection) elif choice == 8:
print("Logging out...")
break else:
print("Invalid choice!") elif
user['role'] == 'doctor': while True:
print("\nDoctor Menu") print("1.
View Assigned Patients") print("2. Complete
Appointment") print("3. Logout")
choice = int(input("Enter your choice: ")) if choice==1:
doctor.view_assigned_patients(connection, user['id']) elif choice
== 2: doctor.complete_appointment(connection)
elif choice == 3:
print("Logging out...")
break else:
print("Invalid choice!") elif
user['role'] == 'patient': while True:
print("\nPatient Menu")
print("1. Book Appoinment") print("2.
View Personal Records") print("3.
Logout")
choice = int(input("Enter your choice: ")) if
choice == 1: patient.book_appointment(connection,
user['id']) elif choice == 2:
patient.view_personal_records(connection, user['id'])
elif choice == 3:
print("Logging out...")
break else:
print("Invalid choice!") close_database(connection)
if __name__ == "__main__":
main()
2. [Link] def getid():
from database import connect_to_database, close_database
connection=connect_to_database(); cursor = [Link]()
query = "SELECT id FROM users order by id desc"
[Link](query) user = [Link]() return user[0] def
add_doctor(connection):
doc_id=int(getid())+1 name = input("Enter doctor's name: ")
password=input("Enter password") specialty
= input("Enter doctor's specialty: ") cursor = [Link]()
query = "INSERT INTO doctors (id,name, specialty) VALUES (%s,%s,
%s)"
q="insert into users(username,password,role)values(%s,%s,'doctor')"
[Link](query, (doc_id,name, specialty)) [Link](q,(name,password))
[Link]()
print("Doctor added successfully!")
def view_doctors(connection): cursor =
[Link]() query = "SELECT * FROM
doctors"
[Link](query) doctors
= [Link]()
print("\nDoctors:") for
doctor in doctors:
print(f"ID: {doctor[0]}, Name: {doctor[1]}, Specialty: {doctor[2]}") def
delete_doctor(connection): doctor_id =
int(input("Enter doctor ID to delete: ")) cursor = [Link]()
query = "DELETE FROM doctors WHERE id = %s"
[Link](query, (doctor_id,))
[Link]() print("Doctor deleted
successfully!")
def add_patient(connection): cursor
= [Link]() p_id=int(getid())+1
name=input("Enter Patient Name: ")
password=input("Enter password")
age=int(input("Enter age of person"))
gender=input("Enter Gender")
phone=input("Enter contact details")
query="insert into patients values(%s,%s,%s,%s,%s)" q="insert into
users(username,password,role)values(%s,%s,'patient')"
[Link](query,(p_id,name,age,gender,phone))
[Link](q,(name,password)) [Link]()
print("Patient Registered successfully!")
def view_patients(connection): cursor =
[Link]() query = "SELECT * FROM
patients" [Link](query) patients =
[Link]()
print("\nPatients:") for patient in
patients: print(f"ID: {patient[0]},
Name: {patient[1]}, Age: {patient[2]},
Gender: {patient[3]}, Phone: {patient[4]}")
def discharge_patient(connection): patient_id =
int(input("Enter patient ID to discharge: ")) cursor = [Link]()
query = "DELETE FROM patients WHERE id = %s" [Link](query,
(patient_id,)) [Link]() print("Patient discharged successfully!")
def view_appointments(connection): cursor =
[Link]() query
= """
SELECT [Link], [Link] AS patient_name, [Link] AS doctor_name,
a.appointment_date, [Link]
FROM appointments a
JOIN patients p ON a.patient_id = [Link]
JOIN doctors d ON a.doctor_id = [Link] """
[Link](query) appointments =
[Link]()
print("\nAppointments:") for appointment in appointments:
print(f"ID: {appointment[0]}, Patient: {appointment[1]}, Doctor:
{appointment[2]}, Date: {appointment[3]}, Status: {appointment[4]}")
[Link] def view_assigned_patients(connection, doctor_id):
cursor = [Link]() query
= """
SELECT [Link], [Link], [Link], a.appointment_date,[Link]
FROM appointments a
JOIN patients p ON a.patient_id = [Link]
WHERE a.doctor_id = %s AND [Link] = 'Scheduled'
"""
[Link](query, (doctor_id,)) patients =
[Link]()
print("\nAssigned Patients:") for
patient in patients:
print(f"Name: {patient[0]}, Age: {patient[1]}, Gender: {patient[2]},
Appointment Date: {patient[3]},Status : {patient[4]}")
def complete_appointment(connection):
appointment_id = int(input("Enter appointment ID to mark as completed: ")) cursor
= [Link]()
query = "UPDATE appointments SET status = 'Completed' WHERE id
= %s"
[Link](query, (appointment_id,)) [Link]()
print("Appointment marked as completed!")
[Link] def book_appointment(connection, patient_id):
doctor_id = int(input("Enter doctor ID to book an appointment with: "))
appointment_date = input("Enter appointment date (YYYY-MM-DD):
")
cursor = [Link]()
query = "INSERT INTO appointments (patient_id, doctor_id,
appointment_date) VALUES (%s, %s, %s)"
[Link](query, (patient_id, doctor_id, appointment_date))
[Link]()
print("Appointment booked successfully!")
def view_personal_records(connection, patient_id):
cursor = [Link]() query
= """
SELECT [Link] AS doctor_name, a.appointment_date, [Link]
FROM appointments a
JOIN doctors d ON a.doctor_id = [Link]
WHERE a.patient_id = %s
"""
[Link](query, (patient_id,)) records
= [Link]()
print("\nYour Medical Records:") for record in records: print(f"Doctor:
{record[0]}, Appointment Date: {record[1]}, Status: {record[2]}")
6.
[Link] import [Link] from
[Link] import Error def
connect_to_database(): try:
connection = [Link]( host="localhost",
user="root", # Replace with your MySQL username password="root", #
Replace with your MySQL password database="hospital_management" )
if connection.is_connected():
print("Database connection successful!") return connection
except Error as e: print(f"Error connecting to MySQL: {e}") return
None def close_database(connection):
if connection and connection.is_connected(): [Link]()
print("Database connection closed.")
OUTPUT
1. LOGIN
2. ADMIN_MENU
3. ADD DOCTOR
4. VIEW DOCTORS
5. DELETE DOCTORS
6. ADD PATIENT
[Link] PATIENTS
[Link] PATIENT
[Link] APPOINTMENTS
10. PATIENT MENU
11. BOOK APPOINTMENT
12. VIEW PERSONAL RECORD
[Link] MENU
[Link] ASSIGNED PATIENTS
[Link] APPOINTMENT
TESTING
Software Testing is an empirical investigation conducted to provide stakeholders with
information about the quality of the product or service under test[1] , with respect to the
context in which it is intended to operate. Software Testing also provides an objective,
independent view of the software to allow the business to appreciate and understand the
risks at implementation of the software. Test techniques include, but are not limited to,
the process of executing a program or application with the intent of finding software
bugs.
It can also be stated as the process of validating and verifying that a software
program/application/product meets the business and technical requirements that guided
its design and development, so that it works as expected and can be implemented with
the same characteristics. Software Testing, depending on the testing method employed,
can be implemented at any time in the development process, however the most test
effort is employed after the requirements have been defined and coding process has
been completed.
TESTING METHODS
Software testing methods are traditionally divided into black box testing and
white box testing. These two approaches are used to describe the point of view that a
test engineer takes when designing test cases.
BLACK BOX TESTING
Black box testing treats the software as a "black box," without any knowledge of
internal implementation. Black box testing methods include: equivalence partitioning,
boundary value analysis, all-pairs testing, fuzz testing, model-based testing, traceability
matrix, exploratory testing and specificationbased testing.
SPECIFICATION-BASED TESTING
Specification-based testing aims to test the functionality of software according to
the applicable requirements.[16] Thus, the tester inputs data into, and only sees the
output from, the test object. This level of testing usually requires thorough test cases to
be provided to the tester, who then can simply verify that for a given input, the output
value (or behaviour), either "is" or "is not" the same as the expected value specified in
the test case. Specificationbased testing is necessary, but it is insufficient to guard
against certain risks
ADVANTAGES AND DISADVANTAGES
The black box tester has no "bonds" with the code, and a tester's perception is
very simple: a code must have bugs. Using the principle, "Ask and you shall receive,"
black box testers find bugs where programmers don't. But, on the other hand, black box
testing has been said to be "like a walk in a dark labyrinth without a flashlight," because
the tester doesn't know how the software being tested was actually constructed.
That's why there are situations when (1) a black box tester writes many test cases
to check something that can be tested by only one test case, and/or (2) some parts of the
back end are not tested at all. Therefore, black box testing has the advantage of "an
unaffiliated opinion," on the one hand, and the disadvantage of "blind exploring," on
the other.
WHITE BOX TESTING
White box testing, by contrast to black box testing, is when the tester has access
to the internal data structures and algorithms (and the code that implement these).
Types of white box testing:-
The following types of white box testing exist:
• api testing - Testing of the application using Public and Private APIs.
• Code coverage - creating tests to satisfy some criteria of code coverage.
For example, the test designer can create tests to cause all statements in the
program to be executed at least once.
• fault injection methods.
• mutation testing methods.
• static testing - White box testing includes all static testing.
CODE COMPLETENESS EVALUATION
White box testing methods can also be used to evaluate the completeness of a test
suite that was created with black box testing methods. This allows the software team to
examine parts of a system that are rarely tested and ensures that the most important
function points have been tested.
Two common forms of code coverage are:
• Function Coverage: Which reports on functions executed and
• Statement Coverage: Which reports on the number of lines executed to
complete the test.
They both return coverage metric, measured as a percentage
BIBLOGRAPHY
Computer science with python – Class XII By : Sumita Arora
Website: [Link]