A hospital appointment booking system developed in Java as a university project. The system provides a Swing-based GUI for patients to book appointments and a CLI for administrators to manage the hospital structure.
The GUI is designed for patients to easily manage their appointments with a user-friendly experience.
- User Authentication: Secure login and registration system with ID/Password validation.
- Dynamic Filtering: Real-time cascading selection for Hospital, Section, and Doctor. (Selecting a hospital updates sections; selecting a section updates doctors).
- Appointment Scheduling:
- View specific doctor schedules and constraints (Max patients per day).
- Date selection with validation (prevents past dates).
- Conflict detection to prevent double-booking.
- Data Persistence: Automatic saving of patient and appointment data to local storage.
The CLI serves as the administrative backbone of the system, allowing for complete system configuration.
- Admin Dashboard: Accessed via secure credentials.
- System Configuration:
- Add Hospitals: Create new hospital entities.
- Add Sections: Assign medical departments to hospitals.
- Add Doctors: Register new doctors with specific diploma IDs and daily quotas.
- Hierarchy Visualization: View the complete tree structure of the medical system (Hospital -> Section -> Doctor).
- Language: Java 21
- Build Tool: Maven
- UI Framework: Java Swing (AWT/Swing)
- Testing: JUnit 4
- Data Structure:
Hashtablefor O(1) access to records,LinkedListfor appointment history. - Design Patterns:
- MVC Principle: Separation of logic (
CRS,Doctor,Patient) from views (GUI,CLI). - Exception Handling: Custom exceptions like
DuplicateInfoExceptionandIDExceptionfor robust error management.
- MVC Principle: Separation of logic (
- Java Development Kit (JDK) 21 or higher
- Maven (optional - see alternative methods below)
git clone https://github.com/utkubascakir/Hospital-System.git
cd Hospital-SystemIf you don't have Maven installed:
Windows:
- Download Maven from https://maven.apache.org/download.cgi
- Extract to
C:\Program Files\Apache\maven - Add
C:\Program Files\Apache\maven\binto System PATH - Verify:
mvn --version
macOS/Linux:
# macOS (using Homebrew)
brew install maven
# Linux (Ubuntu/Debian)
sudo apt-get install maven
# Verify installation
mvn --versionBuild the project:
mvn clean install- Open the project folder in your IDE
- The IDE will automatically detect the
pom.xmland download dependencies - Right-click on the Main class and select "Run"
Note: Using an IDE is the easiest method if you don't want to install Maven separately.
You can run the application directly from the Main class. The system typically asks to choose between GUI or CLI mode upon startup.
To explore the full capabilities of the system, you can use the following pre-defined credentials or create your own:
- Action: Click "Create Account" on the login screen.
- ID: Any unique numeric ID (e.g., 12345)
- Password: Any secure password.
- Username (ID): 999
- Password: admin123
Note: Use these credentials to add new hospitals and doctors to the system.
The project includes comprehensive unit tests to ensure system integrity. Run the tests using Maven:
mvn testThis will execute tests for:
- Core System Components: CRS, Doctor, Patient, Hospital, Section
- Business Logic: Appointment scheduling, data validation, conflict detection
- Data Management: Person registry, schedule management
All test files can be found in the src/test/java/ directory.
src/
├── main/java/
│ ├── classes/ # Core Logic (CRS, Doctor, Hospital, etc.)
│ ├── exceptions/ # Custom Exception Classes
│ └── gui/ # UI Implementations (GUI.java, CLI.java)
└── test/java/ # JUnit Test Suites
This project was developed as a final assignment for the Object-Oriented Programming course to demonstrate proficiency in Java application development and software architecture.