A comprehensive desktop application for managing hospital operations including patient records, doctor appointments, diagnoses, and prescriptions built with Java Swing and MySQL.
- Overview
- Features
- Screenshots
- Technologies Used
- System Architecture
- Database Schema
- Installation
- Usage
- User Roles
- Future Enhancements
- Contributing
- License
- Contact
The Hospital Management System is a desktop application designed to streamline hospital operations and improve healthcare service delivery. Built using Java Swing for the GUI and MySQL for database management, this system provides a complete solution for managing patients, doctors, appointments, and medical records.
- ๐ฅ Comprehensive Management: Handles patients, doctors, appointments, and medical records
- ๐ฅ Multi-User Support: Different access levels for doctors, receptionists, and patients
- ๐ Secure Authentication: User login system with role-based access control
- ๐พ Persistent Storage: MySQL database for reliable data management
- ๐ฅ๏ธ User-Friendly Interface: Intuitive GUI built with Java Swing
- โ User registration and authentication
- โ Role-based access (Doctor, Receptionist, Patient)
- โ Secure password handling
- โ User profile management
- โ Add new patient records
- โ Edit existing patient information
- โ Remove patient records
- โ Search and filter patients
- โ View patient medical history
- โ Store diagnosis and prescription information
- โ Add doctor profiles
- โ Update doctor information
- โ Assign doctors to rooms
- โ Manage doctor contact information
- โ View doctor schedules
- โ Schedule appointments
- โ Assign patients to doctors
- โ Room allocation
- โ Appointment tracking
- โ Edit and cancel appointments
- โ Search appointments by patient name
- โ Record patient diagnoses
- โ Create prescriptions
- โ Update medical records
- โ Track treatment history
- โ Generate patient reports
- โ View appointment history
- โ Track doctor-patient relationships
- Java Swing: GUI framework for desktop application
- NetBeans Form Designer: Visual form designer for UI components
- Java SE: Core Java for application logic
- JDBC: Database connectivity
- MySQL Connector/J: MySQL driver for Java
- MySQL: Relational database management system
- Apache NetBeans: Integrated Development Environment (IDE)
- MySQL Workbench: Database design and management
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Presentation Layer โ
โ (Java Swing GUI Forms) โ
โ - Login Form โ
โ - Main Form โ
โ - Patient Management Forms โ
โ - Appointment Forms โ
โ - Diagnosis Forms โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Business Logic Layer โ
โ (Java Classes) โ
โ - Patients.java โ
โ - Doctors.java โ
โ - Appointments.java โ
โ - create_user.java โ
โ - DiagANDpres.java โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Data Access Layer โ
โ - MyConnection.java (JDBC) โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Database Layer โ
โ (MySQL Database) โ
โ - Tables: patient, doctor, โ
โ appointment, create_user, etc. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CREATE TABLE patient (
ID INT PRIMARY KEY AUTO_INCREMENT,
`Full Name` VARCHAR(100),
`Phone.no` VARCHAR(20),
`E-mail` VARCHAR(100),
Complain TEXT,
Diagnosis TEXT,
Prescription TEXT
);CREATE TABLE specification (
ID INT PRIMARY KEY AUTO_INCREMENT,
`Doctor Name` VARCHAR(100),
`Phone Number` VARCHAR(20),
`Room Number` VARCHAR(10)
);CREATE TABLE appointment (
`Appointment no.` INT PRIMARY KEY AUTO_INCREMENT,
`Doctor Name` VARCHAR(100),
`Patient Name` VARCHAR(100),
`Room no.` INT,
FOREIGN KEY (`Doctor Name`) REFERENCES specification(ID) ON DELETE CASCADE,
FOREIGN KEY (`Patient Name`) REFERENCES patient(ID) ON DELETE CASCADE
);CREATE TABLE create_user (
ID INT PRIMARY KEY AUTO_INCREMENT,
`Full Name` VARCHAR(100),
Username VARCHAR(50) UNIQUE,
Password VARCHAR(100),
Type ENUM('Doctor', 'Receptionist', 'Patient')
);Before you begin, ensure you have the following installed:
- โ
Java Development Kit (JDK) 8 or higher
- Download from: https://www.oracle.com/java/technologies/downloads/
- โ
MySQL Server 5.7 or higher
- Download from: https://dev.mysql.com/downloads/
- โ
Apache NetBeans IDE (recommended) or any Java IDE
- Download from: https://netbeans.apache.org/download/
- โ
MySQL Connector/J (JDBC Driver)
- Download from: https://dev.mysql.com/downloads/connector/j/
git clone https://github.com/YOUR_USERNAME/hospital-management-system.git
cd hospital-management-system-
Start MySQL Server
# On Windows net start MySQL80 # On macOS/Linux sudo service mysql start
-
Create Database
mysql -u root -p
-
Run the following SQL commands:
CREATE DATABASE hospital_db; USE hospital_db; -- Run the SQL script provided in database/schema.sql SOURCE database/schema.sql;
Or manually create tables using the schema in Database Schema
-
Locate
MyConnection.javain thesrc/hospitalmanagement/folder -
Update the database credentials:
public class MyConnection { private String url = "jdbc:mysql://localhost:3306/hospital_db"; private String username = "root"; // Change to your MySQL username private String password = "your_password"; // Change to your MySQL password // Rest of the code... }
- Right-click on Libraries in the project tree
- Select Add JAR/Folder
- Navigate to where you downloaded
mysql-connector-j-x.x.x.jar - Select and add it
# Place mysql-connector-j.jar in lib/ folder
cp path/to/mysql-connector-j-x.x.x.jar lib/- Open the project in NetBeans
- Right-click on the project
- Select Clean and Build
- Right-click again and select Run
# Compile
javac -cp "lib/*" -d build/classes src/hospitalmanagement/*.java
# Run
java -cp "build/classes:lib/*" hospitalmanagement.Hospital_Front_Form-
Launch the application
- Run
Hospital_Front_Form.java
- Run
-
Create a user account
- Click "Signup"
- Enter your details
- Select user type (Doctor/Receptionist/Patient)
- Create username and password
-
Login
- Click "Login"
- Enter your credentials
- Select your user type
- Click "Enter"
-
Add New Patients
- Navigate to Patient Management
- Click "Add Patient"
- Fill in patient details
- Save
-
Schedule Appointments
- Go to Appointment Management
- Select patient and doctor
- Assign room
- Schedule appointment
-
View Patient Information
- Access patient records
- Review medical history
-
Add Diagnosis and Prescription
- Open patient record
- Enter diagnosis
- Write prescription
- Save changes
-
View Appointments
- Check scheduled appointments
- View assigned doctor
- See room number
-
Update Personal Information
- Edit contact details
- Update complaints
- Manage patient registration
- Schedule appointments
- View all appointments
- Manage doctor information
- View assigned patients
- Add diagnoses and prescriptions
- Review patient medical history
- Manage appointment schedule
- View personal information
- Check appointments
- View diagnoses and prescriptions
- Update contact information
hospital-management-system/
โ
โโโ src/
โ โโโ hospitalmanagement/
โ โโโ Appointments.java # Appointment management
โ โโโ Appoinyment_Table.java # Appointment viewing
โ โโโ create_user.java # User registration
โ โโโ DiagANDpres.java # Diagnosis & prescription logic
โ โโโ Diagnosis_prescription.java # Diagnosis form UI
โ โโโ Doctors.java # Doctor management
โ โโโ Fllin.java # Patient form filling
โ โโโ Hospital_Front_Form.java # Landing page
โ โโโ HospitalManagement.java # Main application entry
โ โโโ Login.java # Login form
โ โโโ MainForm.java # Main dashboard
โ โโโ ManageAppointments.java # Appointment management UI
โ โโโ MyConnection.java # Database connection (YOU NEED TO CREATE THIS)
โ โโโ Patients.java # Patient management (YOU NEED TO CREATE THIS)
โ โโโ User_Creation.java # User creation form (YOU NEED TO CREATE THIS)
โ โ
โ โโโ *.form # NetBeans form files
โ
โโโ lib/
โ โโโ mysql-connector-j-x.x.x.jar # MySQL JDBC driver
โ
โโโ database/
โ โโโ schema.sql # Database schema
โ
โโโ images/
โ โโโ banner.png
โ โโโ logo.png
โ
โโโ screenshots/
โ โโโ login.png
โ โโโ dashboard.png
โ โโโ ...
โ
โโโ README.md
โโโ LICENSE
โโโ .gitignore
- Advanced Search: Implement full-text search for patients and appointments
- Analytics Dashboard: Add statistics and charts for hospital metrics
- Email Notifications: Send appointment reminders to patients
- PDF Reports: Generate printable patient reports and prescriptions
- Multi-Language Support: Add internationalization
- Backup & Restore: Automated database backup functionality
- Billing System: Integrate patient billing and payment tracking
- Medical History Timeline: Visual timeline of patient treatments
- Web Interface: Develop a web-based version using Spring Boot
- Mobile App: Create Android/iOS companion apps
- Cloud Integration: Deploy on cloud with AWS/Azure
- Role Permissions: Granular permission system
- Audit Logging: Track all system changes for compliance
Contributions are welcome! Please feel free to submit a Pull Request.
-
Fork the repository
# Click the "Fork" button on GitHub -
Clone your fork
git clone https://github.com/YOUR_USERNAME/hospital-management-system.git
-
Create a feature branch
git checkout -b feature/AmazingFeature
-
Make your changes and commit
git commit -m "Add some AmazingFeature" -
Push to your fork
git push origin feature/AmazingFeature
-
Open a Pull Request
- Follow Java naming conventions
- Add comments to your code
- Update README if adding new features
- Test your changes thoroughly
- Follow the existing code style
This project is licensed under the MIT License - see the LICENSE file for details.
Aya Abdel Moniem
- ๐ง Email: Aya.abdelmoniem.afattah@gmail.com
- ๐ผ LinkedIn: linkedin.com/in/aya-abdel-moniem-737552214
- ๐ GitHub: @YOUR_USERNAME
- ๐ Portfolio: [Your Portfolio Website]
- NetBeans IDE for the powerful development environment
- MySQL for reliable database management
- Java Swing for GUI components
- The British University in Egypt for academic support
This is an educational project developed for learning purposes. While it demonstrates key concepts of hospital management systems, it should not be used in production medical environments without proper security audits, compliance checks, and professional validation.
For Medical Use: Consult with healthcare IT professionals and ensure compliance with HIPAA, GDPR, or other relevant healthcare data regulations in your region.
Made with โค๏ธ by Aya Abdel Moniem
A comprehensive hospital management solution for modern healthcare





