Note
Please import the database in MySQL before running the program.
Step 1 : Download and open XAMPP
Step 2 : Check Apache and MySQL checkbox
Step 3 : Navigate to the import tab and import the "database_schema.sql" file
Step 4 : Click on "Go" button at the bottom to complete the database setup
This is a comprehensive Java-based Clinic Management System developed for Tunku Abdul Rahman University of Management and Technology (TAR UMT). The system effectively models one-to-many relationships using custom Abstract Data Types (ADTs) and follows the ECB (Entity-Control-Boundary) pattern.
TAR UMT is establishing an on-campus clinic to provide medical care for students. The system allows students to:
- Book appointments or walk-ins for doctor consultations
- Make payments
- Get medicines
- Access various clinic functions
The system effectively models one-to-many relationships using collection ADTs and demonstrates creativity and competence in implementation.
- Java 23 - Core programming language
- Maven - Dependency management and build tool
- MySQL - Database management system
- HikariCP - Connection pooling
- Custom ADTs - No use of java.util.Collection libraries
- ECB Pattern (Entity-Control-Boundary)
- Layered Architecture with clear separation of concerns
- DAO Pattern for data access operations
src/main/java/
├── entity/ # Data models and entities
├── control/ # Business logic and controllers
├── boundary/ # User interface components
├── dao/ # Data Access Objects
├── utility/ # Helper classes and utilities
└── adt/ # Abstract Data Types (custom implementations)
database_schema.sql # Complete database schema with triggers
Features:
- Patient registration and record maintenance
- Queuing management using custom Queue ADT
- Patient search and retrieval
- Patient status management (active/inactive)
Key Components:
PatientManagementControl- Business logicPatiententity with inheritance fromPerson- Custom
Queue<T>implementation for patient queuing - Patient registration and queue status reports
Features:
- Doctor information management
- Duty schedules and availability tracking
- Schedule management with custom ADTs
- Doctor search by specialty and availability
Key Components:
DoctorManagementControl- Business logicDoctorentity with inheritance fromPersonScheduleentity for duty schedules- Doctor information and schedule reports
Features:
- Patient consultation management
- Appointment scheduling and tracking
- Consultation status management (Scheduled, In Progress, Completed, Cancelled)
- Subsequent visit appointment arrangement
Key Components:
ConsultationManagementControl- Business logicConsultationentity with status tracking- Consultation scheduling and completion workflows
- Consultation and scheduled consultations reports
Features:
- Patient diagnosis management
- Treatment history records
- Treatment status tracking (Prescribed, In Progress, Completed, Cancelled)
- Treatment plan and medication management
Key Components:
MedicalTreatmentControl- Business logicMedicalTreatmententity with comprehensive treatment data- Treatment history tracking
- Treatment and treatment history reports
Features:
- Medicine dispensing after doctor consultation
- Medicine stock control and management
- Prescription management
- Stock level monitoring and alerts
Key Components:
PharmacyManagementControl- Business logicMedicineentity with stock managementPrescriptionentity with prescribed medicine tracking- Medicine stock and prescription reports
DictionaryInterface<K, V>- Interface for key-value collections (add, remove, get, contains, size, clear)ArrayBucketList<K, V>- Custom hash-bucket structure with circular linked-list buckets and dynamic resizing- Supports adding, removing, lookup by key, containment checks, iteration, and converting to arrays for sorting
- Provides optional queue-like helpers for workflows (e.g.,
addToQueue,removeFront,peekFront,getQueueSize)
HashStrategyenum and factory helpers inArrayBucketListFactoryto tune hashing by attribute type:NAME,NAME_PREFIX,PHONE,EMAIL,POSTCODE, plus helpers forSTRING_ID,ENUM,LOCAL_DATE
- Choose appropriate strategy per use case to improve distribution across buckets
Note: All ADTs are custom implementations without using java.util.Collection classes for the primary data structures.
- address - Address information
- person - Base table for patients and doctors
- patient - Patient-specific information
- doctor - Doctor-specific information
- schedule - Doctor duty schedules
- consultation - Patient consultations
- medical_treatment - Treatment records
- medicine - Medicine inventory
- prescription - Prescription records
- prescribed_medicine - Junction table for prescriptions and medicines
- Patient IDs: P000000001, P000000002, etc.
- Doctor IDs: D000000001, D000000002, etc.
- Consultation IDs: C000000001, C000000002, etc.
- Treatment IDs: T000000001, T000000002, etc.
- Medicine IDs: M000000001, M000000002, etc.
- Prescription IDs: PR00000001, PR00000002, etc.
- Foreign Key Constraints - Maintains data integrity
- Indexes - Optimized for performance
- Triggers - Automatic ID generation and status updates
- Views - Common query abstractions
- Sample Data - Pre-populated for testing
Each module includes at least 2 summary reports:
- Patient Record Summary Report - Detailed Patient records
- Patient Demographics Report - Patient distribution by age, gender and blood type
- Patient Visit History Report - Recent Patient Visits
- Doctor Information Report - Doctor details and availability
- Doctor Workload Report - Doctor workload and utilization
- Doctor Performance Report - Doctor review by Patients
- Consultation Report - All consultations with status
- Consultation History Report - Recent consultations
- Consultation Efficiency Report - Consultation time and efficiency
- Treatment Analysis Report - Detailed medical treatment analysis
- Treatment Status Report - All treatments with status
- Treatment Outcome Report - Patient treatment outcome and follow-up
- Medicine Stock Report - Inventory status and stock levels
- Prescription Report - Prescription details and status
- Medicine Usage Report - Medicine utilization and tracking
- Java 23 or higher
- Maven 3.6 or higher
- MySQL 8.0 or higher
The ClinicManagementSystem class provides a console-based interface for all modules:
- Patient Management - Register, update, and manage patients
- Doctor Management - Register doctors and manage schedules
- Consultation Management - Schedule and manage consultations
- Medical Treatment Management - Create and track treatments
- Pharmacy Management - Manage medicines and prescriptions
- Reports - Generate comprehensive system reports
The system includes sample data for testing all functionalities:
- Sample patients, doctors, and addresses
- Sample consultations and treatments
- Sample medicines and prescriptions
- Complete workflow demonstrations
Potential areas for improvement:
- Web-based user interface
- Mobile application
- Advanced reporting and analytics
- Integration with external systems
- Enhanced security features
This Clinic Management System demonstrates:
- Creativity in custom ADT implementations
- Competence in Java programming and database design
- Completeness in addressing all requirements
- Professionalism in code organization and documentation
The system is ready for deployment and can be extended with additional features as needed.
Developed for TAR UMT Data Structures and Algorithms Course Java 23 | Maven | MySQL | Custom ADTs | ECB Pattern