A Java-based desktop application designed to manage doctors and patient consultations for a skin consultation clinic. The system allows administrators to manage doctor records, schedule consultations, and store data persistently using file storage.
The application combines a console-based management system with Swing GUI tables for viewing doctors and consultations.
- Add new doctors with details including:
- First name
- Surname
- Gender
- Date of birth
- Mobile number
- Specialisation
- Remove doctors using their medical licence number
- View all registered doctors sorted alphabetically
- Limit of 10 doctors enforced by the system
- Select doctors through an interactive Swing JTable
- Add consultations linked to a selected doctor
- View consultations in:
- Console view
- Graphical table view
- Save doctor data to a CSV file
- Load previously saved data from file
- Ensures data can be restored when the program restarts
- Java Swing GUI tables for:
- Viewing doctor records
- Selecting doctors
- Viewing consultations
- Tables support sorting and selection
The system includes validation for:
- Names (alphabetic characters only)
- Gender values
- Specialisation fields
- UK mobile numbers
- Valid dates of birth
- Medical licence numbers
- Java
- Java Swing for GUI components
- Collections Framework
- File I/O (BufferedReader / BufferedWriter)
- Regex validation
- Object-Oriented Programming
The system follows an object-oriented design using inheritance, encapsulation, and modular class structures.
Person (Abstract Class)
│
├── Doctor
│ └── Consultation (list associated with each doctor)
│
└── Patient
| Class | Responsibility |
|---|---|
Main |
Core application controller that manages the console menu, system operations, and program flow |
Person |
Abstract base class that stores shared attributes such as first name, surname, gender, mobile number, and date of birth |
Doctor |
Extends Person and represents a doctor in the clinic, including medical licence number, specialisation, and a list of consultations |
Patient |
Extends Person and represents a patient with a unique ID and personal details |
Consultation |
Represents a consultation between a patient and a doctor |
DoctorsList |
Swing TableModel used to display doctors in a GUI table |
DoctorsAvailable |
Table model used when selecting a doctor for a consultation |
AddConsultation |
Handles the creation of consultations through the GUI |
ViewConsultation |
Displays consultation records in a graphical table view |
Date |
Stores and manages date-related information |
Inheritance
DoctorandPatientinherit common properties from thePersonclass.- Reduces duplication by centralising shared attributes.
Encapsulation
- Fields are private or protected and accessed through getters and setters.
- Ensures controlled access to object data.
Polymorphism
DoctorimplementsComparable<Doctor>to enable sorting doctors by surname.equals()is overridden inPatientto compare patients based on personal details.
Composition
- Each
Doctorcontains anArrayList<Consultation>representing all consultations associated with that doctor.
Serialization
- The
Doctorclass implementsSerializable, allowing doctor objects to be saved and restored when persisting system data.
This modular architecture separates data models, business logic, and user interface components, making the system easier to maintain and extend.
- The program launches a console menu interface.
- The user selects options to:
- Manage doctors
- Add consultations
- View data
- Doctor information is stored in an ArrayList during runtime.
- Data can be saved to or restored from a CSV file.
- Swing tables provide a graphical way to view and select data.
1: Add a doctor
2: Delete a doctor
3: View all doctors
4: Save data into file
5: Load data from file
6: View doctors in table
7: Add a consultation
8: View consultations in table
9: View consultations in console
10: Save & Exit
This project demonstrates:
- Object-Oriented Programming in Java
- Data validation and error handling
- File persistence using CSV
- Building graphical interfaces with Swing
- Managing collections with ArrayLists
- Designing modular software systems
Developed as part of a Computer Science coursework project focusing on software design, Java programming, and GUI development.