How loganihrishi/healthcare-management-system works
Project Overview & Main Components
• Project Type & Purpose: This is a healthcare management system designed to track patient information and manage appointment scheduling. It offers both a GUI and a TUI interface to allow healthcare staff to add, modify, cancel, and search appointments, as well as persist and load data from files.
• Main components identified from the file tree and README include:
a. User Interface (UI) Layer:
• GUI components (located in src/main/ui/gui – e.g., AppDetailsGUI, CancelAppGUI, PatientDetailsGUI, Main)
• TUI components (located in src/main/ui/tui – e.g., Main, StartApplication)
b. Model / Domain Layer:
• Core domain objects (in src/main/model – Appointment, Patient, Disease, Event, EventLog, and AppointmentList)
c. Persistence Layer:
• File handling logic (in src/main/persistence – AppointmentFileHandler, PatientFileHandler, WriteToFile) that interacts with the JSON data files stored in the "data" directory.
d. Testing Layer:
• Tests for both the model and persistence layers (located under src/test) that ensure proper functioning of the system.
e. Support Libraries & External Dependencies:
• External JARs for JSON processing, JUnit-based testing, and additional utilities (found in the lib directory)
Relationships and Interactions between Components
• The Model/Domain Layer contains business logic and encapsulates state (e.g., Appointment, Patient). This layer interacts with the Persistence Layer to persist data (using classes such as AppointmentFileHandler and PatientFileHandler) into the JSON files.
• The Persistence Layer acts as the intermediary between the domain model and the stored data. It manages reading from and writing to the files in the data directory.
• An Event Logging component (via the Event and EventLog classes) logs actions and events such as appointment cancellations and retrieval attempts, which may be optionally included as a subordinate process within the Model.
• The Testing Layer, although not part of the runtime architecture, verifies the interactions between these components and should be mentioned as part of the development and quality assurance process.
Architectural Patterns and Design Principles
• The project follows a separation of concerns:
• The UI layer is separated into different modules (GUI and TUI) which both interact with the same underlying model.
• The domain model is decoupled from the persistence mechanism, which hints at a layered or MVC-like pattern even if a formal controller isn’t explicitly defined.
• File-based persistence (using JSON files) rather than a traditional database, with file handlers abstracting data I/O operations.
• The design also supports event logging to track key actions and errors.
Final Advice
• Every component is clearly labeled.
• Incorporate annotations (if possible) to note any major functions or responsibilities of each component.