Skip to content

Appointments Module Documentation

Jack Turner edited this page Apr 10, 2025 · 1 revision

Appointments Module Documentation

This file contains the implementation of the Appointments Module for the Veterinary Management System (VMS). It handles scheduling, modifying, canceling, and viewing appointments, using a simple text file (appointments.txt) to persist data between sessions.

Structure

Data Structure: Uses a struct Appointment (defined in appointments.hpp) to represent each appointment. Storage: All appointment data is stored in a flat file (appointments.txt) and loaded into a vector for manipulation.

Functions

void appointmentMenu() Displays a menu allowing users to manage appointments. Provides options to schedule, modify, cancel, and view appointments.

void loadAppointmentsFromFile() Loads all appointments from appointments.txt into memory (appointments vector).

void saveAppointmentsToFile() Saves all current appointments from memory back to appointments.txt.

void scheduleAppointment() Prompts the user for details and creates a new appointment with a unique ID. Appends the new appointment to the list and updates the file.

void modifyAppointment() Allows updating of an existing appointment’s: Date & Time, Details, Status (e.g., scheduled, completed, cancelled), Searches by appointment ID.

void removeAppointment() Deletes an appointment from the list by ID. Updates the storage file accordingly.

void displayAppointments() Displays all scheduled appointments in a neatly formatted table.

File Format

Each appointment is stored in appointments.txt as a comma-separated line: <id>,<dateTime>,<details>,<petID>,<ownerID>,<status>

Example: 1,2025-04-20 10:00,Annual Checkup,101,201,scheduled

Clone this wiki locally