PROJECT: NurseTraverse


Overview

NurseTraverse is a desktop application designed to help community nurses manage all the data they may need, including visit management, appointment scheduling, and importing and exporting of patient data. The user interacts with the app using a CLI (Command Line Interface) enhanced with an autocomplete functionality and ability to undo and redo commands. The app has a GUI created with JavaFX and is written in Java. NurseTraverse is built by me and 4 other students.

Summary of contributions

  • Major enhancement: added the ability to autocomplete any command words in application

    • What it does:

      • Allows the user to easily complete a full command with or without typing.

      • Guides user in selecting which command to enter next through commands classifications in suggestion panel and command explanations in result box

    • Justification: Nurses and new users may not be familiar with command line input and the different types commands in the application. Thus, having a suggestion panel at the side will greatly enhance user experience, especially for slow typers. Having a guided system will aid nurses in familiarising with the application commands and understanding of the different functions in the system in general.

    • Highlights: The implementation of word suggestion is rather tedious since many of the full commands have different formats. For example, "pat-list" do not require any patient index and prefixes but "pat-edit 1 n/ …​" requires both. Thus the implementation of list handlers were changed a few times to fit the objective of providing a better user experience. Logic for checking already matched words in order to change a new set of suggestion words is challenging as well, mainly due to many commands having different formats as mentioned earlier.

    • Credits: No outside code or ideas were referenced in the development of these features (beyond code that already exists within Address Book 3).

  • Code contributed: An overview of contributed code can be found here.

    • Milestone v1.2: #55

    • Milestone v1.3: #56

    • Milestone v1.4: #61

    • Bug hunting: #183

  • Other contributions:

    • Project management:

      • Managed release v1.3 on GitHub

    • Documentation:

      • Updated developers guide(appendix A-E) #44

    • Community:

      • Misc team bug fixes #186

      • PRs reviewed (with non-trivial review comments): #81, #98, #217

      • Set up travis CI for the project

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.

Autocomplete

Autocomplete

As a community nurse, you will be performing several commands through the Command Line Interface (CLI). In order to speed up the process, the application includes an autocomplete feature that allows you to more quickly and conveniently input your commands and parameters. This section describes the feature in further detail.

Viewing list of suggested words

To the right of the command box, there is a panel that has a list of suggestion words. The suggestion list will be constantly updated to fit your input.

Updating list of suggested words

The suggested list of words in the autocomplete panel will be updated as you type in the command box. The panel will only suggest to you words that you need, based on your input and your previous word selection. Should your input be wrong or does not match any of the suggested word, no words will be suggested to you.

Eg:
If "visit-" is your input in the commandbox, only words that are related to "visit" will be suggested such as "start" and "end".

Figure 1: Example usage 1
acvisual1

If "visit-s" is your input in the commandbox, only words that starts with "s" and is also related to visit such as "start" will be suggested.

Figure 1: Example usage 2
acvisual2

Note:

  • When prefixes are suggested, you should select all prefixes that you need then type in the required sub-details
    Eg: Select all prefixes "pat-add n/ p/ e/ a/ t/" before adding sub-details "pat-add n/John p/98762615 e/john@example.com a/exampleaddress t/exampletag vt/examplevisittodo"

  • If no words appear in the autocomplete panel, this can only mean 2 things:
    1) Your full command is finished, there are no more words to be suggested.
    2) Your input is wrong and does not match any of the words to be suggested. (Try to change your input by backspacing)

Selecting a suggested words

UP, DOWN key
You can use the UP and DOWN keys in your keyboard to move from one selected word to another. Descriptions of the suggested words will be shown as you select them to guide you in choosing.

SHIFT key
Confirm your selection by pressing the SHIFT key in your keyboard. This will auto-fill the selected word to your current words in the command box text field.

Eg:
Selecting the "now-update" in the autocomplete panel will concatenate with "now-update" with "visit-", the current text in your command box.

Note:
When pressing UP, DOWN, or SHIFT keys, make sure that the command box is selected.

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.

Overview Of Implementation

The auto-complete mechanism extends NurseTraverse with 3 functionalities

  • Completing word in command box

  • Suggesting of words that are compatible with previous sub-commands

  • Guide for user to select from the various sub-commands

Given below is an example usage scenario of autocompletion

Step 1: When the user launches the application, an instance of the object, command and prefix autocomplete word list will be initialised in AutoCompleteStorage, which implements the following operations:

  • AutoCompleteWordStorage#getOListAllCommandWord() — returns the observable list of command words stored

  • AutoCompleteWordStorage#getOListAllPrefixWord() — returns the observable list of prefix words stored

  • AutoCompleteWordStorage#getOListAllObjectWord() — returns the observable list of object words stored

  • AutoCompleteWordStorage#generateOListAllIndexWord(String objectName) — generate an observable list of index words corresponding to previous object word when called

The auto-complete panel will be set to object list when user first start the application.

Step 2: Whenever user types a key in the command line, CommandBox will notify AutoCompletePanelManager to perform changes based on userinput

This will update the number of matched words with the current list and 3 sets of algorithms will be run

  • AutoCompleteListHandler#chooseList()
    → Based on the number of matched words(pre-processed in the AutoCompletePanelManager)
    → List will be chosen from AutoCompleteStorage

  • AutoCompleteListHandler#filterList()
    → The chosen list will then be filter to only words that are compatible with previous correctly typed full words.
    → This is done by iterating through all the matched word and checking if AutoCompleteWord has a list of associated words
    → If the AutoCompleteWord has a list of associated words, this method will attempt to match the associated words with the matched words while filter out all incompatible words in the chosen list in the process
    (Eg: prefix list will be filtered to only be compatible with “pat-add” user command, the words that come before prefix.)

  • AutoCompleteListHandler#updateList()
    → Update the filtered list to fit the last partially typed word
    → The last partially typed word in CommandBox will be checked against the filtered list
    → If the word in the filter list does not start with the last partially typed word, it will be filtered out
    (Eg: User typed “pat-ad”. “add” and “add-medcon” which are both in the current list will be suggested since they both starts with "ad".)

The following sequence and activity diagrams illustrates the general flow when user input is detected

Up key pressed
Shift key pressed
Any other key pressed
ref generating list

Shown below is the sequence diagram for the guided system when selecting suggestion word

GuideSystemSequenceDiagram

Design Considerations

Aspect: Communication between UiPart s

(CommandBox, AutoCompletePanel and ResultDisplay)

  • Alternative 1: Pass references of each UiParts components around

    • Pros: Simpler to call methods as required, code will be easier to understand and implementation will take less effort

    • Cons: Code will be harder to track since any component with reference to the UiPart can manipulate its property

  • Alternative 2(current choice): Implement facades and observer patterns

    • Pros: Code is easier to maintain

    • Cons: Less readability

Logic Design Considerations

Aspect: Method to suggest auto-complete words
  • Alternative 1: Have several lists. First word list, Second word list, etc

    • Pros: Minimal effort in parsing of command line input.

    • Cons: Auto-complete panel will be unorganised. Eg: both index 1 and prefix may be suggested instead of just all index or all prefix suggested.

  • Alternative 2: Suggest full commands such as pat-edit 2 n/ t/ .. and omit any list

    • Pros: Easy to implement. No parsing required.

    • Cons: Auto-complete panel will be chunky as all commands are suggested at the same time. User will not be guided in selecting which command to choose.

  • Alternative 3(current choice): Have several lists. Object/Command/Index/Prefix lists.

    • Pros: User will be guided. Very user friendly. Panel will be more organised as words are suggested in sets of the same type.

    • Cons: Parsing of command line input can be tedious.

UI Design Considerations

Aspect: Location of autocomplete panel
  • Alternative 1: Place it as a floating window

    • Pros: User is able to resize and can be moved around easily

    • Cons: A floating window may block out some of the UI of the application, and user will have to re-place the autocomplete panel every time the application starts

  • Alternative 2(current choice): Fix it permanently at a pre-set location

    • Pros: Simpler and user will get use to the its location easier since it is pre-set

    • Cons: Less customisable for user