PROJECT: Giatros by CS2103 AY1819S2 W13-4


Overview

Giatros is a desktop patient record application used to keep track of patient data in a hospital. Written in Java, the user interacts with it using a CLI, and it has a GUI created with JavaFX. One of the main features of Giatros is its ability to track various appointments for each patient, something that medical professionals often overlook. This may lead to tragedy, such as deathdue to drug allergy, as seen in this news article. Moreover, hospitals have a large number of patients, thereby staff can be easily overwhelmed, thus requiring a systematic way to make and manage appointments for instance. This software is built upon an existing application: Address Book - Level 4 by MIT SE-EDU.

Summary of contributions

  • Major enhancement: Added the ability to add/remove appointments

    • What it does: Allows the user to add appointments to an existing patient or remove appointments from an existing patient.

    • Justification: This feature improves the product significantly because the current edit command will overwrite the existing appointments whenever new appointments are added. The addapt and remapt commands allow user to add and remove appointments from the existing list associated to a patient.

    • Highlights: This enhancement extends the ability of the existing add and edit commands, which allows the user to create a patient with appointments.

  • Minor enhancements:

    • Parse appointment string and store into Date objects Date Strings(not fully implemented)

    • Fixed typos, logic errors and test cases in Allergy feature.

  • Code contributed: [Project Code Dashboard][Functional code addapt][Functional code remapt][Test code addapt][Test code remapt]

  • Other contributions:

    • Project management:

      • Created users stories and issues. Assigned them to relevant members.

    • Documentation:

      • Added to and updated the User Guide for appointments (addapt, remapt).

      • Added to and update the Developer Guide for appointments (addapt, remapt).

      • Redrawing existing diagrams for storage, logic, etc in Developer Guide.

      • Updated the ContactUs.adoc

      • Updated the AboutUs.adoc

    • Enhancements to existing features:

      • Account for appointments in add and edit commands.

    • Community:

      • Reviewed and approved PRs of other team mates

Contributions to the User Guide

Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users.

Adding appointment to a patient: addapt

Adds one or more appointments to an existing patient in Giatros.
Format: addapt INDEX apt/APPOINTMENT [apt/APPOINTMENT]…​

Appointments should be in one of the following forms, 'yyyy-MM-dd HH:mm:ss' , 'yyyy-MM-dd HH:mm', 'yyyy-MM-dd HH', and should be a valid date-time. Entering '2016-01-01' (no time value), '2019-02-29 10:10' (leap year, day does not exist), '2019-02-29 25:10' (impossible time), etc is not acceptable.

  • Adds one or more appointments to the patient at the specified INDEX. The index refers to the index number shown in the displayed patient list. The index must be a positive integer 1, 2, 3, …​

  • Multiple appointments can be added at a time by separating the distinct appointments with distinct apt/ tags, e.g. apt/2019-01-01 15:15 apt/2019-01-01 15.

  • Appointments already associated with the patient will be ignored. For example, if the 1st patient has an appointment at 2019-01-01 15:15, addapt 1 apt/2019-01-01 15:15 will not modify the appointment list while addapt 1 apt/2019-01-01 15:15 apt/2019-01-01 15 will just add 2019-01-01 15 to the appointment list.

Examples:

  • addapt 1 apt/2019-01-01 15
    Adds the appointment 2019-01-01 15 to the 1st patient in the list.

  • addapt 3 apt/2019-01-01 15:15 apt/2019-02-02 15:15:30
    Adds two appointments, 2019-01-01 15:15 and 2019-02-02 15:15:30 to the 3rd patient in the list.

Removing appointment from a patient: remapt

Appointments should be in one of the following forms, 'yyyy-MM-dd HH:mm:ss' , 'yyyy-MM-dd HH:mm', 'yyyy-MM-dd HH', and should be a valid date-time. Entering '2016-01-01' (no time value), '2019-02-29 10:10' (leap year, day does not exist), '2019-02-29 25:10' (impossible time), etc is not acceptable.

Removes one or more appointments to an existing patient in Giatros.
Format: remapt INDEX apt/APPOINTMENT [apt/APPOINTMENT]…​

  • Removes one or more appointments to the patient at the specified INDEX. The index refers to the index number shown in the displayed patient list. The index must be a positive integer 1, 2, 3, …​

  • Multiple appointments can be removed at a time by separating the distinct appointments with distinct apt/ tags, e.g. apt/2019-01-01 15:15 apt/2019-01-01 15.

  • Appointments not already associated with the patient will be ignored. For example, if the 1st patient has an appointment at 2019-01-01 15:15, remapt 1 apt/2019-01-01 15 will not modify the appointment list while remapt 1 apt/2019-01-01 15:15 apt/2019-01-01 15 will just remove 2019-01-01 15:15 from the appointment list.

Examples:

  • remapt 1 apt/2019-01-01 15
    Removes the appointment 2019-01-01 15 from the 1st patient in the list.

  • remapt 3 apt/2019-01-01 15:15 apt/2019-02-02 15:15:30
    Removes two appointments, 2019-01-01 15:15 and 2019-02-02 15:15:30 from the 3rd patient in the list.

Contributions to the Developer Guide

Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project.

Add/Remove Appointment Feature

Current Implementation

The add and remove appointment feature is implemented to extend the functionality of Appointment tags. Currently, the edit command will overwrite the existing Appointment tags if user attempts to edit the existing Appointment. With the addapt and remapt command, it is now possible to add or remove a single or multiple appointments associated with a patient.

The functionality of the classes related to addapt and remapt are listed below:

  • AddaptCommandParser and RemaptCommandParser — Reads the user input and create AddaptCommand and RemaptCommand object respectively.

  • AddaptCommand and RemaptCommand — When executed, the command will result in the addition or removal of a single or multiple appointments.

  • Appointment — An object that models appointment. It contains a String describing the name of the appointment.

A patient’s Appointment is stored in a Java HashSet, which stores only unique Appointment object. This feature makes use of this behaviour of a HashSet to allow user to add or remove appointments from the patient.

  • addapt command uses the .addapt() method, which takes in a set of Appointment objects and add them in if they are not inside the set already.

  • remapt command uses the .remapt() method, which takes in a set of Appointment objects and remove them if they are actually inside in the set.

Given below is an example usage scenario and how the add appointment mechanism behaves at each step.

Step 1. The user launches the application and logs into the STAFF account.

Step 2. Assuming that the patient list is not empty, the user executes addapt 1 apt/2019-01-01 15:30 to add a new appointment at 2019-01-01 15:30 to the first patient in the list.

Step 3. This command in string format will be passed to the AddaptCommandParser, which will check if the command format is valid.

Step 4. Since this command has a valid format, the system will create a new AddaptCommand object, which will be executed.

Step 5. The system will locate the first patient in the patient list, and adds the non-existing appointment to the unique list of patient appointment.

The process is described in sequence diagram shown below: The following sequence diagram shows how the add appointment operation works:

AddAppointmentActivityDiagram

Design Consideration

Aspect: CRUD appointments
  • Alternative 1 (current choice): The appointment began as a refactoring of the tags implementation, with additional features added on later that allowed for easier modification of appointments. So currently each appointment is associated with a patient.

    • Pros: A doable task within the time limit, allows displaying of clear and multiple appointments

    • Cons: We ideally want to store appointments as dates, to allow us to sort them; Connect doctor objects to the appointments, etc.

  • Alternative 2 : Storing an appointment list, so that it’ll only require one appointment object per unique appointment.

    • Pros: An appointment object is not tied down to a Patient, since there could be multiple stakeholders in v2.0 implementation. I.e nurses, pharmacists, family of patients.

    • Cons: But compared to tags, appointments would be much more unique and tied to a patient. I.e many patients can have a coconut allergy, but how many patients can have an appointment with Dr.Oz at 10 AM on Christmas?

Aspect: Data structure to store appointment
  • Alternative 1 (current choice): Use a hash set to store appointments

    • Pros: Guarantees unique elements, and constant run time.

    • Cons: The hash function and other factors some what determine the order in which in the appointments are stored. Currently it’s stored as a string, so the order is to some extent random with hiccups here and there.

  • Alternative 2 : Use a sorted set to store appointments. Appointments as date objects.

    • Pros: Guarantees unique elements, and we can have the elements stored in a sorted fashion.

    • Cons: Not too many. It’s doable, but I didn’t have time.