Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

APU Medical Center (AMC) 🏥

3rd Semester Object-Oriented Programming in Java (OOPJ) Assignment Project
Developed by: Team 9


📋 Overview

APU Medical Center (AMC) is a comprehensive desktop application developed using Java Swing and Object-Oriented Programming (OOP) principles. The application streamlines and digitizes healthcare operations—including appointment scheduling, patient registration, doctor consultation tracking, feedback submission, billing, and report generation—by seamlessly connecting four primary user roles: Managers, Staff, Doctors, and Customers (Patients).


🔑 Key Features & User Roles

1. 🛡️ Manager Dashboard

  • Executive Overview: Real-time KPI stat cards displaying total counts for customers, doctors, staff/managers, appointments, pending requests, and estimated revenue (RM).
  • User Management: Full CRUD (Create, Read, Update, Delete) capabilities for Manager, Staff, and Doctor accounts.
  • System-Wide Appointment Monitoring: View all scheduled, pending, assigned, completed, and cancelled appointments.
  • Feedback & Comment Moderation: Oversight and deletion of user feedback entries.
  • Analytics & Report Generation: Generates comprehensive textual analytical reports detailing user demographics, appointment status breakdowns, revenue performance, and feedback statistics. Includes report download functionality (AMC_Report.txt).

2. 📋 Staff Dashboard

  • Customer Management: Add, update, view, and delete customer (patient) profiles.
  • Appointment Booking & Payment Processing: Book new appointments with doctor selection, auto-calculated or custom consultation charges, date picker modal, interactive time spinner, and real-time conflict checking (prevents double booking).
  • Automated Receipts: Automatically generates formatted payment receipts (receipts.txt) with receipt dialog popups.
  • Manage Appointments: View, modify schedule details, or cancel pending appointments.
  • Profile Management: View and edit staff profile details.

3. 👨‍⚕️ Doctor Dashboard

  • My Appointments: View assigned appointments; mark consults as completed with real-time feedback/comments for patients.
  • Medical History: Review completed and cancelled appointment histories alongside patient problem statements and fee records.
  • Profile & Charges Management: Manage specialty information and default consultation fees.

4. 👤 Customer (Patient) Dashboard

  • My Appointments: View upcoming appointment status, doctor details, and scheduled times.
  • Receipt Viewing: View and print official AMC payment receipts for booked consultations.
  • History & Feedbacks: Access historical consultation logs, view doctor feedback, and submit comments/ratings for completed visits.
  • Profile Management: Update personal contact details and address information.

🧬 Object-Oriented Programming (OOP) Implementation

The application strictly adheres to core Object-Oriented Programming paradigms:

1. Inheritance & Abstraction

  • User (amc.models.User): An abstract parent class encapsulating common user attributes (username, password, name, age, gender, email, phone, address) and declaring abstract methods toFileString() and getRole().
  • Derived Subclasses: Customer, Doctor, Manager, and Staff extend User, inheriting base properties while implementing role-specific attributes (e.g., specialty and defaultCharges in Doctor).
                    ┌───────────────┐
                    │  User (Abstract)│
                    └───────┬───────┘
                            │
        ┌──────────────┬────┴─────────┬──────────────┐
        │              │              │              │
┌───────┴──────┐┌──────┴──────┐┌──────┴──────┐┌──────┴──────┐
│   Customer   ││   Doctor    ││   Manager   ││    Staff     │
└──────────────┘└─────────────┘└─────────────┘└──────────────┘

2. Encapsulation

  • Instance fields in model classes (Appointment, Payment, Feedback, User) are kept private or protected.
  • Controlled access is provided using getter and setter methods with input sanitization (e.g., escaping delimiter characters | to maintain file integrity).

3. Polymorphism

  • Method overriding is used in toFileString() and getRole() across derived classes.
  • Polymorphic user handling allows uniform authentication processing and dynamic dashboard routing based on runtime type inspection (instanceof).

4. Data Persistence (File I/O)

  • Custom file persistence engine handled by amc.data.FileHandler.
  • Stores data cleanly in delimited text files inside the data/ directory (customers.txt, doctors.txt, managers.txt, staffs.txt, appointments.txt, payments.txt, feedbacks.txt, reports.txt, receipts.txt).
  • Automatic initialization creates directories, files, and a default system administrator (admin / admin).

🎨 UI/UX & Design System

  • Modern Swing Styling (UITheme.java): Configured with custom anti-aliasing, rounded borders, soft-colored cards, styled scrollable tables, custom button states (hover/pressed), and responsive layouts.
  • Custom Components:
    • DatePicker: Interactive month/year calendar widget for seamless date picking.
    • Password visibility toggle (👁) icon button.
    • Custom validation highlighting (BORDER_FIELD_ERROR red outline) and friendly dialog alerts for field errors (e.g., email syntax, 10-digit phone number validation, age boundaries).

📂 Project Structure

Team9-Assignment/
├── src/
│   ├── logo.png                       # AMC Application Logo
│   └── amc/
│       ├── Main.java                  # Application Main Entry Point
│       ├── data/
│       │   └── FileHandler.java       # Text File Data Access Layer
│       ├── models/
│       │   ├── User.java              # Abstract Base User Class
│       │   ├── Customer.java          # Customer Model
│       │   ├── Doctor.java            # Doctor Model
│       │   ├── Manager.java           # Manager Model
│       │   ├── Staff.java             # Staff Model
│       │   ├── Appointment.java       # Appointment Model
│       │   ├── Payment.java           # Payment Record Model
│       │   └── Feedback.java          # Feedback Model
│       └── ui/
│           ├── UITheme.java           # Color Palette, Fonts, Custom UI Components
│           ├── LoginFrame.java        # Multi-Role Authentication Interface
│           ├── ManagerDashboard.java  # Manager Dashboard UI
│           ├── StaffDashboard.java    # Staff Dashboard UI
│           ├── DoctorDashboard.java   # Doctor Dashboard UI
│           ├── CustomerDashboard.java # Customer Dashboard UI
│           ├── DatePicker.java        # Calendar Date Picker Dialog
│           ├── RegistrationDialog.java# User Registration Modal
│           ├── UpdateDialog.java      # User Profile Update Modal
│           └── UpdateAppointmentDialog.java # Appointment Edit Modal
├── data/                              # Flat Text File Storage
│   ├── appointments.txt
│   ├── customers.txt
│   ├── doctors.txt
│   ├── feedbacks.txt
│   ├── managers.txt
│   ├── payments.txt
│   ├── receipts.txt
│   ├── reports.txt
│   └── staffs.txt
└── README.md                          # Project Documentation

🛠️ Requirements & How to Run

Requirements

  • Java Development Kit (JDK): Version 8 or higher (Java 11+ recommended).
  • IDE / Environment: Eclipse, IntelliJ IDEA, NetBeans, or Command Line (Terminal/PowerShell).

Steps to Run

  1. Clone or Extract Project Source Code.
  2. Open Project in IDE:
    • Set src folder as the Source Root.
  3. Compile and Run via Command Line:
    # Navigate to project directory
    cd Team9-Assignment
    
    # Compile Java files into bin directory
    javac -d bin -sourcepath src src/amc/Main.java
    
    # Run application
    java -cp bin amc.Main

🔑 Default Credentials

On initial startup, FileHandler auto-initializes default system storage and creates the primary administrator account:

Role Username Password
Manager admin admin

(Additional Staff, Doctors, and Customers can be registered through Manager and Staff dashboards).


📜 License & Credits

Developed for 3rd Semester Object-Oriented Programming in Java (OOPJ) coursework at Asia Pacific University (APU) / LBEF Campus by Team 9.

About

We have made a APU Medical Center (AMC). Here are 4 main role to play Manager, Staff, Doctor and Customer.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages