Developer Guide

Content Page

  1. Introduction
  2. How to use this guide
  3. Getting Started
  4. Design
  5. Implementation

Appendix A: Product Scope

Appendix B: User Stories

Appendix C: Non Functional Requirements

Appendix D: Glossary

Appendix E: Instructions for Manual Testing


1. Introduction

1.1 What is HealthVault?

In light of the recent COVID-19 pandemic. The weakness of modern healthcare systems has surfaced. Many of which are unsatisfactory in coping with the current needs. HealthVault was thus created to improve the efficiency of hospital and healthcare information management.
HealthVault is a desktop application made for nurses as their one-stop application for recording and accessing critical patient or staff information. It is optimized for the Command Line Interface, where an experienced typist will be able to make full use of the informative and minimalistic GUI to achieve significant gains in efficiency

1.2 About the Developer Guide

The HealthVault Developer guide is made specifically for those who are interested in the specifics of how HealthVault is implemented. Such personnel may include: students, technical support staff, web developers, healthcare professionals.

This Developer guide seeks to inform and instruct readers on the architecture and specific implementation of the various functions within HealthVault. So that if they wish to make any fixes or edits to improve on the code for their own usage, they will be well-equipped with both the knowledge and expertise to do so.

The Developer Guide hopes to impart to you the following:

  1. Properly set up for HealthVault
  2. HealthVault’s system architecture
  3. The implementation method for HealthVault’s various functions and their considerations
  4. Instructions for manual testing of the application

We hope you will have a fruitful time learning about HealthVault.


2. How to use the guide

2.1 Technical Terms

         Command Line Interface - Accessing the functionalities of a computer program in the form of lines of text.

         User Input - Any information or data sent to a computer by the user using the application.

2.2 Symbols and Icons

         <> - Angles quotation marks for optional user inputs.

         [] - Square brackets for compulsory user inputs.

         :information_source: This icon denotes an important piece of information to take note of.

         :exclamation: Warning sign to inform user against doing certain actions

         Invalid input is shown with:

- Invalid input 1
- Invalid input 2
- Invalid input 3


3. Getting Started

:exclamation: Caution: Follow the steps in the following guide precisely. Things will not work out if you deviate in some steps.

First fork this repo, and clone the fork into your computer.

Setting up the project in your computer

  1. Configuring the JDK to ensure Intellij is configured to use JDK 11.
  2. Import the project as a Gradle project.
  3. Run the seedu.duke.HealthVault and try a few commands as stated in the User Guide.
  4. Run the tests to ensure they all pass.

Before writing code

  1. If you are using IDEA, configure the code style to set up IDEA’s coding style to match ours.
  2. When you are ready to start coding, we recommend that you get some sense of the overall design by reading about HealthVault’s architecture.


4. Design

4.1 Architecture

        

Overview Architecture:

Our application utilises many layers of abstraction which allows each individual component to be self-contained yet able to work with other components. Each component has been abstracted and grouped together based on its function and purpose in the system.

The above diagram shows how each component interacts with the other components. The directed arrows represent the direction in which functions of each component is called and used. For example, the Instance Component utilises the Storage Component.


Brief Description of Components:

UI Component: Controls all the User Interface. All input and output is handled by the UI component.

Logic Component:

         Instance Component: Represents all Menu Instances.

         Parser Component: Parses user input to obtain control flow decisions.

         Error Checker Component: Contains functions to check validity of user input.

         Commands Component: Command Class Objects which executes specified actions.

Exceptions Component: All possible Exceptions identified.

Model Component: Consist of the base objects and its collection.

Storage Component: Manages all file I/O.


4.2 UI component

        

API : UI.java

The UI of this program can be found under the package named UI. It consists of UI, DoctorAppointmentUI, InventoryUI, NurseScheduleUI, PatientUI and StaffUI. The main UI class as shown in the diagram acts as the parent class with the other classes being its subclasses. Having a main UI class allows the program to have a common pool of methods so that each method is reusable in each functionality. Each individual function UI extends the main UI and consists of the methods that deals with users unique to their functionality. The UI component interacts with the Logic package and Instance package the most.

The UI component,

         Executes user commands using the ‘Logic’ component.

         Listens to changes to Instance data so that the UI can be updated with the modified data.

         Is responsible for handling all input and output of the program.


4.3 Logic Component

The Logic component is responsible for the following tasks:

To accomplish the above, the Logic component, follows the following sequence of steps:

         Interpreting user input:

                 The Instance component runs the main super loop to accept user input. It creates a Parser to interpret user inputs.

         Checking User Input:

                 The Parser creates an ErrorChecker class and uses it to check the user input for any erroneous and unacceptable inputs.

         Creating Command:

                 After checking the input, the Parser component then creates the Command that corresponds to the user input.

         Executing Command:

                 With the interpreted Command from the Parser, the Instance component then executes the Command.

The following class diagram illustrates the interactions between various logic components

        

The following class diagram illustrates the group of Commands under the doctorappointment package. Due to the similar Commands in each of the Command packages, the information in the doctorappointment package should be representative of the other Command packages.

        

:information_source: Similar classes are represented by abbreviations i.e. ABCCommand. The actual class names are written in the notes beside the classes.

  1. ABCInstance represents the different Instance classes.
  2. PQRParser represents the different Parser classes.
  3. XYZChecker represents the different ErrorChecker classes.
  4. The “XXX”Command in each package under the Command package represent the different commands relating to each individual feature.


4.4 Model component

        

The Model component consists of classes that represents the collection of objects that a nurse has to interact with.

The Model, consists of 5 different types of arraylists.


4.5 Storage component

        

The Storage component consists of classes that individually reads data from, and writes data to, 5 different .txt files.

The Storage, consists of 5 different types of classes:


5. Implementation

In this section, we will introduce the implementation of the different functions within each feature.

5.1 Staff

5.1.1 Staff Menu

Similar to the Start Menu, the Staff Menu will repeatedly request user input until the return command is given.

Whenever a user input is given to the Staff Menu, the following steps will occur.

Launching Staff Menu

  1. ToStaffInstance.execute() will create and call StaffInstance.run()
  2. StaffInstance.run() will start by loading/creating the Staff data .txt file for Staff database records. It will check for any signs of corrupted file when loading. An Exception will be thrown if any corruption occurs.
  3. StaffInstance.run() will then repeatedly call commandHandler().

Getting User Input

  1. StaffInstance.run() will repeatedly request for user input and call StaffParser.commandHandler().
  2. commandHandler() will call the smartCommandRecognition() to assess the given user input and determine which command is most similar to the input
  3. Based on the recognised command by the system, the relevant commands will be carried out.


5.1.2 Staff Add

Implementation:

The function Add takes in 4 compulsory fields (Staff ID, Name, Age, Specialisation) to create the Staff Object and adds it to an collection of Staff Objects. Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. A StaffAddCommand object is created. StaffAddCommand object will be executed to create the Staff Object which will be added to the collection of Staff Objects.

Invalid Input includes:

- Invalid Staff ID format
- Duplicated Staff ID
- Age that < 18 or > 150
- Blank input (i.e Empty inputs)
- Illegal Characters

Format add/[Staff ID]/[name]/[age]/[specialisation]

Check validity of the data input

  1. If the command recognised is the add command, commandHandler() calls staffChecker.checkValidDataForAdd() to ensure data entered is valid
  2. checkValidDataForAdd() will call the following function in sequence:

    • checkStaffID()
    • checkDuplicateStaffID()
    • checkStaffAge()
    • checkBlankInput()
    • invalidCharactersStaffChecker()

Creating StaffAddCommand object

  1. If the input data is valid, a StaffAddCommand object is created. Else a relevant error is thrown.
  2. The StaffAddCommand object is returned to StaffInstance.run()

Creating Staff Object with User Input

  1. StaffInstance then executes the StaffAddCommand object to begin the process of creating the Staff object

  2. StaffAdd.execute() will call the function StaffList.add()

  3. StaffList.add() will instantiate a new Staff object and add it to the ArrayList StaffList, which contains all the Staff Objects.

Saving Staff Objects into .txt file

  1. StaffList.add() then calls StaffStorage.writeToFile() which starts the process of writing the details of all existing Staff Objects, within the StaffList into a specified .txt file.
  2. StaffStorage.writeToFile() then calls createFile() which ensures that the specified .txt file exists.
  3. Data is written and saved.
  4. Control is then returned to StaffInstance.

Design Considerations

Deciding the main data structure, ArrayList or Dictionary:

Option 1 (Final choice): Using an ArrayList

Option 2 : Using a Dictionary


5.1.3 Staff Delete

Implementation:

The function Delete takes in 1 compulsory field (Staff ID) to identify and delete the Staff Object from the collection of Staff Objects. Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. After validation, a StaffDeleteCommand object is created. StaffDeleteCommand object will be executed to iterate through the collection of Staff Objects. If Staff Object exists, it will be removed. Else an error message will be displayed.

Invalid Input includes:

- Invalid Staff ID format
- Blank input (i.e Empty inputs)
- Illegal Characters

Format delete/Staff ID

Check validity of the data input

  1. If the command recognised is the delete command, commandHandler() calls staffChecker.checkDeleteCommand() to ensure that there are valid and sufficient inputs

Creating StaffDelete command

  1. If the input data is valid, a StaffDeleteCommand object is created
  2. The StaffDeleteCommand object is returned to StaffInstance.run()

Deleting Staff Object using User Input

  1. StaffInstance then executes the StaffDeleteCommand object to begin the process of deleting the referenced Staff object
  2. StaffDelete.execute() will call the function StaffList.delete()
  3. StaffList.delete() will iterate through the objects in ArrayList StaffList. The Staff Object referenced by the input given by the user will be deleted.

Saving changed Staff Objects into .txt file

  1. StaffList.delete() then calls StaffStorage.writeToFile() which starts the process of writing the changed details of Staff Objects, within the StaffList into a specified .txt file.

  2. StaffStorage.writeToFile() then calls createFile() which ensures that the specified .txt file exists.
  3. Data is written and saved.
  4. Control is then returned to StaffInstance.

Design Considerations

Deciding whether to use an iterator to iterate through the ArrayList.

Option 1 (Final choice): Not using an iterator

Option 2 : Using an iterator


5.1.4 Staff List

Implementation:

The function list takes in 1 optional field (nurses/doctors) to identify and list the category of Staff Objects required from the collection of Staff Objects. Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. After validation, a StaffListCommand object is created. StaffListCommand object will be executed to iterate through the collection of Staff Objects. Staff Objects will then be displayed based on the user given input.

Invalid Input includes:

- Any input apart from Blank Input (i.e Empty input) OR "doctors" OR "nurses"

Format list/<doctors/nurses>

Check validity of the data input

  1. If the command recognised is the list command, commandHandler() calls staffChecker.checkListCommand() to check and verify the validity of inputs accompanied by the list command, if any.

Creating StaffList command

  1. If the input data is valid, a StaffListCommand object is created
  2. The StaffListCommand object is returned to StaffInstance.run()

Viewing Staff Objects

  1. StaffInstance then executes the StaffListCommand object to begin the process of displaying all Staff objects.
  2. StaffList.execute() will call the function StaffList.list()
  3. StaffList.list() will iterate through the objects in ArrayList StaffList.
  4. Depending on the input given by the user, the relevant Staff Objects will be displayed.
  5. Control is then returned to StaffInstance.

Design Considerations

Deciding whether to have additional capabilities for the list function:

Option 1 (Final choice): Function to list either nurses or doctors.

Option 2 : Only have a general list function to see all staff information.


5.1.5 Staff Find

Implementation:

The function Add takes in 1 compulsory field (keyword) to find the relevant Staff Objects within the collection of Staff Objects. Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. The given input is used to match with every single field of the Staff Object. If there is a match, the Staff Object will be displayed. Else, an error message will be displayed.

Invalid Input includes:

- Blank input (i.e Empty inputs)

Format find/[keyword]

Check validity of the data input

  1. If the command recognised is the find command, commandHandler() calls MainChecker.checkNumInput(). MainChecker.checkNumInput() does a simple check to ensure there is an accompanying input given by the user together with the find command.

Creating StaffFind command

  1. If the input data exist, a StaffFindCommand object is created
  2. The StaffFindCommand object is returned to StaffInstance.run()

Finding relevant Staff Objects

  1. StaffInstance then executes the StaffFindCommand object to begin the process of finding and displaying relevant Staff objects.
  2. StaffFind.execute() will call the function StaffList.find()
  3. StaffList.find() will iterate through the objects in ArrayList StaffList.
  4. StaffList.find() will utilise a search function in StaffList to find any Staff Objects that matches the given keyword by the user.
  5. The relevant Staff Objects are then displayed.
  6. Control is then returned to StaffInstance.

Design Considerations

Deciding whether find function should be case-sensitive:

Option 1 (Final choice): Case-insensitive.

Option 2 : Case sensitive.


5.2 Patient

5.2.1 Patient Menu

The Patient Menu will repeatedly request user input until the return command is given.

Whenever a user input is given to the Patient Menu, the following steps will occur.

Launching Patient Menu

  1. ToPatientInstance.execute() will create and call PatientInstance.run()
  2. PatientInstance.run() will start by loading/creating the Patient data .txt file for Patient database records. It will check for any signs of corrupted file when loading and exception will be thrown if any corruption is detected.
  3. PatientInstance.run() will then enter its running for loop and repeatedly take in user inputs for data processing.

Getting User Input

  1. PatientInstance.run() will repeatedly request for user input and call PatientParser.patientParse().
  2. patientParse() will call the smartCommandRecognition() to assess the given user input and determine which command is most similar to the input.
  3. The most relevant command is then returned to the parser, and the parser then scans the input thoroughly based on the command returned. Relevant errors in the input are detected and the appropriate exceptions thrown.
  4. Only after scanning the input for errors, will the proper command be returned to PatientInstance where it will then be executed.
  5. After getting an input, and parsing it into string tokens, a new instance of PatientChecker class checker is instantiated to perform error checking.


5.2.2 Patient Add

Implementation:

The function Add takes in 6 compulsory fields (Patient ID, Name, Age, Gender, Illness and Medication Required) to create the Patient Object and adds it to a list of Patient Objects. Data input is first checked to ensure validity. Any invalid input detected will result in an exception thrown and command aborted. If there are no exceptions thrown, a PatientAddCommand object is created. The PatientAddCommand object will be executed to create the Patient Object which will be added to the list of Patient Objects.

Invalid Input includes:

- Invalid Patient ID format
- Duplicated Patient ID
- Age that < 0 or > 150
- Invalid Gender Input
- Blank input (i.e Empty inputs)
- Inputs that only consist of spaces
- Illegal Characters

Format add/[Patient ID]/[name]/[age]/[gender]/[illness]/[medication required]

Check validity of the data input

  1. If the command recognised is the add command, patientParse() calls checker.checkAdd() to ensure data entered is valid.
  2. checkAdd() will call the following methods in sequence:

    • emptySpaceCheck();
    • checkLength();
    • checkID();
    • checkAge();
    • illegalCharacterChecker();
    • checkGender();

Creating PatientAddCommand

  1. If the input data is valid, a PatientAddCommand object is created. Else a relevant error is thrown.
  2. The PatientAddCommand object is returned to PatientInstance.run()

Creating Patient Object with User Input

  1. PatientInstance then executes the PatientAddCommand object to begin the process of creating the Patient object

  2. PatientAdd.execute() will call the function in PatientList.add()

  3. PatientList.add() will instantiate a new Patient object and add it to the ArrayList PatientList, which contains all the Patient Objects.

Saving Patient Objects into .txt file

  1. PatientInstance then calls PatientStorage.storePatients() which starts the process of writing the details of all existing Patient Objects, within the PatientList into a specified .txt file.
  2. PatientStorage.storePatients() then calls fileInit() which ensures that the specified .txt file exists.
  3. Data is written and saved.
  4. Control is then returned to PatientInstance.

Design Considerations

Using an ArrayList over a List as the main data structure:

Option 1 (Final choice): Using an ArrayList

Option 2 : Using a List


5.2.3 Patient Delete

Implementation:

The function Delete takes in 1 compulsory field (Patient ID) to identify and delete the Patient Object from the list of Patient Objects. Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. After validation, a PatientDeleteCommand object is created. The PatientDeleteCommand object will be executed to iterate through the list of Patient Objects. If Patient Object exists, it will be removed. Else an error message will be displayed.

Invalid Input includes:

- Invalid Patient ID format
- Blank input (i.e Empty inputs)
- Inputs that only consist of spaces

Format delete/[Patient ID]

Check validity of the data input

  1. If the command recognised is the delete command, patientParse() calls checker.checkLength() and checker.checkID() to ensure data entered is valid.

Creating PatientDeleteCommand

  1. If the input data is valid, a PatientDeleteCommand object is created
  2. The PatientDeleteCommand object is returned to PatientInstance.run()

Deleting Patient Object using User Input

  1. PatientInstance then executes the PatientDeleteCommand object to begin the process of deleting the referenced Patient object
  2. PatientDelete.execute() will call the function PatientList.deletePatient()
  3. PatientList.deletePatient() will iterate through the objects in ArrayList PatientList. The Patient Object referenced by the input given by the user will be deleted.

Saving changed Patient Objects into .txt file

  1. PatientInstance then calls PatientStorage.storePatients() which starts the process of writing the details of all existing Patient Objects, within the PatientList into a specified .txt file.
  2. PatientStorage.storePatients() then calls fileInit() which ensures that the specified .txt file exists.
  3. Data is written and saved.
  4. Control is then returned to PatientInstance.

Design Considerations

Using an iterator to store the location of the item being deleted:

Option 1 (Final choice): Not using an iterator

Option 2 : Using an iterator


5.2.4 Patient List

Implementation:

The function List does not take in any additional inputs, in order to show the user a list of current Patient objects in the database. Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. After validation, a PatientListCommand object is created. PatientListCommand object will be executed to iterate through the list of Patient Objects. Patient Objects will then be displayed based on the user given input.

Invalid Input includes:

- Any input apart from Blank Input or a single delimiting slash.

Format list

Check validity of the data input

  1. If the command recognised is the list command, patientParse() calls checker.checkLength() to ensure data entered is valid.

Creating PatientListCommand

  1. If the input data is valid, a PatientListCommand object is created
  2. The PatientListCommand object is returned to PatientInstance.run()

Viewing Patient Objects

  1. PatientInstance then executes the PatientListCommand object to begin the process of displaying all Patient objects.
  2. PatientList.execute() will call the function PatientList.listPatients()
  3. PatientList.listPatients() will iterate through the objects in ArrayList PatientList.
  4. Patient Objects will be displayed.
  5. Control is then returned to PatientInstance.

Design Considerations

Using pretty print to display the listed objects:

Option 1 (Final choice): Using pretty print

Option 2 : Printing the patients in blocks with no common rows or columns.


5.2.5 Patient Find

Implementation:

The function Find takes in 1 compulsory field (keyword) to find the relevant Patient Objects within the list of Patient Objects. Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. The given input is used to match with every single field of the Patient Object. If there is a match, the Patient Object will be displayed. Else, an error message will be displayed.

Invalid Input includes:

- Blank input (i.e Empty inputs)
- Illegal Characters
- Inputs that only consist of spaces

Format find/[keyword]

sub-diagram to show the ref

Check validity of the data input

  1. If the command recognised is the find command, patientParse() calls checker.checkFind() to ensure data entered is valid.
  2. checkFind() will call the following methods in sequence:

    • emptySpaceCheck();
      • checkLength();
      • illegalCharacterChecker();

Creating PatientFindCommand

  1. If the input data exist, a PatientFindCommand object is created
  2. The PatientFindCommand object is returned to PatientInstance.run()

Finding relevant Patient Objects

  1. PatientInstance then executes the PatientFindCommand object to begin the process of finding and displaying relevant Patient objects.
  2. PatientFind.execute() will call the function PatientList.findPatient()
  3. PatientList.findPatient() will iterate through the objects in ArrayList PatientList.
  4. PatientList.findPatient() will compare the patient details of every Patient Object in the current list of Patient Objects with the keyword inputted by the user and discover any matches.
  5. The relevant Patient Objects are then displayed.
  6. Control is then returned to PatientInstance.

Design Considerations

Allowing find function to accept case-insensitive inputs:

Option 1 (Final choice): Allowing case-insensitive inputs.

Option 2 : Only allowing case-sensitive inputs.


5.3 Doctor Appointment

5.3.1 Doctor Appointment Menu

Similar to the Start Menu, the Doctor Appointment Menu will repeatedly request user input until the return command is given.

Whenever a user input is given to the Doctor Appointment Menu, the following steps will occur.

Launching Doctor Appointment Menu

  1. ToDoctorAppointmentInstance.execute() will be created and call upon DoctorAppointmentInstance.run().
  2. DoctorAppointmentInstance.run() will start by loading/creating the DoctorAppointment data .txt file for database records. It will check for any signs of corrupted file when loading. Exception will be thrown if any corruption occurs.
  3. DoctorAppointmentInstance.run() will then repeatedly call DoctorAppointmentParser.parse().

Getting User Input

  1. DoctorAppointmentInstance.run() will repeatedly request for user input and call DoctorAppointmentParser.parse().
  2. parse() will call the smartCommandRecognition() to assess the given user input and determine which command is most similar to the input.
  3. Based on the recognised command by the system, the relevant commands will be carried out.


5.3.2 Doctor Appointment Add

Implementation:

The function Add takes in 5 compulsory fields (Doctor ID, Appointment ID, Patient’s Name, Gender, Date) to create the DoctorAppointment Object to be added. Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. A DoctorAppointmentAddCommand object is created and executed to create the DoctorAppointment Object to be added.

Invalid Input includes:

- Invalid Doctor ID format
- Non-existent Doctor ID 
- Invalid Appointment ID format
- Duplicated Appointment ID
- Illegal Characters for Names
- Invalid Gender format
- Invalid Date format
- Blank input (i.e Empty inputs)

add/[Doctor ID]/[Appointment ID]/[Patient's Name]/[Gender]/[Date]

Check validity of the data input

  1. If the command recognised is the add command, DoctorAppointmentParser.parse() calls MainChecker.checkNumInput() and DoctorAppointmentChecker.checkValidDataForAdd() to ensure data entered is valid.
  2. checkValidDataForAdd() will call the following function in sequence:

    • checkDoctorIDFormat()
    • isValidDocId()
    • checkAptIdFormat()
    • isValidAppointmentID()
    • illegalCharacterChecker()
    • isValidGender()
    • checkValidDate();

Creating DoctorAppointmentAddCommand

  1. If the input data is valid, a DoctorAppointmentCommand object is created. Otherwise, a relevant error will be thrown.
  2. The Command object is returned to DoctorAppointmentInstance.run()

Creating DoctorAppointment Object with User Input

  1. DoctorAppointmentInstance then executes the DoctorAppointmentAddCommand object by running DoctorAppointmentAddCommand.execute().
  2. AppointmentList.addAppointment() will be called in which a DoctorAppointment object will be created and added into the ArrayList appointmentList, which contains all the DoctorAppointment Objects.

Saving DoctorAppointment Objects into .txt file

  1. AppointmentList.addAppointment() then calls DoctorAppointmentStorage.writeToFile() which all existing DoctorAppointment Objects within the appointmentList is written into a DoctorAppointment.txt file.
  2. DoctorAppointmentStorage.writeToFile() then calls createFile() which ensures that the specified .txt file exists.
  3. Control is then returned to DoctorAppointmentInstance.


5.3.3 Doctor Appointment Delete

Implementation:

The delete function takes in 1 compulsory field (Doctor ID/ Appointment ID) to identify and delete the corresponding DoctorAppointment Object from ArrayList appointmentList . Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. After validation, a DoctorAppointmentDeleteCommand object is created and executed in which the program will iterate through appointmentList. If the desired DoctorID or Appointment ID exists, it will be removed. Else an error message will be displayed.

Invalid Input includes:

- Invalid Doctor ID format
- Non-existent Doctor ID
- Invalid Appointment ID format
- Non-existent Appointment ID
- Blank input (i.e Empty inputs)

delete/[Doctor ID/ Appointment ID]

Check validity of the data input

  1. If the command is recognised as the delete command, DoctorAppointmentParser.parse() calls MainChecker.checkNumInput() and DoctorAppointmentChecker.checkValidDataForDelete() to ensure that the inputs are valid.

  2. checkValidDataForDelete() will call the following function in sequence:

    • checkIdDuringParse()
    • isValidIdToDelete()

Creating DoctorAppointmentDeleteCommand

  1. A DoctorAppointmentDeleteCommand object is created if the inputs are valid.
  2. The Command object is returned to DoctorAppointmentInstance.run().

Deleting DoctorAppointment Object using User Input

  1. DoctorAppointmentInstance then executes the DoctorAppointmentDeleteCommand object by running DoctorAppointmentDeleteCommand.execute().
  2. AppointmentList.deleteAppointment() is called, which iterates through the objects in ArrayList appointmentList. The DoctorAppointment Object matching the input given by the user will be removed from the array list.

Saving changed DoctorAppointment Objects into .txt file

  1. AppointmentList.deleteAppointment() then calls DoctorAppointmentStorage.writeToFile() which rewrites the updated appointmentList into the DoctorAppointment.txt file.
  2. Control is then returned to DoctorAppointmentInstance.


5.3.4 Doctor Appointment List all

Implementation:

The function lists all Doctor Appointment Objects currently in ArrayList appointmentList. Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. After validation, a DoctorAppointmentListCommand object is created and executed in which the program will iterate and display all DoctorAppointment Objects currently within the array list.

Invalid Input includes:

- Any input apart from Blank Input (i.e Empty input) OR "all" OR "Appointment ID" OR "Doctor ID" 

list/all

Check validity of the data input

  1. If the command recognised is the list command, DoctorAppointmentParser.parse() calls MainChecker.checkNumInput() and DoctorAppointmentChecker.checkValidDataForList() to check and verify the validity of inputs accompanied by the list command, if any.

  2. checkValidDataForList() will call the following function in sequence:

    • checkIdDuringParse()
    • isValidDocId()
    • isValidListAppointmentID()

Creating DoctorAppointmentListCommand

  1. A DoctorAppointmentListCommand object is created if the inputs are valid.
  2. The Command object is returned to DoctorAppointmentInstance.run().

Viewing DoctorAppointment Objects

  1. DoctorAppointmentInstance then executes the DoctorAppointmentList Command object by running DoctorAppointmentListCommand.execute().
  2. AppointmentList.listAppointment() is called, and will iterate through the objects in ArrayList appointmentList.
  3. All DoctorAppointment Objects in the array list will be displayed.
  4. Control is then returned to DoctorAppointmentInstance.


5.3.5 Doctor Appointment List by Doctor ID or Appointment ID

Implementation:

The function list takes in 1 compulsory field (keyword) to list the relevant DoctorAppointment Objects currently in ArrayList appointmentList.Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. After validation, a DoctorAppointmentList Command object is created and executed in which the program will iterate and display the DoctorAppointment Objects matching the user input currently within the array list. Invalid Input includes:

- Any input apart from Blank Input (i.e Empty input) OR "all" OR "Appointment ID" OR "Doctor ID" 

list/[Doctor ID/ Appointment ID]

Check validity of the data input

  1. If the command recognised is the list command, DoctorAppointmentParser.parse() calls MainChecker.checkNumInput() and DoctorAppointmentChecker.checkValidDataForList() to check and verify the validity of inputs accompanied by the list command, if any.

Creating DoctorAppointmentListCommand

  1. A DoctorAppointmentListCommand object is created if the inputs are valid.
  2. The Command object is returned to DoctorAppointmentInstance.run().

Viewing DoctorAppointment Objects

  1. DoctorAppointmentInstance then executes the DoctorAppointmentListCommand object by running DoctorAppointmentListCommand.execute().
  2. AppointmentList.listAppointment() is called, and will iterate through the objects in ArrayList appointmentList.
  3. DoctorAppointment Objects matching the user input present in the array list will be displayed.
  4. Control is then returned to DoctorAppointmentInstance.


5.4 Nurse Schedule

5.4.1 Nurse Schedule Menu

Similar to the start menu, the Nurse Schedule menu will repeatedly request user input until the return command is given.

Whenever a user input is given to the Nurse Schedule Menu, the following steps will occur

Launching Nurse Schedule Menu

  1. ToNurseScheduleInstance.execute() will create and call NurseScheduleInstance.runCommandLoopUntilExit().

  2. runCommandLoopUntilExit() will start by loading/creating the NurseSchedule.txt for database records. It will check for any signs of file corruption when loading. An exception will be thrown if any corruption is present.

  3. runCommandLoopUntilExit() will then repeatedly call nurseParse().

Getting User Input

  1. User inputs are repeatedly requested by runCommandLoopUntilExit.

  2. nurseParse() will call smartCommandRecognition to assess the given user input and determine which command is the most similar to the input.

  3. Based on the recognised command, the relevant execution will be carried out.


5.4.2 Nurse Schedule Add

Implementation

The function Add takes in 3 compulsory fields (Nurse ID, Patient ID, Date) to create a new Nurse Schedule object to be added. The Nurse ID, Patient ID and Date inputs will be first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command will be aborted. Else, a NurseScheduleAddCommand object is created and executed which will create a NurseSchedule object to be added.

Invalid Inputs include:

- Invalid Nurse ID or Patient ID format
- Non-existent Nurse ID or Patient ID
- Blank input
- Illegal Characters
- Illegal date format
- Duplicate schedules (i.e similar Patient ID and date)

Format: add/[Nurse ID]/[Date (DDMMYYYY)]

Checking validity of data input

  1. If the command recognised is the add command, the parameters will first be checked for their validity. The following functions will be called in sequence:
    • isValidDate()
    • checkNumInput()
    • illegalCharacterChecker()

Creating NurseScheduleAddCommand object with User Input

  1. If the parameters are valid, a NurseScheduleAddCommand object is created, which will be passed back to NurseScheduleInstance.runCommandLoopUntilExit().

  2. The Command objected is then executed and NurseScheduleList.addSchedule() will be called which creates a NurseSchedule object and adds it into the array list.

Saving NurseSchedule objects into .txt file

  1. The command loop then calls NurseScheduleStorage.writeToFile() which starts the process of writing details of all existing Nurse Schedule objects within the Arraylist into a specific .txt file.

  2. Control is then returned to NurseScheduleInstance.


5.4.3 Nurse Schedule Delete

Implementation

The delete function takes in 2 compulsory field (Nurse ID, Date) to identify and delete the Nurse Schedule object from the arraylist of Nurse Schedule objects. The Nurse ID and date will first be checked for its validity. Any invalid input detected will result in an exception thrown and command will be aborted. Else, a NurseScheduleDeleteCommand object is created and executed.

Invalid Inputs include:

- Invalid Nurse ID format
- Non-existent Nurse ID
- Blank input
- Illegal Characters
- Illegal date format

Format: delete/[Nurse ID]/[Date (DDMMYYYY)]

Checking validity of data input

  1. If the command is recognised as a delete command, the parameters provided will first be checked for its validity.

Creating NurseScheduleDeleteCommand object

  1. If the parameters are valid, a NurseScheduleDeleteCommand object is created, which will be passed back to NurseScheduleInstance.runCommandLoopUntilExit().

  2. NurseScheduleDelete.execute() will call the function NurseScheduleList.deleteSchedule().

  3. deleteSchedule iterates through the arraylist and removes the first object that matches the user input given.

Saving updated NurseSchedule objects into .txt file

  1. runCommandLoopUntilExit() will then call NurseScheduleStorage.writeToFile() which starts the process of writing details of all existing Nurse Schedule objects within the Arraylist into a specific .txt file.

  2. Control is then returned to NurseScheduleInstance.


5.4.4 Nurse Schedule List all

Implementation

This function lists all Nurse Schedule objects, sorted by earliest added Nurse ID, then sorted by earliest date. Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. After validation, a NurseScheduleListCommand object is created. NurseScheduleListCommand object will be executed to iterate through the arraylist of Nurse Schedule objects. Nurse Schedule Objects will then be displayed.

Invalid Inputs include:

- Any input apart from "all" OR "NurseID"

Format: list/all

Checking validity of data input

  1. If the command recognised is the list command, the number of fields in inputs will first be checked.

Creating NurseScheduleListCommand object

  1. If the input is valid, a NurseScheduleListCommand object is created.

  2. The NurseScheduleListCommand object is returned to NurseScheduleInstance.runCommandLoopUntilExit().

Viewing Nurse Schedule objects

  1. NurseScheduleInstance then executes the NurseScheduleListCommand object to begin the process of displaying Nurse Schedule objects.

  2. NurseScheduleListCommand.execute() will call the function NurseScheduleList.listSchedules() which calls listAllSchedules().

  3. listAllSchedules() iterates through the arraylist of Nurse Schedule objects, printing all schedules.


5.4.5 Nurse Schedule List by Nurse ID

Implementation

This function lists specified Nurse Schedule objects, sorted by earliest date. Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. After validation, a NurseScheduleListCommand object is created. NurseScheduleListCommand object will be executed to iterate through the arraylist of Nurse Schedule objects. Nurse Schedule objects will then be displayed.

Invalid Inputs include:

- Any input apart from "all" OR "NurseID"

Format: list/[Nurse ID]

Checking validity of data input

  1. If the command recognised is the list command, the number of fields in inputs will first be checked.

Creating NurseScheduleListCommand object

  1. If the input is valid, a NurseScheduleListCommand object is created.

  2. The NurseScheduleListCommand object is returned to NurseScheduleInstance.runCommandLoopUntilExit().

Viewing Nurse Schedule objects

  1. NurseScheduleInstance then executes the NurseScheduleListCommand object to begin the process of displaying Nurse Schedule objects.

  2. NurseScheduleListCommand.execute() will call the function NurseScheduleList.listSchedules() which calls getSchedulesByID.

  3. getSchedulesByID iterates through the arraylist of Nurse Schedule objects, printing schedules of the relevant Nurse ID.


5.5 Inventory

5.5.1 Inventory Menu

Similar to the Start Menu, the Inventory Menu will repeatedly request user input until the return command is given.

Whenever a user input is given to the Inventory Menu, the following steps will occur.

Launching Inventory Menu

  1. ToInventoryInstance.execute() will create and call InventoryInstance.run()
  2. InventoryInstance.run() will start by loading/creating the Inventory data .txt file for Inventory database records. It will check for any signs of corrupted file when loading. Exception will be thrown if any corruption occurs.
  3. InventoryInstance.run() will then repeatedly call InventoryParser().

Getting User Input

  1. InventoryInstance.run() will repeatedly request for user input and call InventoryParser.inventoryParse().
  2. inventoryParse() will call the smartCommandRecognition() to assess the given user input and determine which command is most similar to the input
  3. Based on the recognised command by the system, the relevant commands will be carried out.


5.5.2 Inventory Add

Implementation:

The function Add takes in 3 compulsory fields (Item Name, Price, Quantity) to create the Inventory Object to be added. Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. A InventoryAdd Command object is created. InventoryAdd command object will be executed to create the Inventory Object to be added.

Invalid Input includes:

- Invalid Price 
- Invalid Quantity
- Blank input (i.e Empty inputs)
- Illegal Characters

add/[Item Name]/[Price]/[Quantity]

Check validity of the data input

  1. If the command recognised is the add command, InventoryParser.parse() calls InventoryChecker.checkAdd(), MainChecker.checkNumInput(), and MainChecker.checkBlankInput() to ensure data entered is valid
  2. checkAdd() will call the following function in sequence:

    • emptySpaceCheck()
    • checkStorageLength()
    • illegalCharacterChecker()
    • checkPrice()
    • checkQuantity()
    • checkDuplicate()

Creating InventoryAdd command

  1. If the input data is valid, a InventoryAdd Command object is created. Otherwise, a relevant error is thrown.
  2. The InventoryAdd Command object is returned to InventoryInstance.run()

Creating Inventory Object with User Input

  1. InventoryInstance then executes the InventoryAdd Command object by running InventoryAdd.execute().

  2. InventoryList.addItems() will be called in which an Inventory object will be created and added into the ArrayList inventoryList which contains all the Inventory Objects.

  3. If the list already contains data with the same Item Name and Price, the Quantity of the Item will be increased in the list by the value in the user input Quantity field. InventoryList.addItems will call Inventory.addQuantity. This will modify the Quantity of that specified Item.

Saving Inventory Objects into .txt file

  1. InventoryInstance then calls InventoryStorage.storeInventory() which starts the process of writing the details of all existing Inventory Objects, within the InventoryList into a specified .txt file.
  2. InventoryStorage.writeToFile() then calls fileInit() which ensures that the specified .txt file exists.
  3. Data is written and saved.
  4. Control is then returned to InventoryInstance.


5.5.3 Inventory Delete

Implementation:

The function Delete takes in 2 compulsory field (Item Name, Quantity) to identify and decrease the Quantity of the Inventory Object from ArrayList list. Data input is first checked to ensure validity. Any invalid input detected will result in an Exception thrown and command aborted. After validation, a InventoryDelete Command object is created. InventoryDelete command object will be executed to iterate through the ArrayList InventoryList. If Inventory Object exists, its Quantity will be decreased by the Quantity indicated in the user input. Else an error message will be displayed.

Invalid Input includes:

- Invalid Quantity
- Invalid Name
- Blank input (i.e Empty inputs)
- Illegal Characters

delete/Item Name/Quantity

Check validity of the data input

  1. If the command recognised is the delete command, InventoryParser.parse() calls InventoryChecker.checkDelete(), MainChecker.checkNumInput(), and MainChecker.checkBlankInput() to ensure that there are valid and sufficient inputs

Creating InventoryDelete command

  1. If the input data is valid, a InventoryDelete Command object is created
  2. The Command object is returned to InventoryInstance.run()

Deleting Quantity from an Inventory Object using User Input

  1. InventoryInstance then executes the InventoryDelete Command object to begin the process of deleting the referenced Quantity of the Inventory object
  2. InventoryList.deleteItems() is called, which iterate through the objects in ArrayList InventoryList. The Inventory Object referenced by the input given by the user, will have its Quantity reduced by the Quantity indicated in the user input.

Saving changed Inventory Objects into .txt file

  1. InventoryInstance then calls InventoryStorage.storeInventory() which starts the process of writing the details of all existing Inventory Objects, within the InventoryList into a specified .txt file.
  2. InventoryStorage.writeToFile() then calls fileInit() which ensures that the specified .txt file exists.
  3. Data is written and saved.
  4. Control is then returned to InventoryInstance.


5.5.4 Inventory List

Implementation:

This function lists all the Inventories currently in the ArrayList InventoryList. A InventoryList Command object is created. InventoryList command object will be executed to iterate through the list of Inventory Objects. Inventory Objects will then be displayed based on the user given input.

Check validity of the data input

  1. If the command recognised is the list command, InventoryParser.parse() calls MainChecker.checkNumInput() to check and verify the validity of inputs accompanied by the list command, if any.

Creating InventoryList command

  1. If the input data is valid, a InventoryList Command object is created
  2. The InventoryList Command object is returned to InventoryInstance.run()

Viewing Inventory Objects

  1. InventoryInstance then executes the InventoryList Command object to begin the process of displaying all Inventory objects.
  2. InventoryList.execute() will call InventoryList.listInventory() and will iterate through the objects in ArrayList InventoryList.
  3. Depending on the input given by the user, the relevant Inventory Objects will be displayed.
  4. Control is then returned to InventoryInstance.


5.6 Proposed Features

5.6.1 Auto Schedule Generator for Nurses

This feature will be able to generate the daily schedule for individual nurses with the schedules in the database. This will allow nurses to have a clear view of their daily tasks, allowing them to plan their day better. Hence, this feature has been proposed as one of the goals of HealthVault is to improve the efficiency of hospital and healthcare information management, something we believe this feature will do.

Brief Implementation

  1. User specifies which Nurse ID a schedule should be generated for.
  2. Program will sort all schedules tied to specified Nurse ID.
  3. A schedule will be generated based on the earliest schedule.

5.6.2 Personalized Account Login

This feature will allow nurses to have a personalized account within HealthVault, enabling them to only access relevant functionalities of the app. By cutting down on the unnecessary information one has to deal with, the team believes this will aid nurses working in a high-stress environment.

5.6.3 Inventory Alerts

This feature will alert nurses whenever an inventory of an item is low. This ensures that essential items will never be unavailable as nurses will always have up to date information on which specific item needs to be restocked.

Brief Implementation

  1. User adds a threshold stock quantity for when an alert should be raised.
  2. Program checks inventory database everytime inventory is accessed.
  3. Alert will be raised, reminding the nurses that the item is low on inventory level.


Appendix A: Product Scope

Target user profile:
HealthVault primarily targets nurses. Its features optimize it for users seeking:

Value Proposition:
With its organized and portable database and its features to improve efficiency, HealthVault aspires to help its users achieve the following results:

Every second matters in the healthcare industry when patient lives are at stake. We believe that HealthVault can help its users save those precious seconds.


Appendix B: User Stories

Priority As a… I want to… So that I can…
* * * nurse quickly refer to usage instructions quickly get on track with the workflow
* * * nurse add a new staff/patient record information of staff and patients
* * * nurse delete staff/patients remove entries i no longer need
* * * nurse view all staff quickly get an overview of staff
* * * nurse quickly add schedules for nurses and appointments for doctors reduce the waiting time for patients
* * * nurse quickly look up schedules for both nurses and doctors plan my schedule better
* * * nurse delete schedules/appointments eliminate wasted time and resources
* * * nurse quickly add/delete inventories manage our inventories better
* * * nurse quickly look up inventories plan what and when to restock our supplies
* nurse have the program recognize slight errors in typing have leeway working in a high-stress environment


Appendix C: Non Functional Requirements


Appendix D: Glossary


Appendix E: Instructions for Manual Testing

Given below are instructions to test HealthVault manually.

Launching HealthVault

Initial launch of HealthVault 1. Download the jar file here and copy into an empty folder. 2. Open up a command window to that folder with the jar file. 3. Run the command java -jar tp.jar

        Expected: HealthVault will be loaded, and a welcome message will be shown. Ensure        that the version number in the welcome matches version of the jar file downloaded.

Start Menu

Choose a directory from the Start Menu

ℹ️ Ensure that the location that you are trying to access is in the Start Menu or else an error message will pop up.

        1. Test case: staff (where you will be directed to the Staff Menu)

             Expected:

Welcome to Staff Menu!
Type "help" for staff menu commands

        2. Test case: patient (where you will be directed to the Patient Menu)

             Expected:

Welcome to the patient Commands section!
Type "help" for patient menu command

        3. Test case: appointments (where you will be directed to the Appointments’ Menu)

             Expected:

Welcome to the Appointments' Menu!
Type 'help' for appointment menu commands

        4. Test case: schedules (where you will be directed to the Schedules’ Menu)

             Expected:

Welcome to Nurse Schedules!
Type "help" to for nurse schedules commands

        5. Test case: inventory (where you will be directed to the Staff Menu)

             Expected:

Welcome to Inventory Menu!
Type "help" for Inventory menu commands

        6. Test case: help (where you will be directed to the Help Menu)

             Expected:

Commands       Description                             Format    
____________________________________________________________________________________________________
staff          To go to staff                          -         
patient        To go to patients                       -         
appointments   To go to doctors appointments           -         
schedules      To go to nurse schedules                -         
inventory      To go to inventory                      -         
help           To see what commands for Start Menu     -         
exit           To exit the application                 -         

        7. Test case: exit (where you will exit the program)

              Expected: Goodbye! Have a nice day!


Choose which feature you want to use from Staff Menu

  1. Adding a new staff

:information_source: Important notes about the input format

  1. Make sure that the inputted user ID starts with a D (for doctor ID) or N (for nurse ID) and has exactly 5 digits in the number following!
  2. Any input field in HealthVault only accepts space and alphanumeric characters
  3. The age field input should be a positive integer starting from 0 but less than 150

        Positive Test case: add/D12345/MingShun/30/Pediatrician

        Expected: Doctor MingShun hired :)

        Negative Test case: add/D1/MingShun/40/Pediatrician

        Expected:

Error in Staff ID input
Please input with the following format [D/N][5 digit ID number]


  1. Deleting staff

:information_source: Important notes about the input format

  1. Make sure that the inputted user ID starts with a D (for doctor ID) or N (for nurse ID) and has exactly 5 digits in the number following!

        Positive Test case: delete/D12345

        Expected: D12345 has been fired :(

        Negative Test case: delete/Owen

        Expected:

Error in Staff ID input
Please input with the following format [D/N][5 digit ID number]


  1. Listing all doctors and nurses

:information_source: Important notes about the input format

  1. <> implies that the inputs are optional

        3.1

            Positive Test case: list/nurses

            Expected:

ID         | Name       | Age   | Specialisation      
____________________________________________________________
N12345     | Sarrah     | 30    | Emergency    

            Negative Test case: list/

            Expected:

Invalid List command parameter
Please input with the either of the following format:
list
list/nurses
list/doctors

        3.2

           Positive Test case: list/doctors

            Expected:

ID         | Name       | Age   | Specialisation      
____________________________________________________________
D12345     | MingShun   | 30    | Pediatrician    

        3.3

            Positive Test case: list

            Expected:

ID         | Name       | Age   | Specialisation      
____________________________________________________________
N12345     | Sarrah     | 30    | Emergency  
D12345     | MingShun   | 30    | Pediatrician    
D12355     | Alex       | 28    | Oncology

            Negative Test case: list/blahblah

            Expected:

Invalid List command parameter
Please input with the either of the following format:
	list
	list/nurses
	list/doctors


  1. Finding a staff

:information_source: Important notes about the input format

  1. Any keyword input will be searched through every field of Staff details. i.e. It can be used to search Staff ID, name, age and specialisation.

        Positive Test case: find/Oncology

        Expected:

ID         | Name       | Age   | Specialisation      
____________________________________________________________
D12355     | Alex       | 28    | Oncology            

        Negative Test case: find/

        Expected:

OOPS! There are too few inputs for this command


  1. Returning to Start Menu

        Test case: return

        Expected: Returning to start menu!


  1. Directing to help function

        Test case: help

        Expected:

Here is a list of Staff commands: 

Commands  Description                                                 Format                                            
____________________________________________________________________________________________________
help      Brings up the list of commands for Staff!                   -                                                 
add       Adds Staff details to the Staff database!                   add/[Staff ID]/[Name]/[Age]/[Specialisation]      
list      Brings up the list of all current Staff in database!        list/<input>, where input == doctor or nurse      
delete    Deletes the Staff with the specified ID from the list!      delete/[Staff ID]                                 
find      Finds a matching Staff using a keyword or phrase!           find/[keyword or phrase]                          
return    Returns you to the Start Menu!                              -                                 


Choose which feature you want to use from Patient Menu

  1. Adding a new patient

:information_source: Important notes about the input format

  1. Make sure that the inputted user ID starts with an upper case P and has exactly 5 digits in the number following!

        Example: P12345, P54321

  1. Any input field in HealthVault only accepts space and alphanumeric characters.
  2. The gender field input is case-insensitive but should only be “M”, “F” or “Others” or any other upper and lower case versions.
  3. The age field input should be a positive integer including 0, starting from 0 to inclusive of 150.

        Positive Test case: add/P55555/Sam/40/M/Fever/Paracetamol

        Expected: Sam is now a patient here!

        Negative Test case: add/P1/Jill/40/F/Covid19/Macrolides

        Expected:

Error in Patient ID input
Please input with the following format [P][5 digit ID number]


  1. Deleting a patient

:information_source: Important notes about the input format

  1. Make sure that the inputted user ID starts with an upper-case P and has exactly 5 digits in the number following!

        Example: P12345, P54321

        Positive Test case: delete/P55555

        Expected:

Noted. I've removed this patient: 
Sam
Now you have 0 patients in the list

        Negative Test case: delete/P123456

        Expected:

Error in Patient ID input
Please input with the following format [P][5 digit ID number]


  1. Listing all patients

        Positive Test case: list

        Expected:

Here are the patients currently in the list!
ID       | Name                 | Age    | Gender   | Illness              | Medication Required 
____________________________________________________________________________________________________
P55555   | Sam                  | 40     | M        | Fever                | Paracetamol    
P12345   | Amy                  | 35     | F        | Flu                  | Panadol

        Negative Test case: list/a

        Expected: OOPS! There are too many inputs for this command


  1. Finding a patient

:information_source: Important notes about the input format

  1. Any keyword input will be searched through every field of Patient details. i.e. It can be used to search Patient ID, name, age, illness, medication required. The keyword input can be case-insensitive and still find matches in the database.

            4.1

            Positive Test case: find/P55555

            Expected:

ID       | Name                 | Age    | Gender   | Illness              | Medication Required 
____________________________________________________________________________________________________
P55555   | Sam                  | 40     | M        | Fever                | Paracetamol    

            Negative Test case: find/

            Expected: OOPS! There are too few inputs for this command

            4.2

            Positive Test case: find/Sam

            Expected:

ID       | Name                 | Age    | Gender   | Illness              | Medication Required 
____________________________________________________________________________________________________
P55555   | Sam                  | 40     | M        | Fever                | Paracetamol    

            Negative Test case: find/Same

            Expected: There is no patient in the list that matches your keywords!


  1. Returning to Start Menu

        Test case: return

        Expected: Returning to start menu!


  1. Directing to help function

        Test case: help

        Expected:

Here is a list of Patient commands: 

Commands  Description                                                 Format                                                                
__________________________________________________________________________________________________________________________________________
help      Brings up the list of commands for Patient!                 -                                                                     
add       Adds Patient details to the Patient database!               add/[Patient ID]/[Name]/[Age]/[Gender]/[Illness]/[Medication Needed]  
list      Brings up the list of all current Patient in database!      -                                                                     
delete    Deletes the Patient with the specified ID from the list!    delete/[Patient ID]                                                   
find      Finds a matching Patient using a keyword or phrase!         find/[keyword or phrase]                                              
return    Returns you to the Start Menu!                              -                                


Choose which feature you want to use from Appointments’ Menu

  1. Adding a new appointment

:information_source: Important notes about the input format

  1. Make sure that the inputted doctor/appointment ID starts with an upper-case D/A and have exactly 5 digits in the number following!
  2. Any input fields in HealthVault only accepts space and alphanumeric characters.
  3. The gender field input should only be “M”, “F”.
  4. This function allows the adding of past appointments.

        Positive Test case: add/D12345/A12345/Alex/M/21012021

        Expected: Appointment Added

        Negative Test case: add/D3/A12345/Alex/M/21012021

        Expected:

Error in Doctor ID input
Please input with the following format [D][5 digit ID number]


  1. Deleting an appointment

:information_source: Important notes about the input format

  1. Make sure that the inputted doctor/appointment ID starts with a D/A and have exactly 5 digits in the number following!

        2.1

          Positive Test case: delete/D12345

          Expected: DoctorID / Appointment ID: D12345/A12345 has been deleted!

          Negative Test case: delete/D123

          Expected:

Error in ID input
Please input with the following format [D/A] followed by [5 digit ID number]

        2.2

          Positive Test case: delete/A54321

          Expected: Appointment ID: A54321 has been deleted!

          Negative Test case: delete/A123

          Expected:

Error in ID input
Please input with the following format [D/A] followed by [5 digit ID number]


  1. Listing appointments

:information_source: Important notes about the input format

  1. Make sure the input all is lower caps.
  2. Make sure that the inputted doctor/appointment ID starts with a D/A and have exactly 5 digits in the number following!

        3.1

            Positive Test case: list/all

            Expected:

Doctor ID      | Appointment ID | Name           | Gender         | Date          
____________________________________________________________
D11111         | A54321         | Owen           | M              | 01/04/2021
D12345         | A12345         | Alex           | M              | 21/01/2021  

            Negative Test case: list/a

            Expected:

Error in ID input
Please input with the following format [all/D/A] followed by [5 digit ID number]

        3.2

            Positive Test case: list/D12345

            Expected:

Doctor ID      | Appointment ID | Name           | Gender         | Date          
____________________________________________________________
D12345         | A12345         | Alex           | M              | 21/01/2021  

            Negative Test case: list/D111

            Expected:

Error in ID input
Please input with the following format [all/D/A] followed by [5 digit ID number]

        3.3

            Positive Test case: list/A12345

            Expected:

Appointment ID | Name           | Gender         | Date          
____________________________________________________________
A12345         | Alex           | M              | 21/01/2021  

            Negative Test case: list/A111

            Expected:

Error in ID input
Please input with the following format [all/D/A] followed by [5 digit ID number]


  1. Returning to Start Menu

        Test case: return

        Expected: Returning to Start Menu!


  1. Directing to help function

        Test case: help

        Expected:

Here is a list of Doctor Appointments Commands: 
Commands  Description                                                           Format                                            
____________________________________________________________________________________________________
help      Brings up the list of commands for Doctor Appointments!               -                                                 
add       Adds Doctor Appointment details to the database!                      add/[Doctor ID]/[Appointment ID]/[Name]/[Gender]/[Date (DDMMYYYY)]
list      Brings up the list of all current Doctors' Appointments in database!  list/[all/DoctorID/AppointmentID]                     
delete    Deletes the Appointment with the specified ID from the list!          delete/[DoctorID/Appointment ID]                  
return    Returns you to the Start Menu!                   


Choose which feature you want to use from Schedules’ Menu

  1. Adding a new schedule

:information_source: Important notes about the input format

  1. Make sure Nurse ID exists in Staff and Patient ID exists in Patients before adding.
  2. Make sure that the inputted user ID starts with an N for Nurse, P for Patient and have exactly 5 digits in the number following!
  3. Any input fields in HealthVault only accepts space and alphanumeric characters.
  4. HealthVault currently only allows the adding of 1 schedule per patient per day.

        Positive Test case: add/N12345/P12345/30012020

        Expected: Trip to P12345 on 30/01/2020 added!

        Negative Test case: add/N1/P12345/30012020

        Expected:

OOPS! Looks like your ID value is incorrect! 
Please ensure that the ID includes 5 numbers after "N" or "P" 
eg. N12345 or P67891


  1. Deleting schedule

:information_source: Important notes about the input format

  1. Make sure that the inputted Nurse ID starts with an N for Nurse, and have exactly 5 digits in the number following!
  2. HealthVault only accepts valid Date inputs.

        Positive Test case: delete/N12345/30012020

        Expected: Trip to P12345 on 30/01/2020 has been cancelled!

        Negative Test case: delete/N1/30012020

        Expected: NurseID does not exist! Please check Staff List and try again!


  1. Listing schedules

:information_source: Important notes about the input format

  1. Make sure that the inputted Nurse ID starts with an N for Nurse, and have exactly 5 digits in the number following!

        3.1

            Positive Test case: list/N12345

            Expected:

Nurse ID   | Patient ID | Date      
____________________________________________________________
N12345     | P12345     | 30/01/2020 

            Negative Test case: list/N1

            Expected: NurseID does not exist! Please check Staff List and try again!


        3.2

            Positive Test case: list/all

            Expected:

Nurse ID   | Patient ID | Date      
____________________________________________________________
N12345     | P12345     | 30/01/2020
N55555     | P55555     | 30/01/2020   

            Negative Test case: list

            Expected:

OOPS! Please check to see if your command is properly formatted!
Please input with the following format: list/[NurseID/all]


  1. Returning to Start Menu

        Test case: return

        Expected: Returning to start menu!


  1. Directing to help function

        Test case: help

        Expected:

Here is a list of Nurse Schedule commands: 
Commands  Description                                                      Format                                            
____________________________________________________________________________________________________
help      Brings up the list of commands for Nurse Schedule!               -                                                 
add       Adds Nurse Schedule details to the database!                     add/[Nurse ID]/[Patient ID]/[Date (DDMMYYYY)]     
list      Brings up the list of all current Nurse Schedules in database!   list/[NurseID/all]                                
delete    Deletes the Schedule with the specified ID from the list!        delete/[Nurse ID]/[Date (DDMMYYYY)]               
return    Returns you to the Start Menu!                                   -    


Choose which feature you want to use from Inventory Menu

  1. Adding a new item or increasing quantity of current items.

:information_source: Important notes about the input format

  1. Make sure that the inputted price is valid and does not have more than 2 decimal places!
  2. Any input fields in HealthVault only accepts space and alphanumeric characters!
  3. Avoid using uppercase letters!

        Positive Test case: add/paracetamol/3/90

        Expected: 90 paracetamol is added into Inventory!

        Negative Test case: add/paracetamol/bc$3*/90

        Expected: Please enter a valid price!


  1. Decreasing quantity of items.

:information_source: Important notes about the format

  1. Avoid using uppercase letters

        Positive Test case: delete/paracetamol/20

        Expected: Noted. I've removed 20 paracetamol

        Negative Test case: delete/paracet/20

        Expected: OOPS! This item does not exist in the Inventory!


  1. Listing all items

        Positive Test case: list

        Expected:

ItemName        | Price      | Quantity
------------------------------------------------------------

paracetamol     | 3.00       | 70   
panadol         | 4.80       | 36 

        Negative Test case: list/hello/34

        Expected: OOPS! There are too many inputs for this command


  1. Returning to Start Menu

        Test case: return

        Expected: Returning to start Menu!


  1. Directing to help function

        Test case: help

        Expected:

Here is a list of Inventory commands: 

Commands  Description                                                 Format                                            
____________________________________________________________________________________________________
help      Brings up the list of commands for Inventory!               -                                                 
add       Adds Inventory details to the database!                     add/[Item name]/[Price]/[Quantity]                
list      Brings up the list of all current Inventory in database!    list                                              
delete    Deletes the Inventory item from the list!                   delete/[Item Name]/[Quantity]                                
return    Returns you to the Start Menu!                              -