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.

This PPP may exceed the page limit as the URLs are not printed properly.

Summary of contributions

  • Major enhancement: added the ability to manage visits

    • What it does: allows the user to manage their visits to their patients. They can create their own "checklist" of things to do for each patient, record said data during a visit and view data from previous visits.

    • Justification: This feature has been identified as a required feature by user stories #5, #6 and #25 and will provide significant value-add by allowing users to manage visit data directly.

    • Highlights: This enhancement adds a new feature for the user. From a design perspective, it was challenging as there was a need to make the use cases and commands usable and efficient while keeping the workload manageable. The implementation too was challenging as it is a rather big feature involving changes to existing commands and the creation of new commands.

    • Credits: No code or ideas were referenced to outside of this application (beyond code that already exists within Address Book 3).

  • Code contributed: Code contributed can be found via references in the following issues: (v1.2: Issue #62, v1.3: Issue #53, Bug Hunting: Issue #182)

  • Other contributions:

    • Project management:

    • Enhancements to existing features:

      • Modified relative to absolute indexing for Person list, find and edit (Pull Request #69) which was required for this feature and some other features e.g. Appointment Management

      • Updated the GUI color scheme (See #77)

      • Added tabbing system to main window (See #77) which was required for multiple features e.g. Appointment Management

    • Documentation:

      • Setup initial User Guide to guide direction of project: (Pull Requests #36, #37)

    • Community:

      • Pull Requests reviewed with non-trivial review comments or reviewed to approve: #66, #67, #71, #72, #73, #87, #91, #105, #112, #112, #197,

      • Contributed to discussions (in Pull Request(s) #42 and offline/Telegram discussions)

      • Setup example Milestone issue format (#53)

    • Tools:

      • Helped in setting up team repo

      • Helped in integrating Travis

      • Integrated Netlify, Coveralls and Codacy to the team repo

The full list of PRs by me (which includes all the PRs for refactoring, updating documentation, impromptu bug fixes and more) can be found here, and the full list of issues by me can be found here. You can find my RepoSense Report here. Please note that the page count for this webpage is inaccurate as it displays all the URLs.

Contributions to the User Guide

Below are excerpts from sections I contributed to the User Guide (non-exhaustive to keep within the page limit). They showcase my ability to write documentation targeting end-users. For more examples you can refer to the Visit portion of the User Guide.

Visit Management

Visit Management

As a community nurse, you will often make home visits to your patients. When you are visiting a patient, there is often a todo list that you will have to do as well as information that you will have to record. This can now be done using the app. This section describes the features that will allow you to start a visit, keep track of your tasks during a visit, finish a visit and view information recorded during previous visits.

Starting a Visit visit-start

You can begin a visit by using visit-start. When you visit a patient and you want to record in the application that you are visiting said patient, you can use this feature to begin the visit for that patient (which will unlock the visit-now-update and visit-now-finish commands that will be applied to that visit). You can only have one ongoing visit at any point in time. This ongoing visit can be viewed in the "Current Visit" tab.

visit-start uses the patient’s Visit Todos to populate a checklist of Visit Tasks for you to use (these Visit Tasks are simply referred to as "tasks"). Visit Todos are described in further detail under Visit Tutorials / How-To Guide(s).

Format: visit-start PATIENT_INDEX

  • Begins a visit for the patient specified at PATIENT_INDEX.

  • The index refers to the index number shown in the list of patients displayed by pat-list or pat-find.

  • The index must be a positive integer 1, 2, 3, …​

  • There can only be one ongoing visit at any point in time; if there is already an ongoing visit this command does nothing.

  • This command does not bring up the "Current Visit" tab. You will have to manually click the tab.

  • You cannot delete the patient who you are currently visiting.

  • You can update the details of the patient you are currently visiting, but changes to his/her Visit Todos will not affect the ongoing visit’s Visit Tasks.

Examples:

  • visit-start 1
    Starts a visit for the 1st patient in the patient list.

…​

Visit Tutorials / How-To Guide(s)

What are Visit Todos (and Visit Tasks)?

Visit Todos are, as the name suggests, todo items. These are items that are attached to a patient and are todo items that you want to be reminded to do when you visit that patient. Each Visit Todo contains a description of that task.

When you begin a visit using visit-start, the patient’s Visit Todos are copied into the visit checklist as Visit Tasks. Each visit task has a description (of the visit todo it was copied from) which is a field for you to add details to that task, and a flag to indicate if that task is finished.

How to view the ongoing visit

The ongoing visit can be viewed by clicking on the current visit tab. Note that you will have to change tabs manually and your commands will not affect which tab you are viewing.

CurrentVisit

How to view the visit todos of a patient

You can view the visit todos of a patient using pat-list and pat-find. Visit Todos are displayed under their patient details. A visual representation can be seen below.

How to view visits of a patient (previous and ongoing)

You can view the visits of a patient using pat-list and pat-find. Visits are displayed under their patient details.

VisitTodoAndVisits

How to manage a visit (an example)

To introduce how to manage a visit, let’s use an example where you have a patient named John Heng. Assume that John is a new patient (his data is not in NurseTraverse) and you have the following list of things (visit todos) you want to do when you visit him:

  • Take Blood Pressure

  • Take Body Temperature

  • Restock Medicine

Adding a new patient with Visit Todos
If you are adding a new patient, you can add these visit todos using pat-add. Example: pat-add n/John Heng p/82221222 e/john@gmail.com a/John’s address t/Male vt/Take Blood Pressure vt/Take Body Temperature vt/Restock Medicine.

Editing the Visit Todos of a patient
Alternatively, if John is an existing patient in NurseTraverse you can update John’s list of Visit Todos using pat-edit. Let’s assume that John is the 2nd patient in pat-list, so you would use pat-edit 2 vt/Take Body Temperature vt/Restock Medicine.

Starting a Visit
Let’s assume that you decide to visit John’s house. When you are at John’s house during a house visit and you want to begin keeping track of your visit and recording visit details, you can use visit-start. In this scenario, John is the 2nd patient in pat-list, so you would use visit-start 2. Since you can only be visiting one patient at one time, you can only have one ongoing visit at any time; visit-start can only be performed if there is no ongoing visit.

Cancelling a Visit
If you realized you started the visit for a wrong person, you can cancel it using visit-cancel.

Updating a Visit’s details
Once you have begun a visit using visit-start, you can begin updating the visit’s details using visit-now-update. Let’s assume that you’ve finished all the tasks in the checklist during your visit with John, so an example would be visit-now-update f/1 f/2 f/3.

If you accidentally marked a task as finished, you can mark it as unfinished using uf/TASK_INDEX e.g. visit-now-update uf/1.

If you also want to add details to the tasks (e.g. record the blood pressure as task 1, body temperature as task 2) you can do so like this: visit-now-update d/1 140/90mmHg d/2 37.0.

You can also set the visit’s remarks. An example would be visit-now-update r/Remember to bring stretch band next session.

Finally, you can combine all of the above into one command: visit-now-update f/1 f/2 f/3 d/1 140/90mmHg d/2 37.0 r/Remember to bring stretch band next session.

Finishing a Visit
Finally, once you have concluded the visit, you can finish the visit using visit-end. This will tell the application that the ongoing visit has concluded. It will then save the visit under the patient (in this case, John).

Viewing previous Visits
You can view the visits of a patient using pat-list and pat-find. Visits are displayed under their patient details. In this case, it may be better to use pat-find to find John’s records e.g. pat-find John Heng.

Contributions to the Developer Guide

Below are sections I contributed to the Developer Guide (non-exhaustive to keep within the page limit). They showcase my ability to write technical documentation and the technical depth of my contributions to the project.

Visit Management has 3 sections to it: the model that models the visits, the logic that allows users to manipulate these models and the UI.

Model

How Visits, VisitTodos and VisitTasks are stored can be seen in [Design-Model] above. To support the feature of ongoing visits and the constraint that there can only be 1 ongoing visit at a time, a Pair<Integer, Integer> named pairOfOngoingPatAndVisitIndexes is stored in PatientBook. This serves multiple purposes:

  • To identify the Patient that is currently being visited and the Visit that is ongoing

  • To ensure that the state is saved even if the application shuts down during an ongoing visit

  • To ensure there is no duplication of data by storing only the indexes for reference

  • Although there is a reference to the Patient in the Visit class, this reference is only implied in the JSON file. To maximize efficiency such that the application does not have to search every patient to find an ongoing visit every time the application is opened, the Patient needs to be stored together with the Visit as a pair in PatientBook.

Model implements the following operations:

  • Model#setNewOngoingVisit(Visit visit) — Record a new ongoing Visit of person in the model. This Visit must be retrieved unmodified from a Patient, or an IllegalArgumentException will be thrown (so only use this to begin visits).

  • Model#updateOngoingVisit(Visit updatedVisit) — Update an ongoing Visit in the model. This will update the ongoing Visit and update the Visit in the Patient. Use this to update an ongoing Visit when there is already a Visit.

  • Model#unsetOngoingVisit() — Set the ongoing visit of person in the model and patient book to null (for cancelling or deleting visits).

  • Model#patientHasOngoingVisit(Person person) — Returns true if the person has an ongoing visit.

  • Model#getObservableOngoingVisitList() — Returns a ObservableList<Visit> containing the ongoing Visit if there is an ongoing Visit.

Model Design Considerations

Aspect: How to reflect changes in ongoing visit on UI
  • Alternative 1 (current choice): Use an ObservableList<Visit> returned from FXCollections.observableArrayList().

    • Pros: Easier to implement.

    • Cons: May not make logical sense as there will only be 0..1 ongoing Visit s at any point in time.

  • Alternative 2: Manually trigger an update every time the ongoing Visit is updated.

    • Pros: Makes logical sense as there will only be 0..1 ongoing Visit s at any point in time.

    • Cons: Complex, increased coupling between UI and Model. These lead to an increase of work (and potentially errors) for the developer.

UI

A Patient 's Visit s, VisitTodo are displayed together with his details on pat-list and pat-find in a TitledPane.

An ongoing Visit is displayed in another tab named "Current Visit" using OngoingVisitListPanel containing OngoingVisitCard which contains VisitTaskTableView. Likewise, pat-list and pat-find use FinishedVisitCard s each containing a VisitTaskTableView to display the Visit s and VisitTask s.

Changing of tabs on running the appropriate command

The application currently does not change tabs when an appropriate command is run (e.g. if you’re on the Patient tab and you run visit-now-update, it will stay on the Patient tab). This is actually by design as it allows users to multitask across tabs.

If in future iterations there is a need to change the tab on running an appropriate command, there are some considerations on how to implement the changing of tabs programmatically (e.g. when someone executes the command to begin a visit), which necessitates some additional coupling between Model and Ui. The proposed implementation may be to use the Observer pattern: Model would contain a subject that would notify its observers whenever a component (e.g. Patient or Visit) is listed/added/updated/deleted/etc, and Ui could observer this subject and update itself accordingly.

UI Design Considerations

Aspect: How to display the Patient 's Visit records (and his VisitTodo s)

  • Alternative 1 (current choice): Embed it with pat-list and pat-find.

    • Pros: Easier to implement, convenient for user (don’t have to call methods such as visit-view which will only show the visit)

    • Cons: May clutter screen.

  • Alternative 2: Implement functions such as visit-view etc.

    • Pros: A cleaner result page from pat-list and pat-find.

    • Cons: Increased developer work and user will have to use multiple commands to view the Patient 's Visit data.

Aspect: How to display the ongoing Visit

  • Alternative 1 (current choice): Put the PersonListPanel into a TabPane and put the OngoingVisitListPanel in the same TabPane

    • Pros: Neater.

    • Cons: No real cons apart from the fact that the user will have to click to change tabs.

  • Alternative 2: Open a new window to show the ongoing Visit.

    • Pros: Can be viewed side by side with the main application.

    • Cons: Increases clutter on user screen, increases complexity in handling scenario where user closes the window.

Use case

Visit Management is used when the user wants to visit a patient and record their visit. There are 4 actions that a user can perform:

VisitManagementUseCase

The possible workflow a user can take when these set of actions is depicted in the following diagram. Take note that the application will always start without an ongoing visit and this assumption is implied in the activity diagram. Also note that the terms "visit" and "ongoing visit" are interchangeable, as a user can only cancel, update or finish an ongoing visit.

VisitActivityDiagram

The most complex part of this use case is in when the user decides to update the ongoing visit. The sequence of events when updating an ongoing visit is detailed in this sequence diagram. Note that this sequence diagram is not exhaustive to help you understand without going into too much detail. (e.g. Exception handling is omitted and in-depth code is placed into ref fragments which are not included in this developer guide).

UpdateOngoingVisitSequenceDiagram