Package Databases

Class AppointmentOutcomeDatabase

java.lang.Object
Common.Database
Databases.AppointmentOutcomeDatabase

public class AppointmentOutcomeDatabase extends Database
The AppointmentOutcomeDatabase class manages a collection of AppointmentOutcome objects, providing functionalities to extract, search, remove, and create appointment outcomes from a CSV file.
  • Constructor Details

    • AppointmentOutcomeDatabase

      public AppointmentOutcomeDatabase()
      Constructs an AppointmentOutcomeDatabase with a default CSV path for storing appointment outcome records.
    • AppointmentOutcomeDatabase

      public AppointmentOutcomeDatabase(String csvpath)
      Constructs an AppointmentOutcomeDatabase with a specified CSV path for storing appointment outcome records.
      Parameters:
      csvpath - the path to the CSV file containing appointment outcomes
  • Method Details

    • searchItem

      public DatabaseItems searchItem(String id)
      Searches for an appointment outcome by its unique identifier.
      Specified by:
      searchItem in class Database
      Parameters:
      id - the unique identifier of the appointment outcome to search for
      Returns:
      the AppointmentOutcome object if found; otherwise, returns null
    • removeItem

      public boolean removeItem(String appointment_id)
      Removes an appointment outcome from the database using its unique identifier.
      Specified by:
      removeItem in class Database
      Parameters:
      appointment_id - the unique identifier of the appointment outcome to be removed
      Returns:
      true if the item was successfully removed; false otherwise
    • createDatabaseItem

      public DatabaseItems createDatabaseItem(String[] values)
      Creates a new AppointmentOutcome object from an array of values.
      Specified by:
      createDatabaseItem in class Database
      Parameters:
      values - an array of strings containing appointment details in order: appointment_id, patient_id, doctor_id, date, type_of_service, medication, consultation_notes, status
      Returns:
      a new instance of AppointmentOutcome
    • printItems

      public void printItems()
      Prints all items in the appointment outcome database with a specified title.
      Specified by:
      printItems in class Database