0% found this document useful (0 votes)
6 views6 pages

Documentation

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 6

1.

Introduction
The Hospital Management System is designed to efficiently manage hospital
operations, including patient and staff records, doctor management, and
appointment bookings. This project integrates a Python interface with MySQL to
store and manipulate data, ensuring secure and streamlined hospital
administration. The system is divided into three main sections: Admin, Patient,
and Doctor, each with its respective functionalities.

2. System Requirements
 Programming Language: Python 3.x
 Database: MySQL
 Python Libraries:
 mysql.connector for database connectivity.
 os module for operating system interactions.

3. Database Design
The system uses multiple tables in MySQL to manage data. Below are the key
tables:

• patient: Stores patient details such as name, age, gender, phone number,
admit date, and their medical problem.
• patientrecord: Holds records of discharged patients.
• staff: Maintains information about hospital staff members.
• staffrecord: Keeps track of removed staff members' records.
• doctor: Contains details about the doctors, including department and
experience.
• doctorrecord: Logs historical data for doctors who have left the hospital.
• password: Stores hashed admin passwords.
• apply_job: Records job applications for both doctors and staff.
• symptoms_and_dept: Maps symptoms to relevant medical departments.
• appointment: Manages appointments made by patients with doctors.

4. Functionality Overview
4.1 Admin Section

The admin has full control over the system, including adding or removing patients,
staff, and doctors. Key functionalities include:

 Add Patient/Staff/Doctor: Allows the admin to input details and store them
in the database.
 View Records: Displays patient and staff records from the database.
 Update Records: Admin can modify patient and staff details.
 Remove Patient/Staff/Doctor: The admin can discharge a patient or remove
a staff/doctor.
 Change Password: Admin can update the system's password for enhanced
security.
 Job Application Approval: Admin can approve or reject job applications
from doctors.
4. Patient
2 Section

Patients can:

 Book Appointments : Based on symptoms, patients can book appointments


with relevant doctors.

4.3 Doctor
Section

• View Appointments: Doctors can check the appointments scheduled with


them.

5. Key Python Functions


5. Admin
1 Functions
• addpatients(): Adds new patient details into the patient table. The
function ensures valid input by checking the format for patient name, age,
gender, phone number, etc.
• patientsrecord(): Displays patient details by searching based on
patient ID. It can display both current patients and discharged patients
from the patientrecord table.
• discharge_patient(): Discharges a patient by moving their details
from the patient table to the patientrecord table and removing their entry
from the current patient list.
• addstaff(): Adds a new staff member. This function also ensures
valid inputs such as name, age, gender, and phone number.
• staffrecord(): Retrieves and displays records of current and past staff.
• removestaff(): Removes a staff member, moving their information to
the staffrecord table.
• add_doctor(): Registers a new doctor with details including
name, department, and work experience.
• removedoctor(): Removes a doctor and moves their information to
the doctorrecord table.

• changepassword(): Allows the admin to change the system's


password. It uses the hashlib library to hash the new password before
storing it in the database.
• Approvalrequired(): Handles the approval process for job
applications. It either approves or rejects applications based on input.

5. Patient
2 Functions

• patient_menu(): Provides the patient section, where patients can:

• Book an appointment using book_appointment(), where they select


their medical issue and the system recommends a doctor from the appropriate
department.
• Edit or cancel appointments by providing an appointment ID.
• View their current appointments.

5. Doctor
3 Functions
 doctor_menu(): The doctor section allows doctors to:

 View their appointments.


 Edit or cancel appointments.

Doctors log in using their phone number, which is validated to check if it matches
any entry in the doctor table.

6. Data Validation
To ensure data integrity, various validations are in place:

 Patient Name/Age/Gender: Names must contain only alphabets, age must be


between 0 and 150, and gender must be 'male' or 'female'.
 Phone Number: Must be exactly 10 digits and should not start with 0.
 Password Matching: During account creation or password update, the system
ensures both passwords match.

7. MySQL Database Integration


The Python program connects to the MySQL database using mysql.connector.
Queries such as CREATE TABLE, INSERT, SELECT, UPDATE,
and DELETE are executed to manage the hospital's data.

8. User Interaction
The system uses a console-based interface with clear prompts for inputs and
choices. Users interact by selecting options from the displayed menus and
providing necessary details (e.g., names, IDs, and phone numbers).

9. Conclusion
The Hospital Management System provides a structured and efficient solution for
managing hospital operations. With robust data handling via Python and MySQL,
it simplifies patient management, staff allocation, and doctor scheduling, ensuring
a smooth administrative experience.

You might also like