PROJECT: MediBook


1 Overview and Introduction

1.1 Portfolio Purpose

This portfolio will be submitted to CS2101 for grading and is used to document my role and contribution to MediBook – an application developed under NUS module CS2113T by Team F10-2 of AY1819S1.

1.2 Project Name and Description

MediBook seeks to improve healthcare administration for a better healthcare experience. This is achieved by digitalising healthcare records.

In this project, I was task with incorporating an appointment feature that allows appointments to be recorded in MediBook. This feature is also known as MediCal.

MediBook is built by Team F10-2 of CS2113T of AY1819S1 and consists of four members. Our details can be found in README.

This project is built on an existing Address Book sample application (Level 3). MediBook optimises and enhances Address Book Level 3 to suit the needs of healthcare professionals with healthcare administrative matters.

2 Summary of contributions

  • Major enhancement: added the ability to record and edit appointments

    • What it does:

      • Allows the users to select a person in MediBook to edit the person’s appointments

      • Adds and delete several appointments

      • Shows the list of appointments the person has

    • Justification:

      • Recording and viewing patient appointments is an important aspect of healthcare administration. With this feature, users can make and view multiple appointments effectively

    • Highlights:

      • This enhancement enters its own edit-appointment mode after the user has select the person to edit. Hence, it was challenging as there is a need to manage the edit-appointment mode, in addition to making modification to existing person in the list, which is not supported in the original AddressBook (Level 3) we started from.

  • Minor enhancement:

    • Help message for edit-appointment mode

    • Made command words case-insensitive #139

  • Code contributed: Reposense

  • Other contributions:

    • Project management:

      • Managed Issue Tracker on GitHub, generated issues for own features and set milestones.

    • Enhancements to existing features:

      • Reformatted the display message for list command #139

    • Documentation:

      • Structured User Guide: #144

      • Did cosmetic tweaks to existing contents of the User Guide: #41

      • User Guide and Developer Guide documentation for my own features: #168 #147 #41

    • Community:

      • PRs reviewed: #169, #157, #151, #137

      • Reported bugs and suggestions for other teams in the class (examples: 1, 2, 3)

    • Tools:

      • Integrated a new Github plugin (Codacy) to the team repo

3 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.

4.10 Selecting a person to edit appointment: edit-appointment

Selects the person to edit appointment.
Format: 'edit-appointment INDEX'

Access to the appointment of the person at the specified INDEX. The index refers to the index number shown in the most recent listing.

Similar to viewall, view and delete, it requires list or find command to be called at least once in the session for an index reference to edit-appointment.

Once access, edits can be done repeated to the selected person’s appoinments until user exits the edit-appointment session as detailed in 4.9.5.

Examples: * list
edit-appointment 2
Access to the 2nd person in MediBook.

  • find Betsy
    edit-appointment 1
    Access to the 1st person in the results of the find command.

4.10.1 Viewing help : help

Shows the help screen for the edit-appointment session.
Format: help

Help is also shown if you enter an incorrect command e.g. abcd

4.10.2 Listing the appointment of the selected person: list

Shows a list of all appointment of the selected person in MediBook.
Format: list

4.10.3 Adding appointment to the selected person: add

Adds appointments to the selected person in MediBook.
Format: add DD-MM-YYYY-HH:MM…​

…​ indicated that there can have multiple appointment.

Appointments that are already reorded (and duplicates) would not be added.

Examples:

  • add 01-01-2019-13:00

  • add 01-01-2019-13:00 02-01-2019-14:00 03-01-2019-15:00

4.10.4 Deleting appointment of the selected person: delete

Deletes appointments from the selected person in MediBook.
Format: delete DD-MM-YYY-HH:MM…​

…​ indicated that there can have multiple appointment.

Examples:

  • delete 01-01-2019-13:00

  • delete 01-01-2019-13:00 02-01-2019-14:00 03-01-2019-15:00

4.10.5 Exiting the edit-appointment session: done

Exits the edit-appointment session.
Format: done

4 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.

4.3 Record Appointments

Record Appointment feature allows appointments to be stored in MediBook.

When adding a person, MediBook recognises an appointment with the tag 'd/' and in the form DD-MM-YYY-HH:MM, where the year should be in the 20th or 21th Century and time in 24-hour clock format.

DD-MM-YYY-HH:MM indicates the day and the starting time of the appointment.

Edit-Appointment Mode: Users can enter edit-appointment mode by entering the edit-appointment INDEX where index refers to the person with that index number shown in the most recent listing. Once in edit-appointment mode, users can add multiple appointments, delete multiple appointments and list the appointments of the chosen person before exiting edit-appointment mode using done. A help summary of the edit-appointment mode is also available.

The following is a summary of the commands involved in edit-appointment:

  • edit-appointment INDEX

  • add DD-MM-YYYY-HH:MM…​

  • delete DD-MM-YYYY-HH:MM…​

  • list

  • help

  • done

4.3.1 Current Implementation

Every appointment is an object of the Schedule class. Each Person has a hashset of Schedule objects. This allows each Person to have zero to multiple Schedules. Furthermore, due to the property of hashset, there would be no duplicated appointments.

Appointments are verified though the strict Schedule class which sets a regular expression (regex) that only accept valid appointments in the DD-MM-YYYY-HH:MM format. Non-existent dates, such as 30-02-2019-13:00 or 28-28-2019-15:00, and time, like 01-01-2019-25:80, would not be accepted.

Entering Edit-Appointment Mode: (And Exiting)

As shown in the sequence diagram below, when the edit-appointment command is instantiated, the index input is used to identify the Person in the list to edit appointment.

Afterwards, when it execute(), a static boolean in the Command class is set to true via SetEditingAppointmentState() to indicate that the user is now in edit-appointment mode.

EditAppointmentSeqenceDiagram

Subsequently, when commands are made, the Parser check them against the edit-appointment mode commands and execute accordingly.

This only stops when the user exits edit-appointment mode using the command done. ExitAppointmentCommand would set the static boolean in Command class back to false using SetEditingAppoinmentState(false).

Add Appoinments in Edit-Appointment Mode:

When AddAppoinment is instantiated, it converts and stores the hashset of Schedule appointments.

As shown in the sequence diagram below, in execute(), a Person copy of the original index person is made and updated with the latest schedule. editPerson() is used to replace the Person in the UniquePersonList of people in the AddressBook. Delete is also done in the similar manner.

AddAppointmentSequenceDiagram

4.3.2 Reason for Implementation

Every time a command that takes effect on a single Person is called, AddressBook level 3 requires users to indicated the index of the Person.

Hence, I wanted to enter a mode for edit-appointment as it breaks down a very long input into multiple shorter ones. This makes easier and more intuitive for users, especially as patients would have multiple appointments made in one go or seek to make changes to their appointments.

4.3.3 Alternative Consideration

In future versions, the following details can be implemented for a better appointment feature for MediBook.

  • Use Calendar class in java.util. This allows precise date and time to be recorded, easier comparision between appointments and current date and time can be obtained. This class also provides additional fields and methods for implementing a concrete calendar system outside the package.

  • Organise the appointments in chronological order. Possible methods of achieving are to use a TreeSet instead of Hashset and to use the Calender Class mentioned.

  • A command feature to list all the appointments in a chronological order following the reference date.

  • A command feature for doctor to view their respective patients' appointments for the day or for specific days.