diff --git a/.classpath b/.classpath
new file mode 100644
index 000000000000..e1504452f97a
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.gitignore b/.gitignore
index 823d175eb670..7b3cf845f4d2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,9 +8,9 @@ lib/*
*.log
*.log.*
*.csv
-config.json
src/test/data/sandbox/
preferences.json
+/config.json
.DS_Store
./screenshot*.png
classes/
diff --git a/.project b/.project
new file mode 100644
index 000000000000..f151561e3e92
--- /dev/null
+++ b/.project
@@ -0,0 +1,23 @@
+
+
+ main
+ Project main created by Buildship.
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.buildship.core.gradleprojectbuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+ org.eclipse.buildship.core.gradleprojectnature
+
+
diff --git a/README.adoc b/README.adoc
index fa50028b99d0..77afec488b2c 100644
--- a/README.adoc
+++ b/README.adoc
@@ -1,10 +1,8 @@
-= Address Book (Level 4)
-ifdef::env-github,env-browser[:relfileprefix: docs/]
+= HealthHub
-https://travis-ci.org/se-edu/addressbook-level4[image:https://travis-ci.org/se-edu/addressbook-level4.svg?branch=master[Build Status]]
-https://ci.appveyor.com/project/damithc/addressbook-level4[image:https://ci.appveyor.com/api/projects/status/3boko2x2vr5cc3w2?svg=true[Build status]]
-https://coveralls.io/github/se-edu/addressbook-level4?branch=master[image:https://coveralls.io/repos/github/se-edu/addressbook-level4/badge.svg?branch=master[Coverage Status]]
-https://www.codacy.com/app/damith/addressbook-level4?utm_source=github.com&utm_medium=referral&utm_content=se-edu/addressbook-level4&utm_campaign=Badge_Grade[image:https://api.codacy.com/project/badge/Grade/fc0b7775cf7f4fdeaf08776f3d8e364a[Codacy Badge]]
+https://travis-ci.com/CS2103-AY1819S2-W09-2/main[image:https://travis-ci.com/CS2103-AY1819S2-W09-2/main.svg?branch=master[Build Status]]
+https://coveralls.io/github/CS2103-AY1819S2-W09-2/main?branch=master[image:https://coveralls.io/repos/github/CS2103-AY1819S2-W09-2/main/badge.svg?branch=master[Coverage Status]]
+image:https://api.codacy.com/project/badge/Grade/59b2e00f57cf432eab91667b827851b9[link="https://app.codacy.com/app/CS2103-AY1819S2-W09-2/main?utm_source=github.com&utm_medium=referral&utm_content=CS2103-AY1819S2-W09-2/main&utm_campaign=Badge_Grade_Dashboard"]
ifdef::env-github[]
image::docs/images/Ui.png[width="600"]
@@ -14,26 +12,46 @@ ifndef::env-github[]
image::images/Ui.png[width="600"]
endif::[]
-* This is a desktop Address Book application. It has a GUI but most of the user interactions happen using a CLI (Command Line Interface).
-* It is a Java sample application intended for students learning Software Engineering while using Java as the main programming language.
-* It is *written in OOP fashion*. It provides a *reasonably well-written* code example that is *significantly bigger* (around 6 KLoC)than what students usually write in beginner-level SE modules.
-* What's different from https://github.com/se-edu/addressbook-level3[level 3]:
-** A more sophisticated GUI that includes a list panel and an in-built Browser.
-** More test cases, including automated GUI testing.
-** Support for _Build Automation_ using Gradle and for _Continuous Integration_ using Travis CI.
+== Why HealthHub?
+
+“Based on trends, if we project into 2050, even with immigration, the population pyramid will be inverted ...
+We are going to be growing old faster than any society in the world.”
+ -Lee Hsien Loong, Prime Minister of Singapore
+
+With the number of elderly slated to reach 900,000 by 2030, it is no surprise that the resources to meet the healthcare
+demands of the nation are being stretched thin. Even today, it is getting harder and harder to have healthcare professionals
+come down to our homes to tend to the elderly, on top of their already burgeoning workload in their workplaces.
+
+Luckily, we now have HealthHub
+
+HealthHub is the first centralized healthcare platform on the market which allows for healthcare professionals (in the
+form of doctors and nurses) and qualified individuals from the community to tend to the needs of elderly at their own
+homes. With a dedicated core administrative team, HealthHub intends to match skilled individuals to their respective
+jobs efficiently and effectively.
+
+== Target Group
+
+HealthHub is looking at 2 large groups of target users.
+
+* The 1st group comprises qualified individuals with necessary skills, be it basic healthcare skills like administering
+IV drip, to higher-level skills like handling dialysis machinery.
+* The 2nd group comprises
+
+** The elderly needing help at home and
+
+** Guardians of the elderly requiring additional healthcare at home
== Site Map
-* <>
-* <>
-* <>
-* <>
-* <>
+* https://github.com/CS2103-AY1819S2-W09-2/main/blob/master/docs/UserGuide.adoc[User Guide]
+* https://github.com/CS2103-AY1819S2-W09-2/main/blob/master/docs/DeveloperGuide.adoc[Developer Guide]
+* http://github.com/CS2103-AY1819S2-W09-2/main/blob/master/docs/AboutUs.adoc[About Us]
+* https://github.com/CS2103-AY1819S2-W09-2/main/blob/master/docs/ContactUs.adoc[Contact Us]
== Acknowledgements
-* Some parts of this sample application were inspired by the excellent http://code.makery.ch/library/javafx-8-tutorial/[Java FX tutorial] by
-_Marco Jakob_.
+* Original Source Code created by SE-EDU initiative: https://github.com/se-edu/addressbook-level4[addressbook-level4]
+
* Libraries used: https://github.com/TestFX/TestFX[TextFX], https://github.com/FasterXML/jackson[Jackson], https://github.com/google/guava[Guava], https://github.com/junit-team/junit5[JUnit5]
== Licence : link:LICENSE[MIT]
diff --git a/_reposense/config.json b/_reposense/config.json
new file mode 100644
index 000000000000..9423d3c7811c
--- /dev/null
+++ b/_reposense/config.json
@@ -0,0 +1,30 @@
+{
+ "authors":
+ [
+ {
+ "githubId": "Lookuz",
+ "displayName": "CHO...YEH",
+ "authorNames": ["Lookuz"]
+ },
+ {
+ "githubId": "daviddl9",
+ "displayName": "D D...TON",
+ "authorNames": ["daviddl9", "David Livingston"]
+ },
+ {
+ "githubId": "jing1324",
+ "displayName": "JIN...ING",
+ "authorNames": ["jing1324"]
+ },
+ {
+ "githubId": "brohandev",
+ "displayName": "ROH...DEV",
+ "authorNames": ["brohandev", "LAPTOP-QAQAFI16\\Rohan Dev"]
+ },
+ {
+ "githubId": "huichun66",
+ "displayName": "TAY...HUN",
+ "authorNames": ["huichun66"]
+ }
+ ]
+}
diff --git a/build.gradle b/build.gradle
index 4f2949b6e774..ea21203dd3e0 100644
--- a/build.gradle
+++ b/build.gradle
@@ -77,7 +77,7 @@ dependencies {
}
shadowJar {
- archiveName = 'addressbook.jar'
+ archiveName = 'healthhub.jar'
destinationDir = file("${buildDir}/jar/")
}
@@ -235,3 +235,4 @@ deployOfflineDocs.dependsOn asciidoctor
processResources.dependsOn deployOfflineDocs
defaultTasks 'clean', 'headless', 'allTests', 'coverage', 'asciidoctor'
+apply plugin: 'java'
diff --git a/config.json b/config.json
new file mode 100644
index 000000000000..a0edc78a820a
--- /dev/null
+++ b/config.json
@@ -0,0 +1,4 @@
+{
+ "logLevel" : "INFO",
+ "userPrefsFilePath" : "preferences.json"
+}
diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
index a9671a144efd..253292d269ec 100644
--- a/config/checkstyle/checkstyle.xml
+++ b/config/checkstyle/checkstyle.xml
@@ -20,7 +20,6 @@
-
diff --git a/config/travis/check-trailing-whitespace.sh b/config/travis/check-trailing-whitespace.sh
index 33841caa81f1..513d72026429 100755
--- a/config/travis/check-trailing-whitespace.sh
+++ b/config/travis/check-trailing-whitespace.sh
@@ -14,11 +14,14 @@ awk '
# (e.g. GitHub web editor)
if ($1 ~ /\.md$/) {
severity = "WARN"
+ print severity, $1, $2, " trailing whitespace."
+ } else if ($1 ~ /\.svg$/) {
+ # do nth for .svg files under /resources/font-awesome/ folder.
} else {
severity = "ERROR"
ret = 1
+ print severity, $1, $2, " trailing whitespace."
}
- print severity, $1, $2, " trailing whitespace."
}
END {
exit ret
diff --git a/data/healthworkerbook.json b/data/healthworkerbook.json
new file mode 100644
index 000000000000..29aa3dd028bb
--- /dev/null
+++ b/data/healthworkerbook.json
@@ -0,0 +1,45 @@
+{
+ "healthWorkers" : [ {
+ "name" : "Andy Tan",
+ "phone" : "94358253",
+ "nric" : "S8312942G",
+ "organization" : "NUH",
+ "skills" : "GENERAL_PRACTICE PHYSIOTHERAPY "
+ }, {
+ "name" : "Betty Meier",
+ "phone" : "98761232",
+ "nric" : "S8176952L",
+ "organization" : "CGH",
+ "skills" : "GENERAL_PRACTICE ORTHOPAEDIC "
+ }, {
+ "name" : "Carlie Kurz",
+ "phone" : "95358463",
+ "nric" : "S9312942G",
+ "organization" : "NUH",
+ "skills" : "GYNAECOLOGY GENERAL_PRACTICE "
+ }, {
+ "name" : "Paniel Meier",
+ "phone" : "87652133",
+ "nric" : "S9701568T",
+ "organization" : "SGH",
+ "skills" : "HAEMATOLOGY PHYSIOTHERAPY "
+ }, {
+ "name" : "Ella Meyer",
+ "phone" : "94824524",
+ "nric" : "S9112942G",
+ "organization" : "SGH",
+ "skills" : "PHYSIOTHERAPY ANAESTHESIOLOGY "
+ }, {
+ "name" : "Fione Kunz",
+ "phone" : "94822373",
+ "nric" : "S7812942G",
+ "organization" : "TTSH",
+ "skills" : "OCCUPATIONAL_THERAPY CARDIOLOGY "
+ }, {
+ "name" : "George Best",
+ "phone" : "94824424",
+ "nric" : "S8812942G",
+ "organization" : "TTSH",
+ "skills" : "UROLOGY PAEDIATRIC "
+ } ]
+}
diff --git a/docs/AboutUs.adoc b/docs/AboutUs.adoc
index e647ed1e715a..5e2603836928 100644
--- a/docs/AboutUs.adoc
+++ b/docs/AboutUs.adoc
@@ -4,53 +4,53 @@
:imagesDir: images
:stylesDir: stylesheets
-AddressBook - Level 4 was developed by the https://se-edu.github.io/docs/Team.html[se-edu] team. +
-_{The dummy content given below serves as a placeholder to be used by future forks of the project.}_ +
-{empty} +
+HealthHub is developed with love and compassion by the https://github.com/CS2103-AY1819S2-W09-2[W9-02] team. +
+
We are a team based in the http://www.comp.nus.edu.sg[School of Computing, National University of Singapore].
== Project Team
-=== John Doe
-image::damithc.jpg[width="150", align="left"]
-{empty}[http://www.comp.nus.edu.sg/~damithch[homepage]] [https://github.com/damithc[github]] [<>]
+=== Rohan Dev
+image::brohandev.png[width="150", align="left"]
+{empty}[https://github.com/brohandev[github]] [<>]
-Role: Project Advisor
+Role: Software Developer +
+Responsibilities: Modifying the commands (Add/Edit/Delete/Find) for the Patient class.
'''
-=== John Roe
-image::lejolly.jpg[width="150", align="left"]
-{empty}[http://github.com/lejolly[github]] [<>]
+=== Choong Wey Yeh
+image::lookuz.png[width="150", align="left"]
+{empty}[http://github.com/Lookuz[github]] [<>]
-Role: Team Lead +
-Responsibilities: UI
+Role: Software Developer +
+Responsibilities: Modifying the commands (Add/Edit/Delete/Find) for the HealthWorker Class.
'''
-=== Johnny Doe
-image::yijinl.jpg[width="150", align="left"]
-{empty}[http://github.com/yijinl[github]] [<>]
+=== David Livingston
+image::daviddl9.png[width="150", align="left"]
+{empty}[https://github.com/daviddl9[github]] [<>]
-Role: Developer +
-Responsibilities: Data
+Role: Software Developer +
+Responsibilities: Modifying the commands (Add/Edit/Delete/Find) for the different type of requests.
'''
-=== Johnny Roe
-image::m133225.jpg[width="150", align="left"]
-{empty}[http://github.com/m133225[github]] [<>]
+=== Jin Jing
+image::jing1324.png[width="150", align="left"]
+{empty}[https://github.com/jing1324[github]] [<>]
-Role: Developer +
-Responsibilities: Dev Ops + Threading
+Role: Software Developer +
+Responsibilities: Managing the storage related classes and its associated dependencies.
'''
-=== Benson Meier
-image::yl_coder.jpg[width="150", align="left"]
-{empty}[http://github.com/yl-coder[github]] [<>]
+=== Tay Hui Chun
+image::huichun66.png[width="150", align="left"]
+{empty}[http://github.com/huichun66[github]] [<>]
-Role: Developer +
-Responsibilities: UI
+Role: User Interface Developer +
+Responsibilities: Responsible for the UI of the main app and its different interactions.
'''
diff --git a/docs/ContactUs.adoc b/docs/ContactUs.adoc
index 5de5363abffd..3f918d42432c 100644
--- a/docs/ContactUs.adoc
+++ b/docs/ContactUs.adoc
@@ -2,6 +2,7 @@
:site-section: ContactUs
:stylesDir: stylesheets
-* *Bug reports, Suggestions* : Post in our https://github.com/se-edu/addressbook-level4/issues[issue tracker] if you noticed bugs or have suggestions on how to improve.
-* *Contributing* : We welcome pull requests. Follow the process described https://github.com/oss-generic/process[here]
-* *Email us* : You can also reach us at `damith [at] comp.nus.edu.sg`
+* *Bug Reports, Suggestions* : Post in our http://github.com/CS2103-AY1819S2-W09-2/main/issues[issue tracker] if you noticed any bugs or
+have suggestions on how the app can be improved.
+* *Contributing* : We welcome pull requests. Follow the process described https://github.com/oss-generic/process[here].
+
diff --git a/docs/DeveloperGuide.adoc b/docs/DeveloperGuide.adoc
index 8b92d5fb7e62..d65aa9a15bc6 100644
--- a/docs/DeveloperGuide.adoc
+++ b/docs/DeveloperGuide.adoc
@@ -1,9 +1,10 @@
-= AddressBook Level 4 - Developer Guide
+= Health Hub - Developer Guide
:site-section: DeveloperGuide
:toc:
:toc-title:
:toc-placement: preamble
:sectnums:
+:icons: font
:imagesDir: images
:stylesDir: stylesheets
:xrefstyle: full
@@ -13,26 +14,42 @@ ifdef::env-github[]
:warning-caption: :warning:
:experimental:
endif::[]
-:repoURL: https://github.com/se-edu/addressbook-level4/tree/master
+:repoURL: https://github.com/CS2103-AY1819S2-W09-2/main/tree/master
-By: `Team SE-EDU` Since: `Jun 2016` Licence: `MIT`
+By: `Team W9-02 (HealthHub)` Since: `Jan 2019` Licence: `MIT`
== Setting up
=== Prerequisites
-. *JDK `9`* or later
+. *JDK `9`*
+* The Java Development Kit, or JDK for short, provides the necessary existing
+ libraries and implementations that we have used in our implementation of
+ HealthHub. The current version of HealthHub needs at least JDK version 9 to
+ support the full functionality it has to offer.
+
[WARNING]
JDK `10` on Windows will fail to run tests in <> due to a https://github.com/javafxports/openjdk-jfx/issues/66[JavaFX bug].
Windows developers are highly recommended to use JDK `9`.
. *IntelliJ* IDE
+* IntelliJ is an Integrated Development Environment(IDE) that provides the
+necessary tools and available plugins needed to compile, build and run the
+project.
+
[NOTE]
IntelliJ by default has Gradle and JavaFx plugins installed. +
Do not disable them. If you have disabled them, go to `File` > `Settings` > `Plugins` to re-enable them.
+[NOTE]
+====
+Don't have Intellij or JDK installed? Click on the following links to
+download them below:
+
+* IntelliJ: https://www.jetbrains.com/idea/
+
+* Java Development Kit: https://www.oracle.com/technetwork/java/javase/downloads/index.html
+====
=== Setting up the project in your computer
@@ -45,7 +62,7 @@ Do not disable them. If you have disabled them, go to `File` > `Settings` > `Plu
. Locate the `build.gradle` file and select it. Click `OK`
. Click `Open as Project`
. Click `OK` to accept the default settings
-. Open a console and run the command `gradlew processResources` (Mac/Linux: `./gradlew processResources`). It should finish with the `BUILD SUCCESSFUL` message. +
+. Open a console and run the command `gradlew processResources`. For Mac/Linux environments, run the command `./gradlew processResources` instead. It should finish with the [green]`BUILD SUCCESSFUL` message. +
This will generate all resources required by the application and tests.
. Open link:{repoURL}/src/main/java/seedu/address/ui/MainWindow.java[`MainWindow.java`] and check for any code errors
.. Due to an ongoing https://youtrack.jetbrains.com/issue/IDEA-189060[issue] with some of the newer versions of IntelliJ, code errors may be detected even if the project can be built and run successfully
@@ -72,36 +89,23 @@ This project follows https://github.com/oss-generic/process/blob/master/docs/Cod
Optionally, you can follow the <> document to configure Intellij to check style-compliance as you write code.
-==== Updating documentation to match your fork
-
-After forking the repo, the documentation will still have the SE-EDU branding and refer to the `se-edu/addressbook-level4` repo.
+==== Getting started
-If you plan to develop this fork as a separate product (i.e. instead of contributing to `se-edu/addressbook-level4`), you should do the following:
+When you have set up your environment successfully for building and running
+HealthHub, you are ready to get started on coding to contribute to the
+project. But before that, you may consider familiarising yourself with
+HealthHub through the following:
-. Configure the <> in link:{repoURL}/build.gradle[`build.gradle`], such as the `site-name`, to suit your own project.
+* Familiarising yourself with the model, logic and storage design of
+HealthHub under the section <>.
-. Replace the URL in the attribute `repoURL` in link:{repoURL}/docs/DeveloperGuide.adoc[`DeveloperGuide.adoc`] and link:{repoURL}/docs/UserGuide.adoc[`UserGuide.adoc`] with the URL of your fork.
+* Get a good feel of how existing features are implemented under the
+<> section.
-==== Setting up CI
+* Follow the way that the testing suite for features are built in
+<>
-Set up Travis to perform Continuous Integration (CI) for your fork. See <> to learn how to set it up.
-
-After setting up Travis, you can optionally set up coverage reporting for your team fork (see <>).
-
-[NOTE]
-Coverage reporting could be useful for a team repository that hosts the final version but it is not that useful for your personal fork.
-
-Optionally, you can set up AppVeyor as a second CI (see <>).
-
-[NOTE]
-Having both Travis and AppVeyor ensures your App works on both Unix-based platforms and Windows-based platforms (Travis is Unix-based and AppVeyor is Windows-based)
-
-==== Getting started with coding
-
-When you are ready to start coding,
-
-1. Get some sense of the overall design by reading <>.
-2. Take a look at <>.
+* Painlessly automate build integration by following the steps under <>
== Design
@@ -138,79 +142,81 @@ Each of the four components
* Defines its _API_ in an `interface` with the same name as the Component.
* Exposes its functionality using a `{Component Name}Manager` class.
-For example, the `Logic` component (see the class diagram given below) defines it's API in the `Logic.java` interface and exposes its functionality using the `LogicManager.java` class.
-
-.Class Diagram of the Logic Component
-image::LogicClassDiagram.png[width="800"]
[discrete]
==== How the architecture components interact with each other
The _Sequence Diagram_ below shows how the components interact with each other for the scenario where the user issues the command `delete 1`.
-.Component interactions for `delete 1` command
-image::SDforDeletePerson.png[width="800"]
+.Component interactions for `delete request 1` command
+image::logicseqdiagram.png[width="800"]
The sections below give more details of each component.
+// tag::ui-header[]
[[Design-Ui]]
=== UI component
.Structure of the UI Component
image::UiClassDiagram.png[width="800"]
-*API* : link:{repoURL}/src/main/java/seedu/address/ui/Ui.java[`Ui.java`]
+*API* : link:{repoURL}/src/main/java/seedu/address/ui[UI Package]
+
+The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `RequestListPanel`, `InfoPanel`, `HealthWorkerListPanel`, `StatusBarFooter`, etc.
-The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `StatusBarFooter`, `BrowserPanel` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class.
+All of these, including the `MainWindow`, inherit from the `UiPart` class, which is an abstract class containing methods for handling the loading of `FXML` files.
-The `UI` component uses JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the layout of the link:{repoURL}/src/main/java/seedu/address/ui/MainWindow.java[`MainWindow`] is specified in link:{repoURL}/src/main/resources/view/MainWindow.fxml[`MainWindow.fxml`]
+The `UI` component uses the JavaFX UI framework. The layout of these UI parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the layout of the link:{repoURL}/src/main/java/seedu/address/ui/MainWindow.java[`MainWindow`] is specified in link:{repoURL}/src/main/resources/view/MainWindow.fxml[`MainWindow.fxml`]
The `UI` component,
* Executes user commands using the `Logic` component.
-* Listens for changes to `Model` data so that the UI can be updated with the modified data.
+* Listens for changes to the `Model` data so that the UI can be updated with the modified data dynamically.
+// end::ui-header[]
+// tag::logic-header[]
[[Design-Logic]]
=== Logic component
[[fig-LogicClassDiagram]]
.Structure of the Logic Component
-image::LogicClassDiagram.png[width="800"]
+image::logicclassdiag.png[width="800"]
*API* :
link:{repoURL}/src/main/java/seedu/address/logic/Logic.java[`Logic.java`]
-. `Logic` uses the `AddressBookParser` class to parse the user command.
+. `Logic` uses the `HealthHubParser` class to parse the user command.
. This results in a `Command` object which is executed by the `LogicManager`.
-. The command execution can affect the `Model` (e.g. adding a person).
+. The command execution can affect the `Model` (e.g. adding a request) or sometimes only affecting the display (eg. listing all requests).
. The result of the command execution is encapsulated as a `CommandResult` object which is passed back to the `Ui`.
-. In addition, the `CommandResult` object can also instruct the `Ui` to perform certain actions, such as displaying help to the user.
-
-Given below is the Sequence Diagram for interactions within the `Logic` component for the `execute("delete 1")` API call.
+. In addition, the `CommandResult` object can also instruct the `Ui` to perform certain actions, such as printing out the result message in the command line.
-.Interactions Inside the Logic Component for the `delete 1` Command
-image::DeletePersonSdForLogic.png[width="800"]
+// end::logic-header[]
[[Design-Model]]
=== Model component
.Structure of the Model Component
-image::ModelClassDiagram.png[width="800"]
+image::modelUmlDiagram.png[width="800"]
*API* : link:{repoURL}/src/main/java/seedu/address/model/Model.java[`Model.java`]
The `Model`,
-* stores a `UserPref` object that represents the user's preferences.
-* stores the Address Book data.
-* exposes an unmodifiable `ObservableList` that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change.
-* does not depend on any of the other three components.
+* stores the `Request` Book data.
+* stores the `HealthWorker` Book data.
+* Both `HealthWorkerBook` and `RequestBook` stores multiple previous states
+in the form of `ReadOnlyHealthWorkerBook` and `ReadOnlyRequestBook`.
+* A `UserPrefs` object denoting the user settings for the application.
[NOTE]
-As a more OOP model, we can store a `Tag` list in `Address Book`, which `Person` can reference. This would allow `Address Book` to only require one `Tag` object per unique `Tag`, instead of each `Person` needing their own `Tag` object. An example of how such a model may look like is given below. +
- +
-image:ModelClassBetterOopDiagram.png[width="800"]
+As a more OOP model, we store a list of `Request` objects in `Request Book`, which stores the details of every request, including the patient's details, request date and status.
+In addition, each `Request` also stores a `Set` of `Conditions` of the patient. +
+Similarly for `HealthWorker`, the list of `HealthWorker` is stored in a
+`HealthWorkerBook`, and each `Specialisation` that the `HealthWorker` has is
+stored in a `Set` that is contained in the `Skills` class.
+// tag::storage[]
[[Design-Storage]]
=== Storage component
@@ -222,7 +228,13 @@ image::StorageClassDiagram.png[width="800"]
The `Storage` component,
* can save `UserPref` objects in json format and read it back.
-* can save the Address Book data in json format and read it back.
+* can save the Request, HealthWorker Book data in json format and read it back.
+
+[NOTE]
+The storage class converts the object data of `Request` and `HealthWorker` by converting the objects
+into a json object of strings which will be stored in the `.json` file. When reading the file, the json library passes the respective strings into
+their java object constructors to recreate the objects.
+// end::storage[]
[[Design-Commons]]
=== Common classes
@@ -233,95 +245,954 @@ Classes used by multiple components are in the `seedu.addressbook.commons` packa
This section describes some noteworthy details on how certain features are implemented.
+The `add`, `edit` and `delete` command have been tweaked to include addition of and `Request` and `HealthWorker`.
+
+`CommandMode` Enum class was introduced in v1.1 to allow for `add`, `edit`
+and `delete` different types of objects respective to the different
+`CommandMode` Enums. The various `CommandMode` enums are:
+** `CommandMode.HEALTHWORKER`
+** `CommandMode.REQUEST`
+** `CommandMode.OTHERS`
+** `CommandMode.INVALID`
+
+Each `CommandMode` enum is matched by it's own corresponding set of keywords,
+ which are string equivalents of the enum counterparts that the user can
+ input to specify the type of object he/she wishes to add. For example:
+
+* The command string `add healthworker n/Dog Terr` that is entered by the
+user contains the keyword `healthworker` after the `add` command word, which
+is mapped to it's `CommandMode` equivalent in `AddCommandParser`.
+
+The `CommandMode` enum also has a `Set healthWorkerModes = new HashSet<>(Arrays.asList("healthworker", "h", "1"));
+ private static final Set requestModes = new HashSet<>(Arrays.asList("request", "r", "2"));
+
+ /**
+ * Method that checks for the corresponding CommandMode given a string input.
+ * Returns INVALID if input string does not match any of the given modes.
+ */
+ public static CommandMode checkMode(String input) {
+ if (healthWorkerModes.contains(input)) {
+ return CommandMode.HEALTH_WORKER;
+ } else if (requestModes.contains(input)) {
+ return CommandMode.REQUEST;
+ }
+
+ return CommandMode.INVALID;
+ }
+}
+```
+
+These `CommandModes` provide flexbility and functionality to switch between
+ parsing of different `HealthWorker` and `Request` objects.
+
+* Each of the `add`, `edit` and `delete` command is eventually parsed through
+ the `AddCommandParser`, `EditCommandParser` and `DeleteCommandParser`
+ classes respectively, which returns an `AddCommand`, `EditCommand` and
+ `DeleteCommand` object respectively.
+
+=== Add feature
+
+The `add` command allows for users to register new `HealthWorker` and
+`Request` objects into HealthHub.
+
+The format for the `add` command is as follows:
+
+`add ...` +
+
+When the user inputs an `add` command, the `add` command is eventually passed
+ into an `AddCommandParser` object that handles the argument fields after the
+ `add` keyword in the command.
+
+The `AddCommandParser` first checks the first keyword in the string for a valid
+`CommandMode` string equivalent. if the keyword does not contains a valid
+string representation of any `CommandMode` enum, then a `ParseException` is
+thrown by the `AddCommandParser`. This initial sequence of steps is also
+repeated in the following `EditCommandParser` and `DeleteCommandParser` objects.
+
+After checking for valid keyword, the `AddCommandParser` object checks for
+the following compulsory information, along with regular expressions checking
+ for validity of each field:
+
+==== Adding a `HealthWorker`
+
+Format: `add healthworker/h/1 ...` +
+
+* `name` field prepended by the `n/` prefix. Valid inputs of `name` field
+will be represented and stored as a `Name` class object.
+** `name` field can only contain alphanumeric characters, and cannot be an
+empty string.
+* `phone` field prepended by the `p/` prefix. Valid inputs of `phone` field
+will be represented and stored as a `phone` class object.
+** `phone` contains only 8 numeric digits, of which the first must start with
+ a 6,8 or 9.
+* `nric` field prepended by the `i/` prefix. Valid inputs of `nric` field will
+be represented and stored as a `Nric` class object.
+** `nric` field must contains a 9 character string, starting with either a S
+or T, followed by 7 numeric digits and a alphabet letter. All letters used
+must be capitalized
+* `organization` field prepended by the `o/` prefix. Valid inputs of
+`organization` field will be represented and stored as a `Organization` class
+object.
+** The `organization` field must contain only alpha numeric characters, and
+contain at least 2 characters.
+* `specialisation` field prepended by the `s/` prefix. All valid
+`specialisation` fields will be parsed into it's respective `Specialisation`
+enum equivalent, collected and stored as a `Set` in the
+`Skills` class object.
+** The values in the `specialisation` field will be only be accepted if
+they correspond to specific mappings to an existing `Specialisation` enum that
+are registered in HealthHub. For information on the valid Specialisation
+mappings, visit
+
+`AddCommandParser` first checks for the presence of the prefixes for each of
+the compulsory fields mentioned above. If any of them are missing, or if any
+invalid fields as per the conditions mentioned above, then the
+command is invalid and a `ParseException` is thrown.
+
+If the keyword denoted maps to `CommandMode.HEALTHWORKER`, then
+`AddCommandParser` constructs a `HealthWorker` object representing the health worker that is
+just added with the respective `Name`, `Phone`, `Nric`, `Organization` and
+`Skills` objects parsed from the user input, and returns an `AddCommand`
+contain the constructed person to be added.
+
+[NOTE]
+====
+If multiple fields of the same prefix are added, the last value of the last
+field will be the one accepted for all fields except the `specialisation` field.
+====
+
+Upon a successful `add` command, the new `HealthWorker` or `Request`
+constructed from the user entered fields will be added to the end of the `UniqueHealthWorkerList`.
+
+===== Valid Specialisations
+
+The `Specialisation` field is an `Enum` type in Java, and supports only the
+enum fields that are specified in the `Specialisation` class itself.
+
+The various available specialisation enum values of the `Specialisation`
+class is as follows in the implementation of `Specialisation`:
+
+```
+public enum Specialisation {
+
+ GENERAL_PRACTICE,
+ CARDIOLOGY,
+ ENDOCRINOLOGY,
+ NEUROLOGY,
+ ORTHOPAEDIC,
+ PAEDIATRIC,
+ GYNAECOLOGY,
+ UROLOGY,
+ PATHOLOGY,
+ HAEMATOLOGY,
+ PHYSIOTHERAPY,
+ OCCUPATIONAL_THERAPY,
+ ANAESTHESIOLOGY;
+
+ ...
+}
+
+```
+
+=== Add Request feature
+
+==== Current Implementation
+The `add request` command allows the `LogicManager` to create a new request and add it to the list of requests. Adding a new request requires the
+patient's name, patient's phone number, patient's address, patient's NRIC number and the patient's conditions. The format of the add request command is
+add request n/NAME p/PHONE i/NRIC a/ADDRESS dt/DATETIME c/CONDITION.
+
+The following sequence shows the sequence when the add command is execute by the LogicManager:
+
+image::addrequest.png[width=800]
+Figure 3.2.1.1 Sequence Diagram for `add request` command
+
+From the diagram above:
+
+. `LogicManager`'s execute is called when the administrator keys in `add request` and it calls upon `parseCommand` of `HealthHubParser` to parse the command
+. `HealthHubParser` will initialize `AddCommandParser` and invoke the method `parse` to further parse `request` command
+. `parse` will be invoked and passed the parameters of the add command.
+. If all the arguments of the `add` commands are valid, `AddRequestCommand` will be returned to the `LogicManager`
+. `LogicManger` will then calls the method `execute` method of `AddRequestCommand`
+. `AddRequestCommand` will call `addRequest` passing `Request` as an argument to `Model` and after calls `commitRequestBook` method from `Model`
+. A `CommandResult` will be returned at the end.
+
+==== Design Consideration
+===== Aspect: Data Structure for the list of Requests
+* **Alternative 1 (Current Approach):** Using a `UniqueRequestList`
+** Pros: The comparison is not as rigid. You can create requests with similar names/phones as long as it passes a less stringent criteria.
+** Cons: You need additional overhead. You need to create an extra class and function to check.
+
+* **Alternative 2:** Using a `Set`
+** Pros: Do not need an extra function. You can use use `equals` for comparison
+** Cons: It is a strict check and as a result you will not be allowed to create requests with same phone/same name etc.
+
+===== Aspect: Data Structure of `Request`
+* **Alternative 1 (Current Approach):** All parameters in `Request` are abstracted out to have a class of its own (with the exception of the HealthWorker).
+** Pros: It adheres to the Single Responsibility Principles (SRP) and the Separation of Concerns (SoC) as each parameter checks whether it is valid
+** Cons: Many different classes are created which increases the complexity of the code
+
+* **Alternative 2:** Store all parameters of `Request` as `String`
+** Pros: Easy to implement.
+** Cons: Violates SRP as one single class will need to check if the arguments are valid.
+
+[NOTE]
+The `RequestStatus` class within the `Request` object utilises the Java `Enum` to ensure type safety in user inputs.
+
+The implementation of the `RequestStatus` class is as follows:
+
+```
+ private enum Status {
+ PENDING,
+ ONGOING,
+ COMPLETED
+ }
+
+ public RequestStatus(String status) {
+ this.requestState = Status.valueOf(status);
+ }
+
+ public RequestStatus() {
+ this(Status.PENDING.name());
+ }
+```
+
+Through this, any user String that is passed in as an argument for the `RequestStatus` field is automatically type checked,
+ensuring that there are no invalid request statuses entered.
+
+
+=== Edit feature
+
+The `edit` command allows users to modify details of existing `HealthWorker`
+or `Request` objects should the information need to be updated.
+
+The format for the `edit` command is as follows:
+
+`edit []...` +
+
+Similar to the `add` command, the `edit` command arguments are first checked
+passed into the `EditCommandParser` class instance, where it evaluates for a
+valid first keyword and argument prefixes and values. Additionally, the
+`` field is also checked against the existing list of `HealthWorker`
+or `Request` to ensure that the provided `` is a valid `` in
+the list.
+
+The argument field after the first keyword denoting the specified
+`CommandMode` must not be empty, and must contain at least one valid prefix
+and a valid value for the respective field to be edited. The prefixes and
+validity follows the same conditions as stated in the `add` command.
+
+[NOTE]
+=====
+Similar to the `add` command, only the last value will be accepted for fields
+ with the same prefixes.
+
+If any `specialisation` fields are entered, the current `Skills` object of
+the `HealthWorker` object being edited will be entirely replaced by a new
+`Set` of `Specialisation` that corresponds to valid `specialisation` fields
+enteed by the user.
+=====
+
+==== Editing `HealthWorker`
+
+Upon parsing the argument string into `EditCommandParser`, it first checks
+that the `` field provided is non-negative, and not greater than the
+size of the `UniqueHealthWorkerList`.
+
+After checking for a valid `CommandMode.HEALTHWORKER` keyword after the
+`edit` command word, `EditCommandParser` then tokenizes the argument string
+after the keyword into a `ArgumentMultiMap` object that stores the prefix to
+values mapping for each field specified. If no prefixes, or invalid prefixes
+are specified, or if invalid values for any prefix is input, then
+`EditCommandParser` throws a `ParseException`, and displays an error message
+to the terminal.
+
+If all values specified are valid and at least one field to specify is
+provided, the `EditCommandParser` parses the `ArgumentMultiMap` containing
+the values to be updated and it's respective prefixes into an
+`EditHealthWorkerDescriptor` object. `EditCommandParser` then passes the
+`EditHealthWorkerDescriptor` and the `HealthWorker` object fetched from the
+`HealthWorkerBook` using the specified valid `` into a
+`EditHealthWorkerCommand` object and returned.
+
+In the `EditHealthWorkerCommand`, each `HealthWorker` related field prefix is
+checked for it's value in `EditHealthWorkerDescriptor`, and if a value
+exists, it replaces the current value of the corresponding field in the
+`HealthWorker` object. Else, the field in `HealthWorker` is unchanged.
+
+Upon a successful `edit` command, the `HealthWorker` or `Request` object that
+ has had it's fields edited will immediately reflect the changes in details on
+ the GUI.
+
+=== Delete feature
+
+Using the `delete` command, the user can remove `HealthWorker` and `Request`
+objects from the system.
+
+The format for the `delete` command is as follows:
+
+`delete ` +
+
+The `delete` command takes in only two arguments after the `delete` command
+word: the `` corresponding to the respective `CommandMode` enum, as
+well as the `` of the `HealthWorker` or `Request` object to be
+deleted, as indicated in the `UniqueHealthWorkerList` or `UniqueRequestList`
+displayed in the GUI.
+
+The `` entered by the user is one-based, while it is converted to it's
+ zero-based format in HealthHub during the deletion process. This ensures
+ that non-technical people who use HealthHub do not need to adjust to
+ zero-based indexing, and can continue using one-based indexing which they
+ are more familiar with.
+
+If the user enters an invalid `` field, such as a negative index or an
+ index that is greater than the size of the `UniqueHealthWorkerList` or
+ `UniqueRequestList`, then a `ParseException` will be thrown, and an error
+ message will be displayed to the user.
+
+Upon successful `delete` of a valid `HealthWorker` or `Request`, the removed
+entity will be immediately reflected on the GUI, and be removed from view.
+
+
+// tag::assignrequest[]
+=== Assign Request feature
+
+The assign request feature allows an administrator to assign a request to a particular healthworker.
+
+==== Current Implementation
+
+The following sequence diagram shows the sequence flow from the `LogicManager` to the `ModelManager` when a user enters a `assign request` command:
+
+image::assignreq.png[]
+Figure 3.3.1.1 Sequence diagram to illustrate `Logic` component interactions for `assign request` command.
+
+image::assignReqToHw.png[]
+Figure 3.3.1.2 Sequence diagram to illustrate `Logic` and `Model` component interactions for [blue]`AssignRequestCommand`.
+
+image::addHwRequestDates.png[]
+Figure 3.3.1.3 Sequence diagram illustrates addition of the relevant `Date` objects into the `TreeSet` of the `healthWorker`.
+
+image::checkConflictingRequests.png[]
+Figure 3.3.1.4 Sequence diagram illustrates interaction between `AssignRequestCommand` and `healthWorkerAppointments`
+
+1. When `LogicManager` receives the `execute` command, it calls the `parseCommand` method in `RequestBookParser`.
+2. `RequestBookParser` will receive `assign` as the command and instantiate `AssignRequestCommandParser` to further parse the command.
+3. If the arguments specified in the `assign` command are invalid, a `AssignCommand` will be created and returned back to the `LogicManager`.
+4. `LogicManager` will proceed to call the `execute` command of `AssignCommand`
+5. `AssignRequestCommand` will proceed to call the `getFilteredRequestList` method of `Model`.
+6. Iterate through the `requestIds`, if valid, add the `request` corresponding to that `index` to the set of `Request`.
+7. Iterates through all the requests already assigned to that `healthWorker`. If there is a conflict of schedule (i.e Requests assigned
+to that healthWorker are less than 2 hours apart), a `CommandException` is thrown.
+8. Writes the updated request to the `RequestBook` in `ModelManager`, if all the request timings are valid.
+
+==== Design Consideration
+
+===== Aspect: Algorithm in ensuring no clashing requests assigned to healthworkers - Data Structure and implementation
+* Alternative 1 (current choice): Using a Balanced Binary Search Tree (java `TreeSet`) to keep track of the [blue]`RequestDate` of each request attended to by a particular `healthWorker`.
+** Reasoning: Since the allowed time interval between 2 consecutive requests should be at least 2 hours, we can take advantage
+of of this by only keeping track of the start time of requests. Hence we can utilise the `ceiling()`, `contains()` and `floor()` methods of the `TreeSet`, which runs effeciently in O(log N) time (where N is the number of requests). Here is the code snippet that implements this:
+```
+ // Note: healthWorkerAppointments is the TreeSet that stores the appointment dates
+ Date date = request.getRequestDate().getDate();
+ calendar.setTime(date);
+ calendar.add(Calendar.HOUR_OF_DAY, -MIN_REQUEST_DURATION); // MIN_REQUEST_DURATION = 2 hours
+ Date lowerLimit = calendar.getTime();
+ calendar.add(Calendar.HOUR_OF_DAY, 2 * MIN_REQUEST_DURATION);
+ Date upperLimit = calendar.getTime();
+
+ if (healthWorkerAppointments.contains(date) || (healthWorkerAppointments.lower(date) != null
+ && healthWorkerAppointments.lower(date).after(lowerLimit))
+ || (healthWorkerAppointments.higher(date) != null
+ && healthWorkerAppointments.ceiling(date).before(upperLimit))) {
+ throw new CommandException(Messages.MESSAGE_HEALTHWORKER_OCCUPIED_CANNOT_ASSIGN);
+ }
+
+ healthWorkerAppointments.add(date);
+```
+
+image::assignRegionCheck.png[]
+Figure 3.3.1.5 Shows visualisation of time ranges that are valid.
+
+The above mentioned code snippet checks that there are not clashing requests that fall within the red region, as depicted in Figure 3.3.1.5.
+
+* Alternative 2: For each request to be assigned, manually iterate through the Request list to ensure that there are not clashing dates.
+Pros: Easy to implement
+Cons: Slow - in the worst case, if all the requests get assigned at once, this operation will run in O(n^2) time.
+
+===== Aspect: Relationship between [blue]`Request` and [blue]`Healthworker`
+* Alternative 1 (current choice): The [blue]`Request` holds a unique identifier of the [blue]`HealthWorker` (i.e the `NRIC`) assigned to it.
+** Pros: Simplification of implementation.
+** Pros: Cleaner implementation, low level of dependencies on other modules. This also makes it easier to test, and easier to maintain.
+** Cons: Makes it difficult to obtain all details of the `healthWorker` assigned from a [blue]`Request` object. The healthworker with the unique NRIC will have the be queried from the `healthWorkerList`
+
+* Alternative 2: The `Request` holds a `HealthWorker` object and the `HealthWorker` keeps track of a list of `Request`s.
+** Pros: Can quickly access details of a `HealthWorker` from a `Request`, and can quickly access the `Requests` assigned to a `HealthWorker` from the `Request`.
+** Cons: Increases complexity of code base, adding additional dependencies to the code. This makes the code base more verbose and more difficult to maintain.
+
+// end::assignrequest[]
+=== List Feature
+The `list` command allows the user to be able to display all `HealthWorker`
+or `Request` objects stored in the current application.
+
+==== Listing `HealthWorker` objects
+* Format: `list healthworker/h/1`
+* Displays all `HealthWorker` objects already stored in the current
+application, and the following details:
+** `name` - Name of the `HealthWorker`
+** `nric` - NRIC of the `HealthWorker`
+** `organization` - Organization of the `HealthWorker`
+** `skills` - Skills and Specialisations that the `HealthWorker` object
+possesses
+
+==== Listing `Request` objects
+* Format: `list request/r/2`
+* Displays all `Request` objects already stored in the current
+application, and the following details:
+** `name` - Name of the patient that made the request in `Request` object.
+** `address` - Address of the patient
+** `condition` - Condition of the patient that made the request.
+
+=== Filter Feature
+
+With the filter command, users can provide specific parameters that act as
+conditions for HealthHub to filter the `UniqueHealthWorkerList` and
+`UniqueRequestList` by. Using these parameters, HealthHub displays only the
+`HealthWorker` or `Request` whose fields contains the specified parameters.
+
+Command Format: `filter / [/]
+...`
+
+[NOTE]
+====
+The `` and `` specified in the command descriptions
+below follow the same valid prefix and parameter formats as the `add`, `edit`
+ and `delete` commands
+====
+
+==== Filtering `HealthWorker`
+
+The command format for filtering `HealthWorker` is:
+
+`filter healthworker/h/1 / [/]...`
+
+The fields in `HealthWorker` that the user can filter by are:
+
+* `name` prepended by `n/` prefix
+* `organisation` prepended by the `o/` prefix
+* `specialisation` prepend by the `s/` prefix
+
+[NOTE]
+====
+If multiple `specialisation` fields are provided, HealthHub will filter the
+`UniqueHealthWorkerList` by displaying `HealthWorker` that contains both
+specified `specialisations
+====
+
+HealthHub filters the respective list of `HealthWorker` and `Request` by
+checking if the corresponding field contains the specified parameter as a
+substring. +
+For example entering the command `filter h n/John` displays a list of
+`HealthWorker` whose name equals to John, or contains John as a substring(E.g
+ Johnny, Johnson).
+
+// tag::filterHealthWorker[]
+==== Filtering `HealthWorker`
+
+The `filter` command allows users to display only `HealthWorker` or `Request`
+ whose fields matches the `` specified in the filter command.
+
+Format: `filter healthworker/h/1 / []
+...`
+
+* The `filter` command checks for `HealthWorker` whose field specific to the
+`` contains or matches the `` provided.
+* Example: `filter h n/John` changes the UI to display only `HealthWorker`
+whose name is John, or contains John (Johnny, Johnson, ...)
+
+Upon entering the `filter` command, the `filter` command word is stripped from the
+ input and the argument fields are passed into the `FilterCommandParser` class.
+The regular expressions for checking the fields for `name`, `organisation`
+and `skills` follows the same format as mentioned in `add` command. If
+invalid parameters are specified by the user, or if an invalid `keyword` was
+specified that does not correspond to any `CommandMode` enum, then
+`FilterCommandParser` throws a `ParseException` and displays an error message
+ to the user.
+
+If valid inputs are provided, `FilterCommandParser` tokenizes the argument
+string without the `keyword` using `ArgumentTokenizer` object, mapping each
+parameter to it's respective prefix in an `ArgumentMultiMap` object.
+`FilterCommandParser` then creates a `Predicate` object using the parameter
+values in `ArgumentMultiMap` for each filter condition, and composes them
+into a single `Predicate` using the `and` function in `Predicate` in
+conjuction with `stream` and `reduce` methods from Java's `Function` library.
+ The `Predicate` object composed is then passed into
+ `FilterHealthWorkerCommand`, which sets the predicate for the `HealthWorker`
+ list in the GUI to display only `HealthWorker` whose fields matches the
+ `Predicate` set.
+
+===== Design Considerations
+
+During the implementation of the `filter` command, we decide between two
+alternative implementations of managing the `Predicates` created from
+multiple criteria input by the user.
+
+The following table states the considerations for performance as well as
+future implementations and enhancements to HealthHub that were taken into
+account:
+
+// tag::filterHealthWorkerTable[]
+[width="100%",cols="1, 5, 5",options="header"]
+|=======================================================================
+| Design
+| Using a `List` of `Predicate`
+| Composed `Predicate` using `and` method
+
+| How it works
+| Each user input condition will be parsed into `Predicate`,
+which are stored in an `List`.
+*Pros*: Easier to manage each single `Predicate` as they are kept separate
+*Cons*: Need to rework existing GUI implementation for `filter` as it only
+uses a single `Predicate` Object
+| Each user input will be parsed into a `Predicate` object, and all the
+`Predicate` formed will be composed into a single `Predicate` object.
+*Pros*: Ease of existing and future implementations as functionality only
+depends on `Predicate`
+*Cons*: Unable to specify actions for each `Predicate`
+
+| Implementation
+| User inputs are first parsed into `Predicate` equivalents,
+and then added to an `ArrayList`. `FilterCommandParser` then takes the
+existing `UniqueHealthWorkerList`, checks for `HealthWorker` whose fields
+matches the list of `Predicate` using `allMatch` method from the `Predicate`
+library, and then returns an `ObservableList` containing those `HealthWorker`.
+| User inputs are parsed into `Predicate` equivalents, which are then composed
+into a single `Predicate` containing the logic of all the composed
+`Predicates` using the `and` method from `Predicate` library. The composed
+`Predicate` is then set as the filter condition into the existing
+`ObservableList` of `HealthWorker` in the UI component.
+
+|=======================================================================
+// end::filterHealthWorkerTable[]
+
+Ultimately, the decision was made to implement the `filter` command by
+composing the `Predicate` that were formed from the user inputs into a single
+ `Predicate` using a combination of Java's `Function` library methods
+ `stream` and `reduce`, as well as the `and` method used in Java's
+ `Predicate` library. +
+This is because maintain a `List` of `Predicate` in HealthHub requires an
+unnecessary rework of many existing components in HealthHub in order to fit
+the new implementation of using a `List`, such as replacing `Predicate` in
+methods involved with `List`.
+
+In addition, by returning a single `Predicate` object, ease of implementation
+ of methods in `filter` command, as well as any future or existing
+ enhancements to `filter` reduces the complexity of code as the function
+ needs only to depend on `Predicate` and not `List`, hence observing the Law
+ of Demeter.
+
+===== Current Implementation
+
+The following sequence diagram shows the flow of events when the `filter h
+s/physio` command is entered by the user to display only `HealthWorker`
+objects that possess expertise in physiotherapy:
+
+image::FilterHealthWorkerSD.png[width=800]
+Figure 3.6.1.1: Sequence diagram illustrating the interactions between the
+`Logic` and `Model` components when `filter` command is called.
+
+. When the user inputs the full command `filter h s/physio`, the
+`LogicManager` object takes in the command string, and passes it into
+`HealthHubParser` using the `parseCommand` method.
+. `HealthHubParser` identifies the command word in the input string, which is
+ `filter`, and identifies the appropriate `CommandParser` object to parse the
+ user command.
+. `HealthHubParser` strips the `filter` command word off the user input, and
+passes the remaining argument string in to a new `FilterCommandParser` object
+ as corresponding to the `filter` command word.
+. `FilterCommandParser` then checks for a valid `CommandMode` that
+corresponds to the first keyword in the argument string. In this case, the
+keyword `h` corresponds to the `CommandMode.HEALTHWORKER` value.
+`FilterCommandParser` then creates a `FilterHealthWorkerCommand` with the
+`Predicate` constructed from the fields remaining in the argument string. For
+ full detail on the implementation of the `FilterCommandParser` logic, see
+ the sequence diagram in figure 3.6.1.2 below.
+. `FilterCommandParser` returns the `FilterHealthWorkerCommand` object to
+`HealthHubParser`, which calls the `execute` method of
+`FilterHealthWorkerCommand`.
+. `FilterHealthWorkerCommand` uses Java 8's `Predicate` and `Function`
+libraries to condense all the supplied `List` into a single
+`Predicate` using the `and`, `reduce` and `stream` method calls. After which,
+ it calls the `updateFilteredHealthWorker` method in `Model` to set the
+ condensed `Predicate` on the `UniqueHealthWorkerBook` in `Model`, displaying
+ only the `HealthWorker` that evaluates the set `Predicate` to true on the GUI.
+
+
+image::FilterCommandParserLogicSD.png[width=800]
+Figure 3.6.1.2 Sequence Diagram that details the interaction that happens
+within the `FilterCommandParser` class when it's `parse()` method is called.
+
+// end::filterHealthWorker[]
+
// tag::undoredo[]
=== Undo/Redo feature
+
==== Current Implementation
-The undo/redo mechanism is facilitated by `VersionedAddressBook`.
-It extends `AddressBook` with an undo/redo history, stored internally as an `addressBookStateList` and `currentStatePointer`.
+The undo/redo mechanism is facilitated by `VersionedBook`.
+There are two extensions of it. `VersionedHealthWorkerBook` extends `HealthWorkerBook` and `VersionedRequestBook` extends `RequestBook`.
+Both contain an undo/redo history, stored internally as an `healthWorkerBookStateList` or `requestBookStateList`
+ and `currentStatePointer`.
Additionally, it implements the following operations:
-* `VersionedAddressBook#commit()` -- Saves the current address book state in its history.
-* `VersionedAddressBook#undo()` -- Restores the previous address book state from its history.
-* `VersionedAddressBook#redo()` -- Restores a previously undone address book state from its history.
+* `VersionedBook#commit()` -- Saves the current request/healthworker book state in its history.
+* `VersionedBook#undo()` -- Restores the previous request/healthworker book state from its history.
+* `VersionedBook#redo()` -- Restores a previously undone request/healthworker book state from its history.
+
+These operations are exposed in the `Model` interface as `Model#commit()`, `Model#undo()`
+and `Model#redo()` respectively.
+
+
+The feature also makes use `ModifyCommandHistory` to keep track of the commands that modified the books. It contains
+`currentStatePointer` and a list of `CommandType` enums to differenciate the type of command to undo or redo.
+Similar to `CommandMode`, the various `CommandType` enums are:
+
+** `CommandType.HEALTHWORKER_COMMAND`
+** `CommandType.REQUEST_COMMAND`
+** `CommandType.HEALTHWORKER_AND_REQUEST_COMMAND`
-These operations are exposed in the `Model` interface as `Model#commitAddressBook()`, `Model#undoAddressBook()` and `Model#redoAddressBook()` respectively.
Given below is an example usage scenario and how the undo/redo mechanism behaves at each step.
-Step 1. The user launches the application for the first time. The `VersionedAddressBook` will be initialized with the initial address book state, and the `currentStatePointer` pointing to that single address book state.
+Step 1. The user launches the application for the first time. The `VersionedRequestBook` and `VersionedHealthWorkerBook` will be initialized with the initial state,
+ and the `currentStatePointer` for each `VersionedBook` pointing to that single book state.
+Since no modify command has been called, the initial list of commands in `ModifyCommandHistory` is empty and the initial `currentStatePointer` of `ModifyCommandHistory` is initialized to -1.
+
+image::initrb.png[width="800"]
+image::inithb.png[width="800"]
-image::UndoRedoStartingStateListDiagram.png[width="800"]
-Step 2. The user executes `delete 5` command to delete the 5th person in the address book. The `delete` command calls `Model#commitAddressBook()`, causing the modified state of the address book after the `delete 5` command executes to be saved in the `addressBookStateList`, and the `currentStatePointer` is shifted to the newly inserted address book state.
+Step 2. The user executes `delete r 5` command to delete the 5th request in request book. The `delete r` command calls `Model#commit(REQUEST_COMMAND)`, causing the modified state of the request book after the `delete r 5` command executes to be saved in the `requestBookStateList`, and the `currentStatePointer` is shifted to the newly inserted request book state.
+Since the request book is modified, the enum `REQUEST_COMMAND` is added to the `modifyCommandHistory` list within the `ModifyCommandHistory` class and the `currentStatePointer` is now pointing at the most recent command.
+The `VersionedHealthWorkerBook` is unaffected.
-image::UndoRedoNewCommand1StateListDiagram.png[width="800"]
+image::rbafterdelete.png[width="800"]
+image::mchafterdelete.png[width="800"]
-Step 3. The user executes `add n/David ...` to add a new person. The `add` command also calls `Model#commitAddressBook()`, causing another modified address book state to be saved into the `addressBookStateList`.
+Step 3. The user executes `add h n/David ...` to add a new healthworker. The `add h` command also calls `Model#commit(HEALTHWORKER_COMMAND)`, causing a modified health worker book state to be saved into the `healthWorkerBookStateList` and the `currentStatePointer` is shifted to the new health worker book state.
+The enum `HEALTHWORKER_COMMAND` is added into the `modifyCommandHistory` list of the `ModifyCommandHistory` class.
+The `VersionedRequestBook` is unaffected.
-image::UndoRedoNewCommand2StateListDiagram.png[width="800"]
+image::hbafteradd.png[width="800"]
+image::mchafteradd.png[width="800"]
[NOTE]
-If a command fails its execution, it will not call `Model#commitAddressBook()`, so the address book state will not be saved into the `addressBookStateList`.
+If a command fails its execution, it will not call `Model#commit()`, so the book state will not be saved into the `healthWorkerBookStateList` or `requestBookStateList`.
-Step 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing the `undo` command. The `undo` command will call `Model#undoAddressBook()`, which will shift the `currentStatePointer` once to the left, pointing it to the previous address book state, and restores the address book to that state.
+Step 4. The user now decides that adding the health worker was a mistake, and decides to undo that action by executing the `undo` command.
+The `undo` command will call `Model#undo()`, which will first obtain the type of command that needs to be undone by caling `ModifyCommandHistory#getUndoCommand()`. In this case `HEALTHWORKER_COMMAND` is returned, and hence will call undo on `VersionedHealthWorkerBook`. It will shift the `currentStatePointer` once to the left, pointing it to the previous health worker book state, and restores the health worker book to that state.
+The `currentStatePointer` of the `ModifyCommandHistory` also gets shifted once to the left, pointing it to the previous command.
-image::UndoRedoExecuteUndoStateListDiagram.png[width="800"]
+image::hbafterundo.png[width="800"]
+image::mchafterundo.png[width="800"]
[NOTE]
-If the `currentStatePointer` is at index 0, pointing to the initial address book state, then there are no previous address book states to restore. The `undo` command uses `Model#canUndoAddressBook()` to check if this is the case. If so, it will return an error to the user rather than attempting to perform the undo.
+If the `currentStatePointer` of both `VersionedHealthWorkerBook` and `VersionedRequestBook` is at index 0, pointing to the initial book state for both books, then there are no previous states to restore. The `undo` command uses `Model#canUndo()` to check if this is the case. If so, it will return an error to the user rather than attempting to perform the undo.
+
+[NOTE]
+As of version 1.4, the only command that has modifies both the health worker book and the request book is `EditHealthWorkerCommand`.
+It is the only command that has `CommandType.HEALTHWORKER_AND_REQUEST_COMMAND`.
+
+
+
+The user first enters the `undo` command in the command line interface. The logic manager processes the command as a string
+and checks using the `AddressBookParser` is the string is a valid command. In this case, the parser sees that the command string
+matches the `undo` command string and hence returns an `undo` command to the `LogicManager` which then calls `execute()` to execute the command.
+The `execute()` method calls `Model#undo()` in which the model checks the `ModifyCommandHistory` for the correct `VersionedBook` that needs to be undone
+and then calls `VersionedBook#undo()`. Upon a successful undo, the `UndoCommand` will return a successful result to the `LogicManager`
+which will then the "Undo Success!" message will be displayed on the command line interface.
The following sequence diagram shows how the undo operation works:
-image::UndoRedoSequenceDiagram.png[width="800"]
+image::UndoRedoSeqDiagram.png[width="800"]
-The `redo` command does the opposite -- it calls `Model#redoAddressBook()`, which shifts the `currentStatePointer` once to the right, pointing to the previously undone state, and restores the address book to that state.
+The `redo` command does the opposite -- it calls `Model#redo()`, which first obtains the command type by calling `ModifyCommandHistory#getRedoCommand()` and based on the returned command type it shifts the `currentStatePointer` once to the right, pointing to the previously undone state, and restores the respective book to that state.
[NOTE]
-If the `currentStatePointer` is at index `addressBookStateList.size() - 1`, pointing to the latest address book state, then there are no undone address book states to restore. The `redo` command uses `Model#canRedoAddressBook()` to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo.
+If the `currentStatePointer` of both `VersionedBook` s are pointing to the latest state, then there are no undone book states to restore. The `redo` command uses `Model#canRedo()` to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo.
-Step 5. The user then decides to execute the command `list`. Commands that do not modify the address book, such as `list`, will usually not call `Model#commitAddressBook()`, `Model#undoAddressBook()` or `Model#redoAddressBook()`. Thus, the `addressBookStateList` remains unchanged.
+Step 5. The user then decides to execute the command `list r`. Commands that do not modify the books, such as `list r`,
+will not call `Model#commit()`, `Model#undo()` or `Model#redo()`. Thus, the `VersionedBook` s and `ModyfiCommandHistory` do not change.
-image::UndoRedoNewCommand3StateListDiagram.png[width="800"]
+image::rbafterlist.png[width="800"]
-Step 6. The user executes `clear`, which calls `Model#commitAddressBook()`. Since the `currentStatePointer` is not pointing at the end of the `addressBookStateList`, all address book states after the `currentStatePointer` will be purged. We designed it this way because it no longer makes sense to redo the `add n/David ...` command. This is the behavior that most modern desktop applications follow.
+Step 6. The user executes `delete h 1`, which calls `Model#commit(HEALTHWORKER_COMMAND)`. Since the `currentStatePointer` is not pointing at the end of the `healthWorkerBookStateList`, all health worker book states after the `currentStatePointer` will be purged.
+We designed it this way because it no longer makes sense to redo the `add n/David ...` command. This is the behavior that most modern desktop applications follow.
-image::UndoRedoNewCommand4StateListDiagram.png[width="800"]
+image::hbafterdel.png[width="800"]
+image::mchafteroverride.png[width="800"]
The following activity diagram summarizes what happens when a user executes a new command:
-image::UndoRedoActivityDiagram.png[width="650"]
+image::UndoRedoActDiagram.png[width="650"]
==== Design Considerations
+
===== Aspect: How undo & redo executes
+[width="100%",cols="1, 5, 5",options="header"]
+|=======================================================================
+|Implementation |Saves the entire book (Current implementation) | Individual command knows how to undo/redo by itself.
+|Pros| Less prone to bugs since the we are switching between different versions of the books. | Will use less memory (e.g. for `delete`, just save the person being deleted).
+|Cons| May have performance issues in terms of memory usage especially for
+large numbers of health workers and requests.| Every command will have their own implementation of undo and some of them are slow hence it causes performance issues.
+(e.g. for `clr`, all requests that were deleted have to be added back into the list, which will be quite slow if
+there is a large number of requests).|
+|=======================================================================
-* **Alternative 1 (current choice):** Saves the entire address book.
-** Pros: Easy to implement.
-** Cons: May have performance issues in terms of memory usage.
-* **Alternative 2:** Individual command knows how to undo/redo by itself.
-** Pros: Will use less memory (e.g. for `delete`, just save the person being deleted).
-** Cons: We must ensure that the implementation of each individual command are correct.
===== Aspect: Data structure to support the undo/redo commands
+[width="100%",cols="1, 5, 5",options="header"]
+|=======================================================================
+|Implementation | Use a list to store the history of book states.(Current implementation) | Use `HistoryManager` for undo/redo
+|Pros| Undo and redo commands runs faster since it only involves the switching of the state pointer.| Supports multiple books with the `HistoryManager` alone since we are undoing from the command history.
+|Cons| Need multiple `VersionedBook` s. One or each type of book.| `HistoryManager` keeps a record of all commands, even if they are invalid or commands that does not call `Model#commit()`.
+Traversing these irrelevant commands to find the next undoable command will take a long time especially if size of history is large.|
+|=======================================================================
+
+===== Aspect: Data structure to handle multiple `VersionedBooks`
+[width="100%",cols="1, 5, 5",options="header"]
+|=======================================================================
+|Implementation | Use a command history to keep track
+of the type of book that was modified It is represented as a list of `CommandType`.(Current implementation) | Use a list of pairs. Each state is represented as a pair which stores the `currentStatePointer` of each book.
+|Pros| Easily scalable to include more than two books. As the developer can simply add an extra `CommandType`
+and extra cases for switch statements.| Supports commands that change multiple books at once since it keeps track of all states.
+|Cons| Unable to scale as well if there are many commands that modifies multiple books at once.| Keeping multiple integers takes up more memory as compared to keeping a single enum.
+|=======================================================================
-* **Alternative 1 (current choice):** Use a list to store the history of address book states.
-** Pros: Easy for new Computer Science student undergraduates to understand, who are likely to be the new incoming developers of our project.
-** Cons: Logic is duplicated twice. For example, when a new command is executed, we must remember to update both `HistoryManager` and `VersionedAddressBook`.
-* **Alternative 2:** Use `HistoryManager` for undo/redo
-** Pros: We do not need to maintain a separate list, and just reuse what is already in the codebase.
-** Cons: Requires dealing with commands that have already been undone: We must remember to skip these commands. Violates Single Responsibility Principle and Separation of Concerns as `HistoryManager` now needs to do two different things.
// end::undoredo[]
-// tag::dataencryption[]
-=== [Proposed] Data Encryption
+// tag::setreminder[]
+=== Set Reminder Feature
+
+The `setreminder` command gives the user an option to set a reminder with a customised message.
+The reminder is in the form of an `AlertDialog` and is scheduled to display on the UI by a `TimerTask` at time
+`t + current time`, where `t` is time in the format `hh:mm:ss`. +
+
+==== Current Implementation
+
+The following sequence diagram shows the sequence flow from when the `SetReminderCommandParser` receives the command and
+parses it into a `SetReminderCommand` object.
+
+image::SetReminderSequenceDiagram.png[width="800"]
+Figure 3.9.1 shows the sequence diagram for the different method invocation calls between the classes
+
+1. When `SetReminderCommandParser` receives the `parse` command, it calls the static method `ArgumentTokenizer.tokenize` to extract the arguments from the user input string.
+
+2. The `extractArguments` constructs and returns an `ArgumentMultimap` based on the arguments passed in.
+
+3. `SetReminderCommandParser` checks if there are arguments specified under prefixes `PREFIX_TIME` and `PREFIX_MESSAGE`.
+
+4. If it cannot find those arguments, it throws a `ParseException` to the calling program.
+
+5. If arguments are available, it calls the `getValue` method of `ArgumentMultimap` to return the values
+
+6. After getting the values, the `SetReminderCommandParser` checks for the validity of the values and if true, calls the constructor of `SetReminderCommand`
+// end::setreminder[]
+
+// tag::statistics[]
+=== Statistics Feature
+
+The statistics mechanism is facilitated by Statistics class, which is a public Java class containing a private static
+TreeMap data structure and a private static LinkedHashMap data structure. The TreeMap contains key-value pairs, with the
+names of health conditions as keys and the number of occurrences of each health condition as corresponding values. The
+key-value pairs in the TreeMap are ordered in lexicographical order, whereas the LinkedHashMap is ordered in descending
+order by value.
+
+The statistics feature is called every time the user decides to use any request-related commands (such as `add request`,
+`edit r`, `delete r`, `undo`, `redo`, `clr`) since statistics need to keep track of every change in the frequency of all health
+conditions. Therefore, the Statistics class also carries out the following operations:
+
+• updateStatistics(): updates statistics with new health condition-related data after add or edit commands are called
+by the user.
+• deleteStatistics(): updates statistics by specifically removing the health condition-related data that need to be
+removed after the user calls the delete function.
+• sortStatistics(): sorts statistics by value in descending order of the number of occurrences of each health
+conditions, and puts the ordered key-value pairs into sortedMap
+• undoRedoStatistics(): clears statistics and sortedMap completely and uses an ObservableList of all requests in the
+request book to extract all the health conditions and their related number of occurrences. These health conditions and
+their statistics are then added back to statistics and sortedMap
+• clearStatistics(): renders both statistics and sortedMap empty after the user calls for the clr operation
+• getConditionStatistics(): when the user specifically wants to know the number of occurrences for a particular health
+condition
+
+Given below is an example of a usage scenario and how the statistics command is executed at each step:
+
+1. Starting up HealthHub: The user launches HealthHub for the first time. The `statistics` and `sortedMap` will be
+initialized as an empty TreeMap and an empty LinkedHashMap respectively.
+
+2. Issuing Add Request Command: The user executes `add request n/John Doe i/S8974421C p/98765432 a/123 Brick Road,
+#01-01 dt/01-01-2019 14:50:00 c/Diabetes c/Physiotherapy` command to add John Doe to the request book. The
+aforementioned command also calls updateStatistics(), which takes in a Set containing Diabetes Condition and
+Physiotherapy Condition, and adds an occurrence of one each to statistics. sortStatistics() is then subsequently called
+to order the health conditions by value in sortedMap.
+
+3. Issuing Edit Request Command: The user executes `edit r 1 c/Diabetes` command to make changes to the first request
+on the request panel in HealthHub. The aforementioned command also calls deleteStatistics(), which removes the
+statistics of health conditions of the first request in statistics. updateStatistics() is then subsequently called to
+add the new health condition (which in this case is just Diabetes) to statistics. sortStatistics() is lastly called to
+order the health conditions by value in sortedMap.
+4. Issuing Undo Request Command: The user executes `undo` command to reverse his earlier `edit r 1 c/Diabetes` command.
+The aforementioned commands calls undoRedoStatistics(). This method first clears statistics and sortedMap, and then
+takes an ObservableList of all requests from the request book. All health conditions are retrieved from the requests,
+and are used to update statistics and sortedMap.
+
+The following sequence shows how the statistics operation works when called by LogicManager:
+
+image::statistics_command_sequence.png[]
+
+The following activity diagram summarizes what happens when a HealthHub user executes a new command:
+
+image::statistics_activity_diagram.png[]
+
+==== Design Considerations
+
+[width="100%",cols="1, 5, 5",options="header"]
+|=======================================================================
+| Aspect
+| Alternative 1
+| Alternative 2
+
+| Choice of data structure for statistics and sortedMap
+| statistics: use TreeMap
+
+ sortedMap: use LinkedHashMap
+
+*Advantages*:
+
+1. Very fast retrieval of information with the TreeMap; guaranteed O(lgn) time complexity for containsKey, get, put,
+remove operations.
+
+2. TreeMap entries are sorted in the natural ordering of its keys.
+
+3. Having 2 separate data structures (1 to contain alphabetically arranged health conditions and 1 to contain sorted
+conditions by value) aids in the quicker retrieval of data
+
+
+*Disadvantages*:
+
+1. Space costly to have 2 separate data structures containing the same information but in different orders
+
+| Use any other reasonable data structure like an ArrayList or a LinkedList
+
+*Advantages*:
+
+1. Very easy to implement and understand
+
+2. Space-efficient to have only 1 list of health conditions and their corresponding number of occurrences
+
+*Disadvantages*:
+
+1. Will need to create another wrapper class around Conditions and their number of occurrences since lists do not allow
+for key-value pairing
+
+2. Retrieval of information for common operations like getting statistics for a particular condition may not be very
+fast
+
+|=======================================================================
+
+Decision to go with Alternative 1: The team prioritized speed over space since in hospitals, should they want to
+implement HealthHub, will not have an issue with having memory constraints. But they would definitely want to retrieve
+data as fast as possible. Moreover, Alternative 1 seems far more scalable for future developments
+
+[width="100%",cols="1, 5, 5",options="header"]
+|=======================================================================
+| Aspect
+| Alternative 1
+| Alternative 2
+
+| How `statistics` executes
+| The system saves an internal copy of statistics in its storage like a StatisticsBook, modelled after RequestBook or
+HealthWorkerBook
+
+*Advantages*:
+
+ 1. When HealthHub is closed and reopened, the old statistics will still exist.
+
+*Disadvantages*:
+
+ 1. Takes up memory space since statistics will now need to be stored as .json files
+
+ 2. Speed of retrieval will be lower since HealthHub will need to dig into its storage for data
+
+| Make the statistics class a static class.
+
+*Advantages*:
+
+1. Easier to implement; entirely removes the need for making storage files
+
+2. Speed of retrieval of data will be faster since it does not constantly need to keep digging into storage files
-_{Explain here how the data encryption feature will be implemented}_
+*Disadvantages*:
-// end::dataencryption[]
+1. When HealthHub is closed and reopened, the old statistics will disappear since they have not been stored.
-=== Logging
+|=======================================================================
+
+Decision to go with Alternative 2: Since RequestBook was already being stored in the storage component of HealthHub,
+I found it redundant and space-inefficient to have to create another StatisticsBook to store statistical data, since all
+of my statistical information can be found from the requests stored in RequestBook. I made sure that whenever
+request-related commands were being executed (add, edit, delete, undo, redo, clr) statistics was also being updated in
+tandem so that the statistical data was always accurate in real-time.
+
+To address the issue of losing statistical data upon closing down and reopening HealthHub, I have ensured that
+statistics and sortedMap are initialized with latest data from the RequestBook during the init() method in the MainApp.
+
+// end::statistics[]
+
+
+// tag::autocomplete[]
+=== Autocomplete Feature for CommandBox
+The UI component, `CommandBox`, comes with a `TextField` component in AB4. For Health Hub, the `TextField` is replaced
+with an `AutoCompleteTextField` class that extends from the parent class, `TextField`.
+
+In the `AutoCompleteTextField` class, it adds an additional listener to the `textProperty()` of `TextField` class, to register for when
+a text input is being sensed and generates the suggestion box in the form of a `ContextMenu` to the user.
+
+image::AutoCompleteTextFieldSMD.png[]
+Figure 3.11.1 shows the state machine diagram for the `AutoCompleteTextField` behaviour when it listens for a user input.
+
+The searching of which commands to display to the user as suggestions is done by iterating the `suggestions` data structure, which is a `TreeSet`, then checking
+against the user's input if any of the suggestions starts with the user's text.
+
+==== Aspect: Data structure to store the list of commands
+[width="100%",cols="1, 5, 5",options="header"]
+|=======================================================================
+Implementation | Use a `TreeSet` data structure | Use a `SuffixTree` data structure
+|Pros| Implements the `NavigatableSet` interface and guarantees that elements are stored in sorted order, also allows for _O(log n)_ time complexity for dynamic searching of elements. | Made for features like autocompletion, allows particularly fast implementation of `String` operations.
+|Cons| Elements contained within the `TreeSet` data have to be a _Comparable_ or a _Comparator_ needs to be supplied. In this case, since we are only concerned with `Strings`, we do not
+need an extra step. | Suffix Trees are difficult to comprehend -> difficult to implement.
+|=======================================================================
+// end::autocomplete[]
+== Logging
We are using `java.util.logging` package for logging. The `LogsCenter` class is used to manage the logging levels and logging destinations.
* The logging level can be controlled using the `logLevel` setting in the configuration file (See <>)
@@ -447,9 +1318,27 @@ The SE-EDU team does not provide support for modified template files.
[[Testing]]
== Testing
+Testing is an important component of the development pipeline for HealthHub.
+With each new feature that is implemented, new tests for the fresh feature
+must also be included to ensure robustness and validation of the feature. In
+addition, regression testing using existing tests already implemented is also
+ extensively done to ensure that the application functions without unintended
+ side effects. In following sections, we will be elaborating on how you can
+ adopt the testing suite implementation that is in place in HealthHub.
+
=== Running Tests
-There are three ways to run tests.
+For the testing phase in HealthHub, we will be using a testing framework
+called *JUnit* that is specialised to run tests for software built in Java.
+
+[NOTE]
+====
+Not sure how JUnit works? Head over to the JUnit website and take a look at
+their User Guide at this link:
+https://junit.org/junit5/docs/current/user-guide/
+====
+
+There are three ways to run tests in HealthHub.
[TIP]
The most reliable way to run tests is the 3rd one. The first two methods might fail some GUI tests due to platform/resolution-specific idiosyncrasies.
@@ -487,6 +1376,15 @@ e.g. `seedu.address.storage.StorageManagerTest`
.. Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together. +
e.g. `seedu.address.logic.LogicManagerTest`
+=== Generation of test files
+
+We use classes located in the `seedu.address.jsonfilegenerator` folder to generate JSON
+test files. +
+Developers are free to modify the code within the classes to generate healthworker/request
+book containing the respective data they need for tests by using the `HealthWorkerBuilder`
+ and `RequestBuilder` classes +
+All test file generator classes contains a main function and hence can be ran independently by compiling the file.
+
=== Troubleshooting Testing
**Problem: `HelpWindowTest` fails with a `NullPointerException`.**
@@ -496,16 +1394,32 @@ e.g. `seedu.address.logic.LogicManagerTest`
== Dev Ops
+As HealthHub grows larger as a software development project due to addition
+of new features or overhauling of existing ones, we have also deployed the
+use of various build automation tools in order to efficiently integrate the
+components of HealthHub together during the build process. This allows of
+greater efficiency and scalability when introducing new implementations into
+the project.
+
=== Build Automation
-See <> to learn how to use Gradle for build automation.
+See <> to learn how to use Gradle for build
+automation on your local machine for efficient project builds.
=== Continuous Integration
-We use https://travis-ci.org/[Travis CI] and https://www.appveyor.com/[AppVeyor] to perform _Continuous Integration_ on our projects. See <> and <> for more details.
+We use https://travis-ci.org/[Travis CI] and https://www.appveyor
+.com/[AppVeyor] to perform _Continuous Integration_ on our projects to allow
+for more seamless and parallel coding performance between team members. See
+<> and <> for more details.
=== Coverage Reporting
+Coverage represents the portion of the software codebase that has been tested
+ for using various testing frameworks, such as JUnit. This allows the
+ development to track how extensive the testing of new features are to ensure
+ that their features are correctly implemented with minimal bugs.
+
We use https://coveralls.io/[Coveralls] to track the code coverage of our projects. See <> for more details.
=== Documentation Previews
@@ -522,7 +1436,10 @@ Here are the steps to create a new release.
=== Managing Dependencies
-A project often depends on third-party libraries. For example, Address Book depends on the https://github.com/FasterXML/jackson[Jackson library] for JSON parsing. Managing these _dependencies_ can be automated using Gradle. For example, Gradle can download the dependencies automatically, which is better than these alternatives:
+With a huge number of different components in HealthHub, the project also
+includes use of various third party libraries to efficiently support new and
+existing features in HealthHub, some of which includes for example the
+https://github.com/FasterXML/jackson[Jackson library] for JSON parsing. Managing these _dependencies_ can be automated using Gradle. For example, Gradle can download the dependencies automatically, which is better than these alternatives:
[loweralpha]
. Include those libraries in the repo (this bloats the repo size)
@@ -530,294 +1447,23 @@ A project often depends on third-party libraries. For example, Address Book depe
[[GetStartedProgramming]]
[appendix]
-== Suggested Programming Tasks to Get Started
-
-Suggested path for new programmers:
-
-1. First, add small local-impact (i.e. the impact of the change does not go beyond the component) enhancements to one component at a time. Some suggestions are given in <>.
-
-2. Next, add a feature that touches multiple components to learn how to implement an end-to-end feature across all components. <> explains how to go about adding such a feature.
-
-[[GetStartedProgramming-EachComponent]]
-=== Improving each component
-
-Each individual exercise in this section is component-based (i.e. you would not need to modify the other components to get it to work).
-
-[discrete]
-==== `Logic` component
-
-*Scenario:* You are in charge of `logic`. During dog-fooding, your team realize that it is troublesome for the user to type the whole command in order to execute a command. Your team devise some strategies to help cut down the amount of typing necessary, and one of the suggestions was to implement aliases for the command words. Your job is to implement such aliases.
-
-[TIP]
-Do take a look at <> before attempting to modify the `Logic` component.
-
-. Add a shorthand equivalent alias for each of the individual commands. For example, besides typing `clear`, the user can also type `c` to remove all persons in the list.
-+
-****
-* Hints
-** Just like we store each individual command word constant `COMMAND_WORD` inside `*Command.java` (e.g. link:{repoURL}/src/main/java/seedu/address/logic/commands/FindCommand.java[`FindCommand#COMMAND_WORD`], link:{repoURL}/src/main/java/seedu/address/logic/commands/DeleteCommand.java[`DeleteCommand#COMMAND_WORD`]), you need a new constant for aliases as well (e.g. `FindCommand#COMMAND_ALIAS`).
-** link:{repoURL}/src/main/java/seedu/address/logic/parser/AddressBookParser.java[`AddressBookParser`] is responsible for analyzing command words.
-* Solution
-** Modify the switch statement in link:{repoURL}/src/main/java/seedu/address/logic/parser/AddressBookParser.java[`AddressBookParser#parseCommand(String)`] such that both the proper command word and alias can be used to execute the same intended command.
-** Add new tests for each of the aliases that you have added.
-** Update the user guide to document the new aliases.
-** See this https://github.com/se-edu/addressbook-level4/pull/785[PR] for the full solution.
-****
-
-[discrete]
-==== `Model` component
-
-*Scenario:* You are in charge of `model`. One day, the `logic`-in-charge approaches you for help. He wants to implement a command such that the user is able to remove a particular tag from everyone in the address book, but the model API does not support such a functionality at the moment. Your job is to implement an API method, so that your teammate can use your API to implement his command.
-
-[TIP]
-Do take a look at <> before attempting to modify the `Model` component.
-
-. Add a `removeTag(Tag)` method. The specified tag will be removed from everyone in the address book.
-+
-****
-* Hints
-** The link:{repoURL}/src/main/java/seedu/address/model/Model.java[`Model`] and the link:{repoURL}/src/main/java/seedu/address/model/AddressBook.java[`AddressBook`] API need to be updated.
-** Think about how you can use SLAP to design the method. Where should we place the main logic of deleting tags?
-** Find out which of the existing API methods in link:{repoURL}/src/main/java/seedu/address/model/AddressBook.java[`AddressBook`] and link:{repoURL}/src/main/java/seedu/address/model/person/Person.java[`Person`] classes can be used to implement the tag removal logic. link:{repoURL}/src/main/java/seedu/address/model/AddressBook.java[`AddressBook`] allows you to update a person, and link:{repoURL}/src/main/java/seedu/address/model/person/Person.java[`Person`] allows you to update the tags.
-* Solution
-** Implement a `removeTag(Tag)` method in link:{repoURL}/src/main/java/seedu/address/model/AddressBook.java[`AddressBook`]. Loop through each person, and remove the `tag` from each person.
-** Add a new API method `deleteTag(Tag)` in link:{repoURL}/src/main/java/seedu/address/model/ModelManager.java[`ModelManager`]. Your link:{repoURL}/src/main/java/seedu/address/model/ModelManager.java[`ModelManager`] should call `AddressBook#removeTag(Tag)`.
-** Add new tests for each of the new public methods that you have added.
-** See this https://github.com/se-edu/addressbook-level4/pull/790[PR] for the full solution.
-****
-
-[discrete]
-==== `Ui` component
-
-*Scenario:* You are in charge of `ui`. During a beta testing session, your team is observing how the users use your address book application. You realize that one of the users occasionally tries to delete non-existent tags from a contact, because the tags all look the same visually, and the user got confused. Another user made a typing mistake in his command, but did not realize he had done so because the error message wasn't prominent enough. A third user keeps scrolling down the list, because he keeps forgetting the index of the last person in the list. Your job is to implement improvements to the UI to solve all these problems.
-
-[TIP]
-Do take a look at <> before attempting to modify the `UI` component.
-
-. Use different colors for different tags inside person cards. For example, `friends` tags can be all in brown, and `colleagues` tags can be all in yellow.
-+
-**Before**
-+
-image::getting-started-ui-tag-before.png[width="300"]
-+
-**After**
-+
-image::getting-started-ui-tag-after.png[width="300"]
-+
-****
-* Hints
-** The tag labels are created inside link:{repoURL}/src/main/java/seedu/address/ui/PersonCard.java[the `PersonCard` constructor] (`new Label(tag.tagName)`). https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Label.html[JavaFX's `Label` class] allows you to modify the style of each Label, such as changing its color.
-** Use the .css attribute `-fx-background-color` to add a color.
-** You may wish to modify link:{repoURL}/src/main/resources/view/DarkTheme.css[`DarkTheme.css`] to include some pre-defined colors using css, especially if you have experience with web-based css.
-* Solution
-** You can modify the existing test methods for `PersonCard` 's to include testing the tag's color as well.
-** See this https://github.com/se-edu/addressbook-level4/pull/798[PR] for the full solution.
-*** The PR uses the hash code of the tag names to generate a color. This is deliberately designed to ensure consistent colors each time the application runs. You may wish to expand on this design to include additional features, such as allowing users to set their own tag colors, and directly saving the colors to storage, so that tags retain their colors even if the hash code algorithm changes.
-****
-
-. Modify link:{repoURL}/src/main/java/seedu/address/commons/events/ui/NewResultAvailableEvent.java[`NewResultAvailableEvent`] such that link:{repoURL}/src/main/java/seedu/address/ui/ResultDisplay.java[`ResultDisplay`] can show a different style on error (currently it shows the same regardless of errors).
-+
-**Before**
-+
-image::getting-started-ui-result-before.png[width="200"]
-+
-**After**
-+
-image::getting-started-ui-result-after.png[width="200"]
-+
-****
-* Hints
-** link:{repoURL}/src/main/java/seedu/address/commons/events/ui/NewResultAvailableEvent.java[`NewResultAvailableEvent`] is raised by link:{repoURL}/src/main/java/seedu/address/ui/CommandBox.java[`CommandBox`] which also knows whether the result is a success or failure, and is caught by link:{repoURL}/src/main/java/seedu/address/ui/ResultDisplay.java[`ResultDisplay`] which is where we want to change the style to.
-** Refer to link:{repoURL}/src/main/java/seedu/address/ui/CommandBox.java[`CommandBox`] for an example on how to display an error.
-* Solution
-** Modify link:{repoURL}/src/main/java/seedu/address/commons/events/ui/NewResultAvailableEvent.java[`NewResultAvailableEvent`] 's constructor so that users of the event can indicate whether an error has occurred.
-** Modify link:{repoURL}/src/main/java/seedu/address/ui/ResultDisplay.java[`ResultDisplay#handleNewResultAvailableEvent(NewResultAvailableEvent)`] to react to this event appropriately.
-** You can write two different kinds of tests to ensure that the functionality works:
-*** The unit tests for `ResultDisplay` can be modified to include verification of the color.
-*** The system tests link:{repoURL}/src/test/java/systemtests/AddressBookSystemTest.java[`AddressBookSystemTest#assertCommandBoxShowsDefaultStyle() and AddressBookSystemTest#assertCommandBoxShowsErrorStyle()`] to include verification for `ResultDisplay` as well.
-** See this https://github.com/se-edu/addressbook-level4/pull/799[PR] for the full solution.
-*** Do read the commits one at a time if you feel overwhelmed.
-****
-
-. Modify the link:{repoURL}/src/main/java/seedu/address/ui/StatusBarFooter.java[`StatusBarFooter`] to show the total number of people in the address book.
-+
-**Before**
-+
-image::getting-started-ui-status-before.png[width="500"]
-+
-**After**
-+
-image::getting-started-ui-status-after.png[width="500"]
-+
-****
-* Hints
-** link:{repoURL}/src/main/resources/view/StatusBarFooter.fxml[`StatusBarFooter.fxml`] will need a new `StatusBar`. Be sure to set the `GridPane.columnIndex` properly for each `StatusBar` to avoid misalignment!
-** link:{repoURL}/src/main/java/seedu/address/ui/StatusBarFooter.java[`StatusBarFooter`] needs to initialize the status bar on application start, and to update it accordingly whenever the address book is updated.
-* Solution
-** Modify the constructor of link:{repoURL}/src/main/java/seedu/address/ui/StatusBarFooter.java[`StatusBarFooter`] to take in the number of persons when the application just started.
-** Use link:{repoURL}/src/main/java/seedu/address/ui/StatusBarFooter.java[`StatusBarFooter#handleAddressBookChangedEvent(AddressBookChangedEvent)`] to update the number of persons whenever there are new changes to the addressbook.
-** For tests, modify link:{repoURL}/src/test/java/guitests/guihandles/StatusBarFooterHandle.java[`StatusBarFooterHandle`] by adding a state-saving functionality for the total number of people status, just like what we did for save location and sync status.
-** For system tests, modify link:{repoURL}/src/test/java/systemtests/AddressBookSystemTest.java[`AddressBookSystemTest`] to also verify the new total number of persons status bar.
-** See this https://github.com/se-edu/addressbook-level4/pull/803[PR] for the full solution.
-****
-
-[discrete]
-==== `Storage` component
-
-*Scenario:* You are in charge of `storage`. For your next project milestone, your team plans to implement a new feature of saving the address book to the cloud. However, the current implementation of the application constantly saves the address book after the execution of each command, which is not ideal if the user is working on limited internet connection. Your team decided that the application should instead save the changes to a temporary local backup file first, and only upload to the cloud after the user closes the application. Your job is to implement a backup API for the address book storage.
-
-[TIP]
-Do take a look at <> before attempting to modify the `Storage` component.
-
-. Add a new method `backupAddressBook(ReadOnlyAddressBook)`, so that the address book can be saved in a fixed temporary location.
-+
-****
-* Hint
-** Add the API method in link:{repoURL}/src/main/java/seedu/address/storage/AddressBookStorage.java[`AddressBookStorage`] interface.
-** Implement the logic in link:{repoURL}/src/main/java/seedu/address/storage/StorageManager.java[`StorageManager`] and link:{repoURL}/src/main/java/seedu/address/storage/JsonAddressBookStorage.java[`JsonAddressBookStorage`] class.
-* Solution
-** See this https://github.com/se-edu/addressbook-level4/pull/594[PR] for the full solution.
-****
-
-[[GetStartedProgramming-RemarkCommand]]
-=== Creating a new command: `remark`
-
-By creating this command, you will get a chance to learn how to implement a feature end-to-end, touching all major components of the app.
-
-*Scenario:* You are a software maintainer for `addressbook`, as the former developer team has moved on to new projects. The current users of your application have a list of new feature requests that they hope the software will eventually have. The most popular request is to allow adding additional comments/notes about a particular contact, by providing a flexible `remark` field for each contact, rather than relying on tags alone. After designing the specification for the `remark` command, you are convinced that this feature is worth implementing. Your job is to implement the `remark` command.
-
-==== Description
-Edits the remark for a person specified in the `INDEX`. +
-Format: `remark INDEX r/[REMARK]`
-
-Examples:
-
-* `remark 1 r/Likes to drink coffee.` +
-Edits the remark for the first person to `Likes to drink coffee.`
-* `remark 1 r/` +
-Removes the remark for the first person.
-
-==== Step-by-step Instructions
-
-===== [Step 1] Logic: Teach the app to accept 'remark' which does nothing
-Let's start by teaching the application how to parse a `remark` command. We will add the logic of `remark` later.
-
-**Main:**
-
-. Add a `RemarkCommand` that extends link:{repoURL}/src/main/java/seedu/address/logic/commands/Command.java[`Command`]. Upon execution, it should just throw an `Exception`.
-. Modify link:{repoURL}/src/main/java/seedu/address/logic/parser/AddressBookParser.java[`AddressBookParser`] to accept a `RemarkCommand`.
-
-**Tests:**
-
-. Add `RemarkCommandTest` that tests that `execute()` throws an Exception.
-. Add new test method to link:{repoURL}/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java[`AddressBookParserTest`], which tests that typing "remark" returns an instance of `RemarkCommand`.
-
-===== [Step 2] Logic: Teach the app to accept 'remark' arguments
-Let's teach the application to parse arguments that our `remark` command will accept. E.g. `1 r/Likes to drink coffee.`
-
-**Main:**
-
-. Modify `RemarkCommand` to take in an `Index` and `String` and print those two parameters as the error message.
-. Add `RemarkCommandParser` that knows how to parse two arguments, one index and one with prefix 'r/'.
-. Modify link:{repoURL}/src/main/java/seedu/address/logic/parser/AddressBookParser.java[`AddressBookParser`] to use the newly implemented `RemarkCommandParser`.
-
-**Tests:**
-
-. Modify `RemarkCommandTest` to test the `RemarkCommand#equals()` method.
-. Add `RemarkCommandParserTest` that tests different boundary values
-for `RemarkCommandParser`.
-. Modify link:{repoURL}/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java[`AddressBookParserTest`] to test that the correct command is generated according to the user input.
-
-===== [Step 3] Ui: Add a placeholder for remark in `PersonCard`
-Let's add a placeholder on all our link:{repoURL}/src/main/java/seedu/address/ui/PersonCard.java[`PersonCard`] s to display a remark for each person later.
-
-**Main:**
-
-. Add a `Label` with any random text inside link:{repoURL}/src/main/resources/view/PersonListCard.fxml[`PersonListCard.fxml`].
-. Add FXML annotation in link:{repoURL}/src/main/java/seedu/address/ui/PersonCard.java[`PersonCard`] to tie the variable to the actual label.
-
-**Tests:**
-
-. Modify link:{repoURL}/src/test/java/guitests/guihandles/PersonCardHandle.java[`PersonCardHandle`] so that future tests can read the contents of the remark label.
-
-===== [Step 4] Model: Add `Remark` class
-We have to properly encapsulate the remark in our link:{repoURL}/src/main/java/seedu/address/model/person/Person.java[`Person`] class. Instead of just using a `String`, let's follow the conventional class structure that the codebase already uses by adding a `Remark` class.
-
-**Main:**
-
-. Add `Remark` to model component (you can copy from link:{repoURL}/src/main/java/seedu/address/model/person/Address.java[`Address`], remove the regex and change the names accordingly).
-. Modify `RemarkCommand` to now take in a `Remark` instead of a `String`.
-
-**Tests:**
-
-. Add test for `Remark`, to test the `Remark#equals()` method.
-
-===== [Step 5] Model: Modify `Person` to support a `Remark` field
-Now we have the `Remark` class, we need to actually use it inside link:{repoURL}/src/main/java/seedu/address/model/person/Person.java[`Person`].
-
-**Main:**
-
-. Add `getRemark()` in link:{repoURL}/src/main/java/seedu/address/model/person/Person.java[`Person`].
-. You may assume that the user will not be able to use the `add` and `edit` commands to modify the remarks field (i.e. the person will be created without a remark).
-. Modify link:{repoURL}/src/main/java/seedu/address/model/util/SampleDataUtil.java/[`SampleDataUtil`] to add remarks for the sample data (delete your `data/addressbook.json` so that the application will load the sample data when you launch it.)
-
-===== [Step 6] Storage: Add `Remark` field to `JsonAdaptedPerson` class
-We now have `Remark` s for `Person` s, but they will be gone when we exit the application. Let's modify link:{repoURL}/src/main/java/seedu/address/storage/JsonAdaptedPerson.java[`JsonAdaptedPerson`] to include a `Remark` field so that it will be saved.
-
-**Main:**
-
-. Add a new JSON field for `Remark`.
-
-**Tests:**
-
-. Fix `invalidAndValidPersonAddressBook.json`, `typicalPersonsAddressBook.json`, `validAddressBook.json` etc., such that the JSON tests will not fail due to a missing `remark` field.
-
-===== [Step 6b] Test: Add withRemark() for `PersonBuilder`
-Since `Person` can now have a `Remark`, we should add a helper method to link:{repoURL}/src/test/java/seedu/address/testutil/PersonBuilder.java[`PersonBuilder`], so that users are able to create remarks when building a link:{repoURL}/src/main/java/seedu/address/model/person/Person.java[`Person`].
-
-**Tests:**
-
-. Add a new method `withRemark()` for link:{repoURL}/src/test/java/seedu/address/testutil/PersonBuilder.java[`PersonBuilder`]. This method will create a new `Remark` for the person that it is currently building.
-. Try and use the method on any sample `Person` in link:{repoURL}/src/test/java/seedu/address/testutil/TypicalPersons.java[`TypicalPersons`].
-
-===== [Step 7] Ui: Connect `Remark` field to `PersonCard`
-Our remark label in link:{repoURL}/src/main/java/seedu/address/ui/PersonCard.java[`PersonCard`] is still a placeholder. Let's bring it to life by binding it with the actual `remark` field.
-
-**Main:**
-
-. Modify link:{repoURL}/src/main/java/seedu/address/ui/PersonCard.java[`PersonCard`]'s constructor to bind the `Remark` field to the `Person` 's remark.
-
-**Tests:**
-
-. Modify link:{repoURL}/src/test/java/seedu/address/ui/testutil/GuiTestAssert.java[`GuiTestAssert#assertCardDisplaysPerson(...)`] so that it will compare the now-functioning remark label.
-
-===== [Step 8] Logic: Implement `RemarkCommand#execute()` logic
-We now have everything set up... but we still can't modify the remarks. Let's finish it up by adding in actual logic for our `remark` command.
-
-**Main:**
-
-. Replace the logic in `RemarkCommand#execute()` (that currently just throws an `Exception`), with the actual logic to modify the remarks of a person.
-
-**Tests:**
-
-. Update `RemarkCommandTest` to test that the `execute()` logic works.
-
-==== Full Solution
-
-See this https://github.com/se-edu/addressbook-level4/pull/599[PR] for the step-by-step solution.
[appendix]
== Product Scope
*Target user profile*:
-* has a need to manage a significant number of contacts
-* prefer desktop apps over other types
-* can type fast
-* prefers typing over mouse input
-* is reasonably comfortable using CLI apps
+* Administrative staff in hospitals and healthcare organizations that also
+manage requests from and services for home-care patients
+* Administrative staff that are comfortable with typing on a CLI, as well as
+a GUI.
+* Aims to streamline the performance of keeping records of home-care
+patients, and also assigning health staff to requests using technological
+means.
-*Value proposition*: manage contacts faster than a typical mouse/GUI driven app
+*Value proposition*: manage requests from home-care patients, and handle
+assignment of healthstaff for these requests much faster and efficient than
+traditional methods of pen and paper documentation.
[appendix]
== User Stories
@@ -828,34 +1474,60 @@ Priorities: High (must have) - `* * \*`, Medium (nice to have) - `* \*`, Low (un
|=======================================================================
|Priority |As a ... |I want to ... |So that I can...
|`* * *` |new user |see usage instructions |refer to instructions when I forget how to use the App
+|`* * *` |user |Check the details of new or unassigned requests|See what requests have yet to be assigned a health worker and what type of request it is
+|`* * *` |user |Assign a health worker to an existing request|Accept a pending request by assigning a new health worker who has the skillset to fufill the request at the time of the request
+|`* * *` |user |Complete a request that is currently ongoing|Label the request as completed once the health worker completes his/her task
-|`* * *` |user |add a new person |
+|`* * *` |user |Register a new health worker|
+|`* * *` |user |delete a healthworker |remove healthworkers that are no longer in our hospital database
+|`* * *` |user |find a healthworker by name |locate details of persons without having to go through the entire list
-|`* * *` |user |delete a person |remove entries that I no longer need
+|`* * *` |user |Check the professional details of existing health workers|Identify which health worker has the appropriate skillsets and certificates to fufill the corresponding requests
+|`* * *` |user |Register a new request |Key in a new request from a patient with the specific request and patient details
+|`* *` |user handling many requests at once|Identify the number of requests and their proportion|Immediately see which type of requests have the most demand
-|`* * *` |user |find a person by name |locate details of persons without having to go through the entire list
-|`* *` |user |hide <> by default |minimize chance of someone else seeing them by accident
+|`* *` |user |filter requests by type|Perform assignment of staff of tasks of a specific type
+|`* *` |user |Delete a request|Remove a request that is no longer valid or cancelled
-|`*` |user with many persons in the address book |sort persons by name |locate a person easily
|=======================================================================
-_{More to be added}_
[appendix]
== Use Cases
-(For all use cases below, the *System* is the `AddressBook` and the *Actor* is the `user`, unless specified otherwise)
+(For all use cases below, the *System* is the `HealthHub` and the *Actor* is the `user`, unless specified otherwise)
+
+[discrete]
+=== Use case: Add health worker
+1. User wants to register a new health worker.
+
+[none]
+** 1.a. User enters the relevant health worker details into the system.
+
+[none]
+** 2. Application registers the new health worker
++
+[none]
+* Use case ends.
+[none]
+** 3a. The same health worker already exists inside the Application.
++
+[none]
+*** 3a1. Application shows an error message.
++
+Use case ends.
+
[discrete]
-=== Use case: Delete person
+=== Use case: Delete health worker
*MSS*
-1. User requests to list persons
-2. AddressBook shows a list of persons
-3. User requests to delete a specific person in the list
-4. AddressBook deletes the person
+1. User requests to list health workers
+2. Application shows a list of health workers
+3. User requests to delete a specific health worker in the list
+4. Application deletes the person
+
Use case ends.
@@ -869,11 +1541,63 @@ Use case ends.
* 3a. The given index is invalid.
+
[none]
-** 3a1. AddressBook shows an error message.
+** 3a1. Application shows an error message.
+
Use case resumes at step 2.
-_{More to be added}_
+[discrete]
+=== Use case: Add request
+1. User wants to register a new request.
+
+[none]
+** 1.a. User enters the relevant request details into the system.
+
+[none]
+** 2. Application registers the new request
++
+Use case ends.
+
+** 3a. The same request already exists inside the Application.
++
+[none]
+*** 3a1. Application shows an error message.
++
+Use case ends.
+
+
+[discrete]
+=== Use case: Assign requests to worker
+
+1. User wants to view the list of open requests.
+[none]
+* 1.a. User does not know command for listing requests:
+* 1.a1. User enters the help command to look up the command for listing all requests.
+2. Application displays list of open requests.
+3. User wants to assign a health worker to a request.
+[none]
+* 3.a. No free health worker during the specified time slot for assignment:
+** 3.a1 Request is left open.
+* Use case ends.
+* 3.b.No health worker with the necessary skillsets/certifications:
+* 3.b1. Request is left open.
+Use case ends.
+4. Free health worker that has the necessary certifications and with the closest
+proximity to the patient address will be assigned to the request.
+[none]
+Use case ends.
+
+[discrete]
+=== Use case: Delete requests
+1. User wants to delete a request that is expired or invalid.
+[none]
+* 1.a. Specified request is not in Application
+* Use case ends.
+2. Application deletes the specified request.
+[none]
+* Use case ends.
+
+
+
[appendix]
== Non Functional Requirements
@@ -882,8 +1606,6 @@ _{More to be added}_
. Should be able to hold up to 1000 persons without a noticeable sluggishness in performance for typical usage.
. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse.
-_{More to be added}_
-
[appendix]
== Glossary
@@ -893,27 +1615,12 @@ Windows, Linux, Unix, OS-X
[[private-contact-detail]] Private contact detail::
A contact detail that is not meant to be shared with others
-[appendix]
-== Product Survey
-
-*Product Name*
-
-Author: ...
-
-Pros:
-
-* ...
-* ...
-
-Cons:
-
-* ...
-* ...
-
[appendix]
== Instructions for Manual Testing
-Given below are instructions to test the app manually.
+In case of circumstances where manual testing needs to be done for HealthHub,
+ this section provides instructions on how to get started on manual testing
+ for the application.
[NOTE]
These instructions only provide a starting point for testers to work on; testers are expected to do more _exploratory_ testing.
@@ -932,26 +1639,112 @@ These instructions only provide a starting point for testers to work on; testers
.. Re-launch the app by double-clicking the jar file. +
Expected: The most recent window size and location is retained.
-_{ more test cases ... }_
-
-=== Deleting a person
-. Deleting a person while all persons are listed
-.. Prerequisites: List all persons using the `list` command. Multiple persons in the list.
-.. Test case: `delete 1` +
- Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated.
-.. Test case: `delete 0` +
- Expected: No person is deleted. Error details shown in the status message. Status bar remains the same.
-.. Other incorrect delete commands to try: `delete`, `delete x` (where x is larger than the list size) _{give more}_ +
+=== Adding a `HealthWorker
+
+* Enter a valid `add healthworker` command with all compulsory fields
+containing valid values. For example, you may try `add healthworker n/Dog Terr
+p/92837710 i/S98817471Z o/NUH s/GENERAL_PRACTICE s/ORTHOPAEDIC` +
+ Message showing the successful addition of the `HealthWorker` will be
+displayed in the command terminal, as well as the details of the newly added
+`HealthWorker`. The newly added `HealthWorker` is now reflected immediately
+in the GUI shown at the end of the list on the right.
+* Enter an invalid `add healthworker` command. Some examples include:
+** Missing fields: add healthworker p/92837710 i/S98817471Z o/NUH
+s/GENERAL_PRACTICE s/ORTHOPAEDIC` (Missing name) +
+An error message representing invalid command format will be displayed on the
+ command terminal, as well as the valid command format for the `add
+ healthworker` command.
+
+** Invalid fields: add healthworker n/Dog Terr p/92837710 i/A111Z o/NUH
+s/GENERAL_PRACTICE s/ORTHOPAEDIC` (Invalid NRIC format) +
+An error message is displayed that tells the user of the incorrect format for
+ a field whose value does not follow the correct format. If there are
+ multiple, the incorrect format of the first field whose value is invalid is
+ shown.
+
+=== Editing a `HealthWorker`
+
+* Enter a valid `edit healthworker` command with a valid index, and at least
+one field to edit with a valid value. For example, you may try `edit
+healthworker 1 p/91234567 n/John Doe` +
+A status message that denotes the successful modification of the details of
+an existing `HealthWorker` is shown on the command terminal. In addition, the
+ modified details of the `HealthWorker is immediately reflected on the list
+ in the GUI.
+
+* Enter an invalid `edit healthworker` command. Some examples include:
+** Invalid index: `edit healthworker -1 n/John` +
+An error message displays which informs the user that the index provided is
+invalid.
+** No field specified: `edit healthworker 1 ` +
+An error message displays informing the user that at least one field to edit
+must be provided.
+** Invalid field: `edit healthworker 1 p/helloworld` +
+An error message displays informing the user that the specific field
+specified containing invalid values does not conform the field format. If
+multiple invalid fields are entered, the first invalid one will be chosen as
+the invalid format.
+
+=== Deleting a `HealthWorker`
+
+* Deleting a `HealthWorker` while all `HealthWorker` are listed:
+
+.. Prerequisites: List all `HealthWorker` using the `list healthworker`
+command. Multiple `HealthWorker` in the list.
+.. Test case: `delete healthworker 1` +
+ Expected: First `HealthWorker` is deleted from the list. Details of the
+ deleted `HealthWorker` shown in the status message. Timestamp in the status
+ bar is updated.
+.. Test case: `delete healthworker 0` +
+ Expected: No `HealthWorker` is deleted. Error details shown in the status
+ message. Status bar remains the same.
+.. Other incorrect delete commands to try: `delete`, delete healthworker`,
+`delete healthworker x` (where x is larger than the list size), `delete healthworker y` (where y is negative) +
Expected: Similar to previous.
-_{ more test cases ... }_
+* Deleting a `HealthWorker` after a valid `filter healthworker` command is
+issued:
+.. Prerequisite: Enter the command `filter healthworker s/physiotherapy` to
+display only `HealthWorker` that specialise in physiotherapy. Other valid
+variants of the `filter healthworker` command may be used in place of this.
+.. Test case: `delete healthworker 1` +
+ Expected: First `HealthWorker` is deleted from the filtered list. Details of
+ the deleted `HealthWorker` shown in the status message. Timestamp in the
+ status bar is updated.
+.. Test case: `delete healthworker 0` +
+ Expected: No `HealthWorker` is deleted. Error details shown in the status
+ message. Status bar remains the same.
+.. Other incorrect delete commands to try: `delete`, delete healthworker`,
+`delete healthworker x` (where x is larger than the filtered list size),
+`delete healthworker y` (where y is negative) +
+ Expected: Similar to previous.
=== Saving data
. Dealing with missing/corrupted data files
+.. If data file is missing, the app will retrieve a list of sample data internally. It will be saved upon exit.
+.. If any of the data is corrupted, the app will start with empty books, adding a health worker
+or request will overwrite the corrupted file.
-.. _{explain how to simulate a missing/corrupted file and the expected behavior}_
+// tag::undoredo[]
+
+=== Undoing a command
+. Undo a command that has been executed
+.. Prerequisites: A command that modifies the data has been executed already, for example `delete r 1`.
+.. Test case: `undo` +
+Expected: The request has been deleted will appear back inside the list in its original position.
+.. Test case: `undo` without any prerequisites +
+Expected: The application will show an error message: No more commands to undo!
+
+=== Redoing a command
+. Redo an undone command
+.. Prerequisites: A successful undo command have to be executed already.
+.. Test case: `redo` +
+Expected: The application will redo the undone command.
+.. Test case: `redo` without prerequisites +
+Expected: The application will show an error message: No more commands to redo!
-_{ more test cases ... }_
+
+// end::undoredo[]
diff --git a/docs/UserGuide.adoc b/docs/UserGuide.adoc
index 7e0070e12f49..557c430ddcc1 100644
--- a/docs/UserGuide.adoc
+++ b/docs/UserGuide.adoc
@@ -1,9 +1,10 @@
-= AddressBook Level 4 - User Guide
+= Health Hub - User Guide
:site-section: UserGuide
:toc:
:toc-title:
:toc-placement: preamble
:sectnums:
+:icons: font
:imagesDir: images
:stylesDir: stylesheets
:xrefstyle: full
@@ -12,249 +13,1079 @@ ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
endif::[]
-:repoURL: https://github.com/se-edu/addressbook-level4
+:repoURL: https://github.com/CS2103-AY1819S2-W09-2/main
-By: `Team SE-EDU` Since: `Jun 2016` Licence: `MIT`
+By: `Team W9-02 (Health Hub)` Since: `Jan 2019` Licence: `MIT`
== Introduction
-AddressBook Level 4 (AB4) is for those who *prefer to use a desktop app for managing contacts*. More importantly, AB4 is *optimized for those who prefer to work with a Command Line Interface* (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, AB4 can get your contact management tasks done faster than traditional GUI apps. Interested? Jump to the <> to get started. Enjoy!
+Health Hub connects home care patients to qualified health care professionals seamlessly.
+
+Health Hub is a desktop application which allows health administrative staff to add, manage and close requests from
+patients. These patients are people who do not require 24-hour round' the clock medical attention but perhaps some
+other health care services such as the changing of tubing. +
+
+Health Hub provides a *Graphical User Interface* for administrative staff of health organizations and hospitals to manage requests
+from all potential home stay patients, and is also *optimized for those who prefer to work with a Command Line Interface* (CLI). +
+
+Want to jump right into using Health Hub? Head over to <> to
+install and configure the application, and you're good to go!
+
+== Notation
+
+* Words that are highlighted with a grey background in monospaced font
+represent a `parameter` or `command` that is present or are to be used in the
+application.
+
+* All numbers mentioned with commands begins with the number 1, representing the first item in the list.
+
+* Words that are highlighted in white represent a kbd:[keyboard] button that
+can be pressed to invoke a described function.
+
+[NOTE]
+====
+Documentation displayed under the this section may be additional useful
+information regarding HealthHub.
+====
+
+[TIP]
+====
+Information under this section denotes shortcuts and alternative commands to
+the format of certain functions in HealthHub.
+====
+
+[WARNING]
+====
+Information under this section highlights potential risks that may happen in
+using a specific feature.
+====
== Quick Start
-. Ensure you have Java version `9` or later installed in your Computer.
-. Download the latest `addressbook.jar` link:{repoURL}/releases[here].
-. Copy the file to the folder you want to use as the home folder for your Address Book.
-. Double-click the file to start the app. The GUI should appear in a few seconds.
-+
-image::Ui.png[width="790"]
-+
+New to Health Hub? Follow our quick and easy steps below to get started on
+Health Hub in no time!
+
+Before you start, ensure you have Java version `9` or later installed in your computer.
+
+[NOTE]
+====
+If you do not have Java 9 installed, you may download the latest version of
+the Java Runtime Environment at this link: https://www.oracle.com/technetwork/java/javase/downloads/index.html
+====
+
+Upon installing the application, click on the `healthhub.jar` file to open up
+ Health Hub. You should be greeted by the following interface:
+
+image::Ui_home.png[]
. Type the command in the command box and press kbd:[Enter] to execute it. +
e.g. typing *`help`* and pressing kbd:[Enter] will open the help window.
. Some example commands you can try:
-* *`list`* : lists all contacts
-* **`add`**`n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` : adds a contact named `John Doe` to the Address Book.
-* **`delete`**`3` : deletes the 3rd contact shown in the current list
-* *`exit`* : exits the app
+* *`list`* : lists all requests
+* **`add`** `3 i/3 n/John Doe p/98765432 a/John street, block 123, #01-01` :
+adds a patient named `John Doe` to the application.
+* **`delete`** `4 n/4` : deletes the 4th request shown by the list command
+* *`exit`* : exits the application, saving any changes made to the parameters
+ in the application.
+
+. Refer to <> for a detailed explanation of each command.
+
+== Change Log
+
+Returning user but not sure what has changed since you left?
+
+Listed below are the enhancements made to HealthHub, their version
+ releases and the respective improvement made:
+
+=== v1.1 Release Notes
+
+In this patch, the functionality to register new health workers into the
+application has been implemented. Users may now also add new requests from
+patients into Health Hub for future assignment using the `assign` command.
+
+* `add healthworker` command: Adds a health worker to the application, for
+future assignment to open requests in HealtHub. For details on the
+* `add request` command: Registers a new open request into the application.
+The open request can then be assigned by the user using the `assign` command.
+
+For more explicit information on the `add` command, visit <>,
+under Adding a Health Worker/Request.
+
+* `assign` command: Assigns an open request to an available health worker
+that is already registered in the system
+
+=== v1.2 Release Notes
+
+Version 1.2 provides more utility to the application through the
+implementation of the `edit` and `delete` commands that allow the user to
+modify and remove requests and health workers from the application.
-. Refer to <> for details of each command.
+* `edit healthworker/h/1`: Modifies the details of an existing health staff
+registered in Health Hub.
+* `edit request/r/2`: Modifies the details of existing request records in the
+ application.
+
+For more explicit information on the `edit` command, visit <>,
+under Editing a Health Worker/Request.
+
+=== v1.3 Release Notes
+
+With the release of version 1.3, we have set out to improve the already
+simple and easy to use Health Hub with command shortcuts, as well as `filter`
+command to easily search for staff with the skillset you are looking for.
+
+*Shortcuts*:
+
+* `add healthworker/h/1`: Adds a health worker to the application.
+* `add request/r/2`: Registers a new request for the hospital management to attend to.
+
+*Filtering requests and health workers*:
+
+* `filter healthworker/h/1`: Filters a healthworker by the individual's name, phone, organisation or
+specialisation.
+* `filter request/r/2`: Filters a request by the patient's name, address, or the
+date and time of the request and the status of the request
+
+Other enhancements made to Health Hub include:
+
+* `setreminder` command: Allows the user to set and register reminders in the
+ application.
+* `undo/redo` command: Undo a previous action or redo a previously undone action.
+
+For more explicit information on the `filter`,`setreminder` and `undo/redo`
+command, visit <>, under Filtering Health Workers/Requests.
+
+// tag::releasenotes-1.4[]
+=== v1.4 Release Notes
+
+With the release of version 1.4, we decided to improve our current features by making them more dynamic and automated to reduce the manual work of changing the data.
+
+* The health worker field inside requests now shows the NRIC of the health worker instead of the name in previous versions.
+
+* Editing the NRIC of a health worker will dynamically change the health staff field of all requests assigned to the health worker.
+
+* Users can assign multiple requests to a health worker only if the requests are at least 2 hours apart.
+
+// end::releasenotes-1.4[]
+
+// tag::releasenotes-2.0[]
+=== v2.0 Release Notes
+
+After the release of v1.4, the team have planned for future enhancements to Health Hub to improve its existing
+functionalities, by also considering different aspects such as the ethical part of handling sensitive patient information within and outside of the app.
+
+For *data management*, it will be upgraded to an even higher level of encryption by professional standards to ensure that sensitive
+information is handled cautiously to prevent data leaks.
+
+For *account management*, hospital administrative staff will have to start logging in to their accounts (accounts which are given to them when they
+first joined the department) in order to use the app. These accounts are created and managed by a higher authority personnel, to add a
+second layer of security.
+
+So far, with the releases of v1.2 to v1.4, the focus is on registering the requests into the system and assigning them. In v2.0, there will be additional details
+added to health workers such as their *availability to visit the home care patients*, that will add value to when the user is assigning an open request.
+
+Last but not least, it is important that we gather our users' feedback from time to time to understand their frustrations and needs with the app. As such,
+there will be a *"Feedback"* option in v2.0 for users to submit their feedback to the developers of Health Hub.
+// end::releasenotes-2.0[]
[[Features]]
== Features
+The following description of the features and commands are prototypes and specific details and implementation may vary over the course of the project.
+
+*General Command Format*:
+
+* Words in `` are the parameters to be supplied by the user e.g. in `add n/`, `` is a parameter which can be used as `add n/John Doe`.
+* Items in square brackets are optional e.g `n/ [c/]`
+can be used as `n/John Doe c/Claustrophobia` or as `n/John Doe`.
+* Items with `…` after them can be used multiple times including zero times e.g. `s/...` can be used as `{nbsp}` (i.e. 0 times), `t/friend`, `t/friend t/family` etc.
+* Parameters can be in any order e.g. if the command specifies `n/ p/`, `p/ n/` is also acceptable.
+
+[NOTE]
+Our application does not support command chaining. Inputting multiple commands onto the same line will result in only the first command to be executed.
+For example, calling `list r undo` will only list the requests and not execute the `undo` command.
+
+=== Viewing Help : `help`
+
+Upon first starting the application as a new user, or perhaps a returning
+user, you may open up the help menu using the `help` command.
+
+Upon entering the `help` command, the help menu renders separately from the
+Health Hub main application. Therefore, you do not have to worry about losing
+any existing work on Health Hub when you are viewing the help menu!
+
+Format: `help`
+
+The help menu displays a list of available commands for Health Hub, their
+parameters and their functions. Should you ever forget the commands for
+Health Hub, feel free to enter the `help` command to revisit this guide.
+
+
+// tag::listHealthWorker[]
+=== Showing all requests/health workers : `list`
+
+The `list` command is a simple and basic command that on entering, displays
+all health workers/requests in the Health Hub GUI.
+
+Format: `list `
+
+
+==== Showing all health workers
+
+Format: `list healthworker`
+
+*Shortcut(s)*: +
+- `list h` +
+- `list 1`
+
+Upon entering the command to list health workers, all currently registered
+health workers in the Health Hub system will be displayed on the list on the
+right side of the GUI.
+// end::listHealthWorker[]
+
+==== Showing all requests
+
+Format: `list request`
+
+Shortcut(s): +
+- `list r` +
+- `list 2`
+
+After entering the command to list requests, you should see the list on the
+left side of the GUI being populated with all requests that are added to
+HealthHub.
+
+[TIP]
====
-*Command Format*
+This command may be useful for users to identify existing personnel,
+patients or requests in the system before assigning and closing existing
+requests for specific health services.
+====
+
+Example:
+
+* `list healthworker` lists all health workers stored in the system,
+their personal particulars, and their skills in the healthcare field.
+* `list request` lists all requests stored in the system, as well as the
+details of the request such as the patient to tend to, the date and time of
+the request and the type of service requested.
+
+// tag::addHealthWorker[]
+=== Adding requests/health workers: `add`
+
+Before you can jump right into the core feature of our application and
+streamline the process of adding requests from patients and to assign
+requests to experts in the medical field, it is essential to first ensure
+that the respective health staff and patients are registered in the system
+with all the key information.
+
+Add a request, health worker or patient to the application based on the
+`` parameter accepted, using the `add` command, to register new health
+staff, patients and requests. +
+
+Format: `add ...` +
+
+==== *Adding a health worker*
+
+*Format:*
+
+* `add healthworker n/ i/ n/
+o/ s/...`
+
+*Shortcuts:*
+
+* `add h n/ i/ n/
+o/ s/...` +
+* `add 1 n/ i/ n/ o/
+s/...`
+
+Command that registers a new Health Worker person to the current roster.
+Health Workers comprises of personnel who are authorized to work in sectors in the
+healthcare industry in accordance to their `specialisation`.
+
+Health Workers authorized for medical practice specific to their
+`specialisation` include doctors, nurses and community health workers that
+are officially certified by certain medical practices.
+
+Each of the following fields entered by the user following
+each prefix are compulsory, and must adhere to the following format:
+
+* ``: Name must only contain alphanumeric characters and spaces
+, and cannot be empty. E.g Dog Terr
+* ``: NRIC must start with S, T, G or F capitalized, followed by 7
+numeric characters and a capitalized alphabetical character. E.g S1234567A
+* ``: Phone number must only contain 8 numeric characters, and
+ start with a 6, 8 or 9.
+* ``: Organisation that the health worker belongs to.
+Organisation name must have at least 2 characters, and only contain
+alphanumeric characters.
+* ``: Specialisation in the medical field that the health
+worker possesses. The list of valid specialisations are as follows:
+
+** GENERAL_PRACTICE
+** CARDIOLOGY
+** ENDOCRINOLOGY
+** NEUROLOGY
+** ORTHOPAEDIC
+** PAEDIATRIC
+** GYNAECOLOGY
+** UROLOGY
+** PATHOLOGY
+** HAEMATOLOGY
+** PHYSIOTHERAPY
+** OCCUPATIONAL_THERAPY
+** ANAESTHESIOLOGY
-* Words in `UPPER_CASE` are the parameters to be supplied by the user e.g. in `add n/NAME`, `NAME` is a parameter which can be used as `add n/John Doe`.
-* Items in square brackets are optional e.g `n/NAME [t/TAG]` can be used as `n/John Doe t/friend` or as `n/John Doe`.
-* Items with `…` after them can be used multiple times including zero times e.g. `[t/TAG]...` can be used as `{nbsp}` (i.e. 0 times), `t/friend`, `t/friend t/family` etc.
-* Parameters can be in any order e.g. if the command specifies `n/NAME p/PHONE_NUMBER`, `p/PHONE_NUMBER n/NAME` is also acceptable.
+[NOTE]
+====
+The NRIC field provided uniquely identifies the health worker. When entering
+the commands to add or edit a health worker, if the NRIC field matches an
+already existing health worker with the same NRIC field, an error message
+denoting a duplicate worker will be displayed.
====
-=== Viewing help : `help`
+// end::addHealthWorker[]
-Format: `help`
+==== *Adding a request*
+
+*Format:*
-=== Adding a person: `add`
+* `add request n/ a/ i/ p/ dt/ c/...`
-Adds a person to the address book +
-Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]...`
+*Shortcuts:*
+
+* `add r n/ a/ i/ p/ dt/ c/...`
+* `add 2 n/ a/ i/ p/ dt/ c/...`
+
+* Registers a new open request from `patient` of `` into the
+application.
+* Each request also states the `` that the patient is
+experiencing. Administrative staff can then inspect the conditions that are
+stated by the `patient` and assign the appropriate health worker to handle
+these requests in the `assign` command.
+* Format for the time is `HH:mm:ss`, where HH represents the hours in a 24hr clock.
+* Format for the date is `dd-MM-yyyy`.
+* Multiple conditions can be accepted. However, each condition has to be prepended with `c/` tag.
+* Two requests are considered duplicates if they have the same patient NRIC, date, address *and* conditions. Adding duplicate requests are not allowed.
[TIP]
-A person can have any number of tags (including 0)
+The arguments and their respective tags can also be reordered.
Examples:
-* `add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01`
-* `add n/Betsy Crowe t/friend e/betsycrowe@example.com a/Newgate Prison p/1234567 t/criminal`
-=== Listing all persons : `list`
+* `add request n/Pay Shun i/S9123456G a/NUS UTown p/91234567 c/Heart Attack dt/30-01-2019 10:00:00`
+* `add request n/Jin Livingston i/S9123456G a/NUS UTown p/91234567 c/Heart Attack dt/30-01-2019 10:00:00 c/Physiotherapy`
+
+[NOTE]
+====
+If multiple prefixes are provided with valid values for parameters that can
+ only take in a single value, only the value of the last prefix will be
+ accepted. + E.g n/John n/Johnson the name field will be set to Johnson and
+ not John.
+
+Similarly for the `edit` command, in the case with multiple parameters with
+ the same prefix, only the last parameter value will be accepted as the new
+ value for that field.
+====
+
+=== Editing requests/health workers : `edit`
+
+Sometimes, information on a request of health staff may be keyed in wrongly
+into the application, or you may need to update existing outdated information.
+
+To do this, you can replace the current information
+with the new one using the `edit` command to modify existing personnel
+records or request descriptions in Health Hub.
-Shows a list of all persons in the address book. +
-Format: `list`
+The `edit` may come in handy when there is a need update to a request's
+status, patient's condition or a health worker's skills, based on the
+`` parameter accepted. +
-=== Editing a person : `edit`
+The prefixes and valid values for the `edit` command for both health worker
+and request modes follow the same format as in the `add` command.
+
+==== *Editing a health worker*
+
+*Format:*
+
+* `edit healthworker ...`
+
+*Shortcuts:*
+
+* `edit h ...`
+* `edit 1 ...`
+
+Edits the details of an existing health worker registered in Health Hub, at
+the `` specified in the health worker list upon entering the `edit healthworker/h/1` command with valid inputs.
+
+[NOTE]
+====
+* When editing specialisations for health workers, the existing specialisations
+ of the person will be removed i.e adding of specialisation is not cumulative. +
+* Each health worker must have at least one specialisation. Entering an empty
+ value for `s/` prefix would result in the original health worker's `skills`
+ being kept.
+====
+
+[TIP]
+====
+You can remove all the person's specialisation by typing `s/` without
+specifying any parameters after it.
+====
+
+* `edit healthworker 1 p/91234567 n/John Doe` +
+Edits the phone number and name of the 1st health worker shown in the health
+worker list to be `91234567` and `John Doe` respectively. +
+
+// end::editHealthWorker[]
+
+
+==== *Editing a request*
+
+*Format:*
+
+* `edit request ...` +
+E.g `edit request 1 n/NAME p/PHONE a/ADDRESS i/NRIC c/CONDITION dt/DATE_TIME st/STATUS`
+
+*Shortcuts:*
+
+* `edit r ...`
+* `edit 2 ...`
+
+Edits the details of a request registered in Health Hub, at
+the `` specified in the request list upon entering the `edit
+request` command with valid inputs.
+
+Upon entering the `edit` command with all the necessary and valid parameters,
+the corresponding request/health worker at the specified ``. The index refers to the
+index number shown in the displayed person list.
+
+Existing values of the request will be updated to the valid
+input values based on the prefix specified.
+
+Any changes made to existing fields in requests are
+immediately reflected in the list shown on the HealthHub GUI.
+
+{nbsp}
+
+*Notes*:
+
+* The index *must be a positive integer* 1, 2, 3, ...
+and not greater than the number of requests/health workers/patients in the current list.
+
+* Apart from `specialisations` in health workers and `condition` in
+patients, each field can only have a single value and multiple edit values
+for other fields will only cause the last one to be accepted.
+
+* Note that the healthworker cannot be edited using this command. To unassign an existing healthworker, `edit` the status to `PENDING`.
+To change the healthworker assigned, use the `assign` command instead.
+
+* When a request status is changed to pending, any assigned healthworker will be disassigned.
+
+* When changing the request status, there are only 3 valid statuses: PENDING, COMPLETED and ONGOING. Only these statuses will be accepted, and is not case-sensitive.
+
+* Not all the tags need to be specified.
+
+* The tags can be reordered. e.g `edit r 1 n/NAME p/91234567` is the same as `edit r 1 p/91234567 n/NAME`
+
+* Two requests are considered duplicates if they have the same patient NRIC, date, address *and* conditions. Duplicate requests are not allowed.
+
+[WARNING]
+When editing the date of a request, ensure that the date entered is correct. HealthHub accepts any valid calendar dates in the format dd-mm-yyyy HH:mm:ss (where HH represents the time in 24hr format).
-Edits an existing person in the address book. +
-Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]...`
-****
-* Edits the person at the specified `INDEX`. The index refers to the index number shown in the displayed person list. The index *must be a positive integer* 1, 2, 3, ...
-* At least one of the optional fields must be provided.
-* Existing values will be updated to the input values.
-* When editing tags, the existing tags of the person will be removed i.e adding of tags is not cumulative.
-* You can remove all the person's tags by typing `t/` without specifying any tags after it.
-****
Examples:
-* `edit 1 p/91234567 e/johndoe@example.com` +
-Edits the phone number and email address of the 1st person to be `91234567` and `johndoe@example.com` respectively.
-* `edit 2 n/Betsy Crower t/` +
-Edits the name of the 2nd person to be `Betsy Crower` and clears all existing tags.
+* `edit request 2 n/Betsy Crower` +
+* `edit r 2 n/Betsy Crower` +
+* `edit 2 2 n/Betsy Crower` +
+All the 3 commands above edits the patient name of the 2nd request in the request list to be `Betsy
+Crower`. +
+* `edit r 1 n/NAME p/PHONE a/ADDRESS i/NRIC c/CONDITION dt/DATE_TIME st/STATUS`
+
+// tag::filterHealthWorker[]
+=== Filtering health workers/requests: `filter`
+
+When identifying health workers to assign to an open request, or
+to look for a particular patient details in certain requests, it may be useful
+ to only display items in a list that match a particular constraint.
+
+Using the `filter` command, you can set the GUI to display health workers and
+requests whose fields match the `keywords`that are specified in the `filter`
+command, allowing you to find the doctors who are experts in cardiology much quicker. +
+
+Format: `filter []...` +
+
+==== *Filter health workers*:
+
+*Format:*
-=== Locating persons by name: `find`
+* `filter healthworker []`
-Finds persons whose names contain any of the given keywords. +
-Format: `find KEYWORD [MORE_KEYWORDS]`
+*Shortcuts:*
-****
-* The search is case insensitive. e.g `hans` will match `Hans`
-* The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans`
-* Only the name is searched.
-* Only full words will be matched e.g. `Han` will not match `Hans`
-* Persons matching at least one keyword will be returned (i.e. `OR` search). e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang`
-****
+* `filter h []`
+* `filter 1 []`
+
+Upon entering the command with valid inputs, HealthHub searches the entire list
+ of health
+workers in Health Hub, and only displays the health workers whose fields
+contains the parameters specified in the
+`filter` command as a substring.
+
+// tag::filterExample[]
+[TIP]
+====
+* Multiple conditions for filtering health workers can be added
+simultaneously for more expressive search. Note that if multiple parameters
+are specified, HealthHub displays healthworkers that match *all*
+the criteria mentioned. +
+* To revert the view back to the original health worker list, enter the
+ `list healthworker` command.
+====
Examples:
-* `find John` +
-Returns `john` and `John Doe`
-* `find Betsy Tim John` +
-Returns any person having names `Betsy`, `Tim`, or `John`
+* `filter h s/GENERAL_PRACTICE s/GYNAECOLOGY` +
+Returns all health workers whose field of expertise include general practice
+*and* gynaecology.
+// end::filterExample[]
-=== Deleting a person : `delete`
+[NOTE]
+====
+For specialisation fields, parameter values need not follow the exact format as
+the valid specialisation values provided under the `add` command section.
+Valid parameters may include case insensitive substrings (E.g 'physio' will
+match to 'PHYSIOTHERAPY'.
+====
-Deletes the specified person from the address book. +
-Format: `delete INDEX`
+For example, to display only health workers who specialise in physiotherapy,
+the `filter h s/physio` command can entered, using the shortcut `h` for
+health worker mode and the substring `physio` instead for brevity, as shown
+in the image below, in the Before section:
-****
-* Deletes the person at the specified `INDEX`.
-* The index refers to the index number shown in the displayed person list.
-* The index *must be a positive integer* 1, 2, 3, ...
-****
+image::filter_healthworker_UG.png[]
+
+When the command is keyed into the application, HealthHub will display the
+state shown by the After section on the right side on the image above. The
+command terminal displays a message denoting how many health workers are
+found that has `PHYSIOTHERAPY` as a specialisation, and the health worker
+list on the right side of the GUI displays only health workers who has
+expertise in physiotherapy.
+
+// end::filterHealthWorker[]
+==== *Filter requests*:
+
+Format: `filter request []`
+
+Shortcut(s): +
+1. `filter r []` +
+2. `filter 2 []`
+
+where `[ p/`
+filters the request list for requests whose patient's name contains the
+specified name substring *and* the specified phone number.
+====
+
+[TIP]
+====
+To revert the view back to the original request list, enter the `list request` command.
+====
Examples:
-* `list` +
-`delete 2` +
-Deletes the 2nd person in the address book.
-* `find Betsy` +
-`delete 1` +
-Deletes the 1st person in the results of the `find` command.
+* `filter request n/alice` +
+Returns all patients whose name contains "alice".
+* `filter r p/9177` +
+Returns all requests with contacts numbers that have "9177" in it's field.
+* `filter 2 dt/30-01-2019 10:00:00` +
+Returns all requests scheduled on 30th Jan 2019, at 10 am sharp.
+
+// tag::delHealthWorker[]
+=== Deleting requests/health workers : `delete`
+
+Should there be any invalid or expired request, health worker or patient in
+the application, you may also remove them to prevent cluttering of
+unnecessary data by using the `delete` command to remove them from the
+application based on the`` parameter accepted, according to the
+index of the respective `type`
+shown using the `list` command, or the index displayed on the GUI. +
+
+Format: `delete ` +
+
+==== *Delete a health worker*:
+
+*Format:*
+
+* `delete healthworker `
-=== Selecting a person : `select`
+*Shortcuts:*
-Selects the person identified by the index number used in the displayed person list. +
-Format: `select INDEX`
+* `delete h `
+* `delete 1 `
-****
-* Selects the person and loads the Google search page the person at the specified `INDEX`.
-* The index refers to the index number shown in the displayed person list.
-* The index *must be a positive integer* `1, 2, 3, ...`
-****
+Deletes the health worker at the `` position in shown in the health
+worker list.
+// end::delHealthWorker[]
+
+==== *Delete a request*:
+
+*Format:*
+
+* `delete request `
+
+*Shortcuts:*
+
+* `delete r `
+* `delete 2 `
+
+Deletes the request at the `` position in shown in the list of requests.
+
+*Notes*:
+
+* Deletes the corresponding request/health worker/patient at the specified ``.
+* The index refers to the index number shown in the displayed request/health
+worker/patient list using the `list` command, or displayed through the GUI.
+* The index *must be a positive integer* 1, 2, 3, ... and not greater
+than the number of requests/health workers/patients in the current list.
Examples:
-* `list` +
-`select 2` +
-Selects the 2nd person in the address book.
-* `find Betsy` +
-`select 1` +
-Selects the 1st person in the results of the `find` command.
+* `delete healthworker 2` +
+Deletes the 2nd health worker registered in the list of healthworkers in
+Health Hub.
-=== Listing entered commands : `history`
+* `delete request 1` +
+Deletes the 1st request as shown in the list of requests on the GUI of the
+application
+
+[TIP]
+====
+Accidentally deleted the wrong health worker or request? Don't worry, the
+deletion can be undone using the `undo` command as long as the application is
+ still running.
+
+To undo the most recent `delete` command entered by entering the `undo`
+command immediately after the previous `delete` command to undo the deletion.
+====
+
+=== Assigning requests to a health worker : `assign`
+
+After registering a new request using the `add request` command, you may
+proceed to assign an existing health worker in the system to handle the request,
+ allocating medical resources to it and closing the request using the simple
+ `assign` command +
+
+Format: `assign hw/ r/...`
+
+Where the `` and `` are as shown in the
+respective health worker and requests lists in the Health Hub GUI.
+
+*Notes*:
+
+* The `request_index` and `health_worker_index` fields *must be a positive integer* 1, 2, 3, ... and not greater
+than the number of requests/health workers in the current list.
+* The prefix `r/` has to be prepended to all requests indices that you would like to assign.
+* Health worker that is assigned must be available at the current time stated by the request.
+
+Examples:
+
+* `assign r/1 hw/2` +
+Assigns the health worker at the second index to the first request in the
+request list. +
+* `assign r/1 r/2 hw/2` +
+Assigns the requests at the first and second request on the request list to the 2nd health worker in the healthworker list.
-Lists all the commands that you have entered in reverse chronological order. +
-Format: `history`
[NOTE]
====
-Pressing the kbd:[↑] and kbd:[↓] arrows will display the previous and next input respectively in the command box.
+* Healthworkers cannot be assigned to a completed request. To assign a healthworker to a request that is already completed,
+use `edit` to change the status of the request to pending first. +
+* You can reorder the parameters of the request and the healthworker. For example, executing `assign r/1 hw/2` has the same as
+executing `assign hw/2 r/1` +
+* Requests have to be at least 2 hours apart. i.e Healthworkers cannot be assigned to 2 requests that are less than 2 hours apart.
+====
+
+=== Clearing Requests : `clr`
+
+After closing all existing requests, you also have the option of clearing all
+ requests from the request list, regardless of the state of the request, upon
+ entering the `clr` command.
+
+Format: `clr`
+
+[WARNING]
====
+Clearing requests would delete all records of completed and pending requests.
+
+If you would like to delete just one particular request, consider using the
+`delete` command instead.
+====
+
+=== Closing Requests : `complete`
+
+After an assigned task has been completed by the assigned health staff, who
+has administered the necessary medical treatment, you can mark the request as
+ closed, using the `complete` command.
+
+Format: `complete `
+
+Upon entering the `complete` command, you should notice the status of the
+request at position `` changed to `COMPLETED`, marking the
+request closed.
+
+*Notes*:
+
+* The `request_index` *must be a positive integer* 1, 2, 3, ... and not greater
+than the number of requests in the current list.
+* The `complete` command can only be used on *ongoing* requests. To complete a pending request, use the `edit` command to change the status of the request.
+
+Examples:
+
+* `complete 1` +
+Marks the first request in the list as completed.
// tag::undoredo[]
-=== Undoing previous command : `undo`
+=== Undoing Commands : `undo`
+If you wish to undo a mistake that you had made while entering commands,
+you can restore the lists to the state before the command was called using the `undo` command.
-Restores the address book to the state before the previous _undoable_ command was executed. +
Format: `undo`
[NOTE]
====
-Undoable commands: those commands that modify the address book's content (`add`, `delete`, `edit` and `clear`).
+* The `undo` command can only be used to undo commands that modify the lists such as `add`, `delete` and `edit`.
+* For commands that affects the display such as `filter`, you can use `list` command to get back the original list.
====
-Examples:
+=== Redoing undone commands : `redo`
+If you wish to redo a command that you have previously undone, you can use the `redo` command.
-* `delete 1` +
-`list` +
-`undo` (reverses the `delete 1` command) +
+Format: `redo`
-* `select 1` +
-`list` +
-`undo` +
-The `undo` command fails as there are no undoable commands executed previously.
-* `delete 1` +
-`clear` +
-`undo` (reverses the `clear` command) +
-`undo` (reverses the `delete 1` command) +
+// end::undoredo[]
+=== Listing previous commands : `history`
-=== Redoing the previously undone command : `redo`
+In the case where you have been using the application for a while now, and
+wish to track and see the past commands that you have entered into the
+application, or where you have taken over the application from another
+person, you can do so using the `history` command. +
-Reverses the most recent `undo` command. +
-Format: `redo`
+Using the `history` command, you can view the previous commands entered in
+the application in chronological order, allowing you to identify the order in
+ which commands are keyed in previously.
-Examples:
+Format: `history` +
-* `delete 1` +
-`undo` (reverses the `delete 1` command) +
-`redo` (reapplies the `delete 1` command) +
+[NOTE]
+====
+Pressing the kbd:[↑] and kbd:[↓] arrows will display the previous and next input respectively in the command box.
+====
-* `delete 1` +
-`redo` +
-The `redo` command fails as there are no `undo` commands executed previously.
-* `delete 1` +
-`clear` +
-`undo` (reverses the `clear` command) +
-`undo` (reverses the `delete 1` command) +
-`redo` (reapplies the `delete 1` command) +
-`redo` (reapplies the `clear` command) +
-// end::undoredo[]
+=== Viewing a request : `select`
+
+With the flexibility in managing and adding, editing and deleting requests,
+existing functionality for the user to view the details of requests in
+Health Hub has also been implemented to improve the user experience.
+
+Format: `select `
+
+Shortcut: `sr `
+
+Entering the `select` command allows the application to select the request at the
+ specified ``, and displays the full details of the selected
+ request on the GUI.
-=== Clearing all entries : `clear`
+[TIP]
+====
+Users also have the option of clicking on a request in the request list on
+the GUI, which automatically selects the clicked request as the displayed
+request.
+====
+
+// tag::setreminder[]
+=== Setting Reminder Alerts: `setreminder`
+
+Sometimes when you have too many tasks at hand, it can be quite cumbersome to remember what tasks you need to
+complete for the day. You might want to phone up a patient to remind him of an appointment before the health worker
+visits his home, because you recall that this patient was not at home the last time the health worker visited. The
+phone call from you can prepare him to be at his home when the health worker arrives, so he can provide the necessary
+health care services. It can also remind you when it is lunch time, so you can avoid the peak period!
-Clears all entries from the address book. +
-Format: `clear`
+Format: `setreminder t/ m/` +
+
+Using the `setreminder` command, you can set a reminder alert to notify you at a certain time of the day, with your
+own message that you can customise to remind yourself.
+
+[NOTE]
+====
+The alert only shows for when Health Hub is running in the background process.
+====
+
+In the example below, a reminder has been set to notify the user at 6.30PM with
+the customised message to "to call patient Tan Ah Hock for his appointment later at night".
+
+image::SetReminderCommandTextField.png[]
+Figure 5.14.1 shows the format of the `setreminder` command in the text field.
+
+image::SetReminderResult.png[]
+Figure 5.14.2 shows the result of the reminder alert in the GUI after it is time for the app to notify the user.
+// end::setreminder[]
+
+// tag::statistics[]
+=== Getting health condition statistics: `statistics`
+
+We understand that it is imperative for you to know which health conditions have been seeing an increasing trend, as
+well as take note of those which have been experiencing a decline. The `statistics` command allows you to view all
+health conditions that have been registered on HealthHub, and also their respective numbers of occurrences.
+
+Format: `statistics` -> this command displays a list of all health conditions that you have typed into HealthHub, and
+shows each health condition’s related number of occurrences.
+
+[NOTE]
+====
+`statistics` will only show any useful information related to frequency of health conditions after you have added at least
+1 request for homecare on HealthHub. If there are no homecare requests made, the statistics panel will display the
+following:
+====
+
+image::empty_statistics.PNG[]
+
+Example of usage:
+
+Let’s say that no commands have been issued yet and HealthHub is on a clean slate with no prior records of requests.
+Suppose as an administrative staff, you input the following commands as your first 2 requests for home care into
+HealthHub:
+
+`add request n/John Doe i/S8974421C p/98765432 a/123 Brick Road, #01-01 dt/01-01-2019 14:50:00 c/Diabetes
+c/Physiotherapy`
+
+`add request n/Dohn Joe i/S9874421C p/98675432 a/Sheares Hall, #01-01 dt/06-05-2019 10:10:00 c/AIDS c/Physiotherapy`
+
+You can then subsequently type in the following command:
+
+`statistics`
+
+Voila! A list of health conditions (namely, the ones which were typed in the 2 abovementioned requests Physiotherapy,
+Diabetes, AIDS) will be generated and will be displayed in descending order of occurrences. The following screen is what
+you can expect to see after typing in the 3 commands.
+
+image::normal_statistics.PNG[]
+
+==== Updating of statistics
+
+Every time you decide to add a request, edit a request, delete a request or even undo and redo a request, it is
+important that the statistics display automatically keeps updating itself so that real-time accurate data is always
+showed whenever you type in `statistics`
+
+Example of usage:
+
+Let’s assume you still have the requests of John Doe and Dohn Joe (requests that you had placed into HealthHub from the
+previous section) in the request panel. You just received news that John Doe’s mobility has miraculously improved and
+you no longer need to tag him with the ‘Physiotherapy’ health condition in his health request record. You, thus, decided
+to edit John Doe’s health conditions from Diabetes and Physiotherapy to just Diabetes by issuing the following command:
+
+`edit r 1 c/Diabetes`
+
+image::statistics_before_edit.PNG[]
+
+You can then subsequently type in the following command to gather accurate statistical data,
+which reflects the deletion of one of the ‘Physiotherapy’ health conditions:
+
+`statistics`
+
+image::statistics_after_edit.PNG[]
+
+After issuing the aforementioned commands, you now receive news that John Doe had not really recovered entirely yet,
+and he still requires Physiotherapy treatment. Fret not! You can always issue the `undo` command to revert your changes to
+John’s earlier set of health conditions (Physiotherapy and Diabetes) and then the `statistics` command to view the new
+data.
+
+In essence, the `statistics` command is fully integrated with all request-related commands (`add`, `edit`, `delete`,
+`undo`, `redo`, `clr`) in its pursuit of always providing accurate, real-time statistical information.
+
+==== Application of `statistics` in the workplace
+
+Upon collating such data, you can feedback and make suggestions to the hospital to increase or decrease training in
+certain departments. Furthermore, you can even use this data as a basis for the health sector to ramp up efforts in its
+Work Skills Qualification certification for certain healthcare skills to be taught to new aspiring healthcare
+professionals.
+
+// end::statistics[]
=== Exiting the program : `exit`
-Exits the program. +
+Once you are done using the application, you can exit the application by
+entering the `exit` command, hereby saving any information at the current
+point in time before shutting down. +
+
Format: `exit`
=== Saving the data
-Address book data are saved in the hard disk automatically after any command that changes the data. +
-There is no need to save manually.
+All application data are saved in the hard disk automatically after exiting
+the application, removing the need to save manually. +
-// tag::dataencryption[]
-=== Encrypting data files `[coming in v2.0]`
+Changes to the data in the application are also saved that any command that
+modifies application parameters, making sure that minimal data is lost should
+any unforeseen circumstances happen.
-_{explain how the user can enable/disable data encryption}_
-// end::dataencryption[]
+Attempting to read a corrupted data file will show an empty book.
+If the application is unable to find any data files, it will create books based on its sample data.
== FAQ
*Q*: How do I transfer my data to another Computer? +
-*A*: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous Address Book folder.
+*A*: Install the app in another computer, and transfer the data files `healthworkerbook.json` and `requestbook.json`
+to the `\data` folder of the app directory.
+// tag::summary[]
== Command Summary
-* *Add* `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]...` +
-e.g. `add n/James Ho p/22224444 e/jamesho@example.com a/123, Clementi Rd, 1234665 t/friend t/colleague`
-* *Clear* : `clear`
-* *Delete* : `delete INDEX` +
-e.g. `delete 3`
-* *Edit* : `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]...` +
-e.g. `edit 2 n/James Lee e/jameslee@example.com`
-* *Find* : `find KEYWORD [MORE_KEYWORDS]` +
-e.g. `find James Jake`
-* *List* : `list`
-* *Help* : `help`
-* *Select* : `select INDEX` +
-e.g.`select 2`
-* *History* : `history`
-* *Undo* : `undo`
-* *Redo* : `redo`
+[%header, cols=4*]
+|===
+|Base Command
+|Additional Parameters
+|Description
+|Remarks
+
+|`help`
+|_not applicable_
+|opens the user guide in a new window
+|_none_
+|`list healthworker/h/1` +
+
+`list request/r/2`
+|_not applicable_
+|lists all the health workers or requests
+|_none_
+|`add healthworker/h/1`
+|`n/ (name)` - required +
+ `i/ (nric)` - required +
+ `p/ (phone)` - required +
+ `o/ (organisation)` - required +
+ `s/ (specialisations)` - required
+|registers a health worker into the system
+|_none_
+|`add request/r/2`
+|`n/ (name)` - required +
+ `i/ (nric)` - required +
+ `p/ (phone)` - required +
+ `a/ (address)` - required +
+ `dt/ (request date)` - required +
+ `c/ (patient conditions)` - required
+|registers a request into the system
+|_none_
+|`edit`
+|any of the tags above (i.e. edit `n/` or `dt/` or `c/`)
+|edits the details of a request or a health worker
+|_none_
+|`filter healthworker/h/1`
+|any of the tags above belonging to health worker (i.e. filter by `n/` or `o/` or `s/`)
+|filters through the list of health workers by a criteria
+|_none_
+|`filter request/r/2`
+|any of the tags above belonging to request (i.e. filter by `n/` or `dt/` or `c/`). +
+
+new filterable tag after request is added - `st/ (request status)`
+|filters through the list of requests by a criteria
+|_none_
+|`delete request`
+|`INDEX` of request to delete
+|deletes a request
+|_none_
+|`assign`
+|`hw/` - `INDEX` of the health worker to be assigned, required +
+
+`r/` - `INDEX` of the request, required
+|assigns a health worker to an open request
+|should a health worker be assigned to requests on the same date and time, it should be at least 2 hours apart.
+|`complete`
+|`INDEX` of the request to close
+|closes an ongoing request after it has been completed by the assigned staff
+|only used for requests that have the *ONGOING* status
+
+|`clr`
+|_not applicable_
+|clears all *COMPLETED* requests from the list
+|_none_
+|`history`
+|_not applicable_
+|lists the previous commands entered in chronological order
+|_none_
+|`sr`
+|`INDEX` of request to display
+|selects a request and display its details on the UI
+|_none_
+|`setreminder`
+|`t/` - time to schedule, required +
+
+`m/` - customised message, required
+|sets a reminder alert to notify the user at a certain time of the day
+|the alert will show only if Health Hub is still running
+|`statistics`
+|_not applicable_
+|shows the occurences of the different requests by conditions
+|_none_
+|`undo`
+|_not applicable_
+|undos the previous action
+|_none_
+|`redo`
+|_not applicable_
+|redos the previous undone command
+|_none_
+|===
+// end::summary[]
diff --git a/docs/diagrams/AddRequestCommandSequenceDiagram.pptx b/docs/diagrams/AddRequestCommandSequenceDiagram.pptx
new file mode 100644
index 000000000000..81ef8b9854af
Binary files /dev/null and b/docs/diagrams/AddRequestCommandSequenceDiagram.pptx differ
diff --git a/docs/diagrams/FilterRequestCommand.pptx b/docs/diagrams/FilterRequestCommand.pptx
new file mode 100644
index 000000000000..97984f1aadc2
Binary files /dev/null and b/docs/diagrams/FilterRequestCommand.pptx differ
diff --git a/docs/diagrams/LogicComponentClassDiagram.pptx b/docs/diagrams/LogicComponentClassDiagram.pptx
index 6fcc1136a5bb..d864ff7d3f1f 100644
Binary files a/docs/diagrams/LogicComponentClassDiagram.pptx and b/docs/diagrams/LogicComponentClassDiagram.pptx differ
diff --git a/docs/diagrams/LogicComponentSequenceDiagram.pptx b/docs/diagrams/LogicComponentSequenceDiagram.pptx
index 410277bbd866..c1c5d88e63ea 100644
Binary files a/docs/diagrams/LogicComponentSequenceDiagram.pptx and b/docs/diagrams/LogicComponentSequenceDiagram.pptx differ
diff --git a/docs/diagrams/SetReminderCommandSequenceDiagram.pptx b/docs/diagrams/SetReminderCommandSequenceDiagram.pptx
new file mode 100644
index 000000000000..dc362b5fe8c4
Binary files /dev/null and b/docs/diagrams/SetReminderCommandSequenceDiagram.pptx differ
diff --git a/docs/diagrams/UiComponentClassDiagram.pptx b/docs/diagrams/UiComponentClassDiagram.pptx
index ab325e889f70..e771f3a70a80 100644
Binary files a/docs/diagrams/UiComponentClassDiagram.pptx and b/docs/diagrams/UiComponentClassDiagram.pptx differ
diff --git a/docs/images/AutoCompleteTextFieldSMD.png b/docs/images/AutoCompleteTextFieldSMD.png
new file mode 100644
index 000000000000..f4058481c8e9
Binary files /dev/null and b/docs/images/AutoCompleteTextFieldSMD.png differ
diff --git a/docs/images/FilterCommandParserLogicSD.png b/docs/images/FilterCommandParserLogicSD.png
new file mode 100644
index 000000000000..feaf0bbae2bd
Binary files /dev/null and b/docs/images/FilterCommandParserLogicSD.png differ
diff --git a/docs/images/FilterHealthWorkerSD.png b/docs/images/FilterHealthWorkerSD.png
new file mode 100644
index 000000000000..95c30c5212b5
Binary files /dev/null and b/docs/images/FilterHealthWorkerSD.png differ
diff --git a/docs/images/HealthHub.png b/docs/images/HealthHub.png
new file mode 100644
index 000000000000..ada019914161
Binary files /dev/null and b/docs/images/HealthHub.png differ
diff --git a/docs/images/SetReminderCommandTextField.png b/docs/images/SetReminderCommandTextField.png
new file mode 100644
index 000000000000..f4686ebb4b3c
Binary files /dev/null and b/docs/images/SetReminderCommandTextField.png differ
diff --git a/docs/images/SetReminderResult.png b/docs/images/SetReminderResult.png
new file mode 100644
index 000000000000..f931c2f43d98
Binary files /dev/null and b/docs/images/SetReminderResult.png differ
diff --git a/docs/images/SetReminderSequenceDiagram.png b/docs/images/SetReminderSequenceDiagram.png
new file mode 100644
index 000000000000..0292d0dedca2
Binary files /dev/null and b/docs/images/SetReminderSequenceDiagram.png differ
diff --git a/docs/images/StorageClassDiagram.png b/docs/images/StorageClassDiagram.png
index e5527ecac459..be64f6ce8cb0 100644
Binary files a/docs/images/StorageClassDiagram.png and b/docs/images/StorageClassDiagram.png differ
diff --git a/docs/images/Ui.png b/docs/images/Ui.png
index 5ec9c527b49c..a78a47397b2a 100644
Binary files a/docs/images/Ui.png and b/docs/images/Ui.png differ
diff --git a/docs/images/UiClassDiagram.png b/docs/images/UiClassDiagram.png
index 5f3847621e07..c13ba46e3005 100644
Binary files a/docs/images/UiClassDiagram.png and b/docs/images/UiClassDiagram.png differ
diff --git a/docs/images/Ui_home.png b/docs/images/Ui_home.png
new file mode 100644
index 000000000000..ecac2302cbf1
Binary files /dev/null and b/docs/images/Ui_home.png differ
diff --git a/docs/images/Ui_home_orange.png b/docs/images/Ui_home_orange.png
new file mode 100644
index 000000000000..9458cd203212
Binary files /dev/null and b/docs/images/Ui_home_orange.png differ
diff --git a/docs/images/UndoRedoActDiagram.png b/docs/images/UndoRedoActDiagram.png
new file mode 100644
index 000000000000..ecd4770ee63a
Binary files /dev/null and b/docs/images/UndoRedoActDiagram.png differ
diff --git a/docs/images/UndoRedoActivityDiagram.png b/docs/images/UndoRedoActivityDiagram.png
deleted file mode 100644
index 55e4138cc64f..000000000000
Binary files a/docs/images/UndoRedoActivityDiagram.png and /dev/null differ
diff --git a/docs/images/UndoRedoSeqDiagram.png b/docs/images/UndoRedoSeqDiagram.png
new file mode 100644
index 000000000000..37589432a4a5
Binary files /dev/null and b/docs/images/UndoRedoSeqDiagram.png differ
diff --git a/docs/images/UndoRedoSequenceDiagram.png b/docs/images/UndoRedoSequenceDiagram.png
deleted file mode 100644
index 5c9d5936f098..000000000000
Binary files a/docs/images/UndoRedoSequenceDiagram.png and /dev/null differ
diff --git a/docs/images/addHwRequestDates.png b/docs/images/addHwRequestDates.png
new file mode 100644
index 000000000000..490248f02e63
Binary files /dev/null and b/docs/images/addHwRequestDates.png differ
diff --git a/docs/images/addrequest.png b/docs/images/addrequest.png
new file mode 100644
index 000000000000..d564f430756e
Binary files /dev/null and b/docs/images/addrequest.png differ
diff --git a/docs/images/addrequestcommand.png b/docs/images/addrequestcommand.png
new file mode 100644
index 000000000000..f64562b1eb50
Binary files /dev/null and b/docs/images/addrequestcommand.png differ
diff --git a/docs/images/assignRegionCheck.png b/docs/images/assignRegionCheck.png
new file mode 100644
index 000000000000..3a7c7c95421d
Binary files /dev/null and b/docs/images/assignRegionCheck.png differ
diff --git a/docs/images/assignReqToHw.png b/docs/images/assignReqToHw.png
new file mode 100644
index 000000000000..c929b5653807
Binary files /dev/null and b/docs/images/assignReqToHw.png differ
diff --git a/docs/images/assignreq.png b/docs/images/assignreq.png
new file mode 100644
index 000000000000..d23ea5def09f
Binary files /dev/null and b/docs/images/assignreq.png differ
diff --git a/docs/images/assignreq1.png b/docs/images/assignreq1.png
new file mode 100644
index 000000000000..288d1e4c6c92
Binary files /dev/null and b/docs/images/assignreq1.png differ
diff --git a/docs/images/assignreq2.png b/docs/images/assignreq2.png
new file mode 100644
index 000000000000..8a9a0c729682
Binary files /dev/null and b/docs/images/assignreq2.png differ
diff --git a/docs/images/assignrequest.png b/docs/images/assignrequest.png
new file mode 100644
index 000000000000..546ca9e9429d
Binary files /dev/null and b/docs/images/assignrequest.png differ
diff --git a/docs/images/assignrequest1.png b/docs/images/assignrequest1.png
new file mode 100644
index 000000000000..41476fa3178a
Binary files /dev/null and b/docs/images/assignrequest1.png differ
diff --git a/docs/images/brohandev.png b/docs/images/brohandev.png
new file mode 100644
index 000000000000..26f2d880ee4b
Binary files /dev/null and b/docs/images/brohandev.png differ
diff --git a/docs/images/checkConflictingRequests.png b/docs/images/checkConflictingRequests.png
new file mode 100644
index 000000000000..cd06364dcc91
Binary files /dev/null and b/docs/images/checkConflictingRequests.png differ
diff --git a/docs/images/damithc.jpg b/docs/images/damithc.jpg
deleted file mode 100644
index 127543883893..000000000000
Binary files a/docs/images/damithc.jpg and /dev/null differ
diff --git a/docs/images/daviddl9.png b/docs/images/daviddl9.png
new file mode 100644
index 000000000000..44a748215cef
Binary files /dev/null and b/docs/images/daviddl9.png differ
diff --git a/docs/images/empty_statistics.PNG b/docs/images/empty_statistics.PNG
new file mode 100644
index 000000000000..0b1d2d0169e9
Binary files /dev/null and b/docs/images/empty_statistics.PNG differ
diff --git a/docs/images/filterResult.png b/docs/images/filterResult.png
new file mode 100644
index 000000000000..862e436f813c
Binary files /dev/null and b/docs/images/filterResult.png differ
diff --git a/docs/images/filter_healthworker_UG.png b/docs/images/filter_healthworker_UG.png
new file mode 100644
index 000000000000..3b9ecaddcef9
Binary files /dev/null and b/docs/images/filter_healthworker_UG.png differ
diff --git a/docs/images/filterrequest.png b/docs/images/filterrequest.png
new file mode 100644
index 000000000000..ea77361ca658
Binary files /dev/null and b/docs/images/filterrequest.png differ
diff --git a/docs/images/filterrequestafter.png b/docs/images/filterrequestafter.png
new file mode 100644
index 000000000000..a71c23b07dfa
Binary files /dev/null and b/docs/images/filterrequestafter.png differ
diff --git a/docs/images/filterrequestbefore.png b/docs/images/filterrequestbefore.png
new file mode 100644
index 000000000000..56668cf3fa43
Binary files /dev/null and b/docs/images/filterrequestbefore.png differ
diff --git a/docs/images/filterrequestcommand.png b/docs/images/filterrequestcommand.png
new file mode 100644
index 000000000000..1a7798b8e90a
Binary files /dev/null and b/docs/images/filterrequestcommand.png differ
diff --git a/docs/images/hbafteradd.png b/docs/images/hbafteradd.png
new file mode 100644
index 000000000000..320b40d77cca
Binary files /dev/null and b/docs/images/hbafteradd.png differ
diff --git a/docs/images/hbafterclear.png b/docs/images/hbafterclear.png
new file mode 100644
index 000000000000..e68ca4051ab5
Binary files /dev/null and b/docs/images/hbafterclear.png differ
diff --git a/docs/images/hbafterdel.png b/docs/images/hbafterdel.png
new file mode 100644
index 000000000000..5daaebf5e202
Binary files /dev/null and b/docs/images/hbafterdel.png differ
diff --git a/docs/images/hbafterundo.png b/docs/images/hbafterundo.png
new file mode 100644
index 000000000000..c036007c530c
Binary files /dev/null and b/docs/images/hbafterundo.png differ
diff --git a/docs/images/hbstate1.png b/docs/images/hbstate1.png
new file mode 100644
index 000000000000..efea580223c6
Binary files /dev/null and b/docs/images/hbstate1.png differ
diff --git a/docs/images/huichun66.png b/docs/images/huichun66.png
new file mode 100644
index 000000000000..e9712b0a4ba0
Binary files /dev/null and b/docs/images/huichun66.png differ
diff --git a/docs/images/inithb.png b/docs/images/inithb.png
new file mode 100644
index 000000000000..31880458609b
Binary files /dev/null and b/docs/images/inithb.png differ
diff --git a/docs/images/initmodifycommandhistory.png b/docs/images/initmodifycommandhistory.png
new file mode 100644
index 000000000000..9d28c7800d93
Binary files /dev/null and b/docs/images/initmodifycommandhistory.png differ
diff --git a/docs/images/initrb.png b/docs/images/initrb.png
new file mode 100644
index 000000000000..d9998c28b29d
Binary files /dev/null and b/docs/images/initrb.png differ
diff --git a/docs/images/jing1324.png b/docs/images/jing1324.png
new file mode 100644
index 000000000000..1468571aca17
Binary files /dev/null and b/docs/images/jing1324.png differ
diff --git a/docs/images/lejolly.jpg b/docs/images/lejolly.jpg
deleted file mode 100644
index 2d1d94e0cf5d..000000000000
Binary files a/docs/images/lejolly.jpg and /dev/null differ
diff --git a/docs/images/logicclassdiag.png b/docs/images/logicclassdiag.png
new file mode 100644
index 000000000000..667bb0747bd5
Binary files /dev/null and b/docs/images/logicclassdiag.png differ
diff --git a/docs/images/logicseqdiagram.png b/docs/images/logicseqdiagram.png
new file mode 100644
index 000000000000..0bc4c006c00a
Binary files /dev/null and b/docs/images/logicseqdiagram.png differ
diff --git a/docs/images/lookuz.png b/docs/images/lookuz.png
new file mode 100644
index 000000000000..494871f5bdfb
Binary files /dev/null and b/docs/images/lookuz.png differ
diff --git a/docs/images/m133225.jpg b/docs/images/m133225.jpg
deleted file mode 100644
index fd14fb94593a..000000000000
Binary files a/docs/images/m133225.jpg and /dev/null differ
diff --git a/docs/images/mchafteradd.png b/docs/images/mchafteradd.png
new file mode 100644
index 000000000000..be56f81ef1f5
Binary files /dev/null and b/docs/images/mchafteradd.png differ
diff --git a/docs/images/mchafterdelete.png b/docs/images/mchafterdelete.png
new file mode 100644
index 000000000000..204d26c725fa
Binary files /dev/null and b/docs/images/mchafterdelete.png differ
diff --git a/docs/images/mchafteroverride.png b/docs/images/mchafteroverride.png
new file mode 100644
index 000000000000..084b88cf0ee5
Binary files /dev/null and b/docs/images/mchafteroverride.png differ
diff --git a/docs/images/mchafterundo.png b/docs/images/mchafterundo.png
new file mode 100644
index 000000000000..390dc03c3bef
Binary files /dev/null and b/docs/images/mchafterundo.png differ
diff --git a/docs/images/modelUmlDiagram.png b/docs/images/modelUmlDiagram.png
new file mode 100644
index 000000000000..44db6fbea871
Binary files /dev/null and b/docs/images/modelUmlDiagram.png differ
diff --git a/docs/images/normal_statistics.PNG b/docs/images/normal_statistics.PNG
new file mode 100644
index 000000000000..d96ac28c9ae0
Binary files /dev/null and b/docs/images/normal_statistics.PNG differ
diff --git a/docs/images/rbafterdelete.png b/docs/images/rbafterdelete.png
new file mode 100644
index 000000000000..05c2f2654305
Binary files /dev/null and b/docs/images/rbafterdelete.png differ
diff --git a/docs/images/rbafterlist.png b/docs/images/rbafterlist.png
new file mode 100644
index 000000000000..02d7c0bb40e1
Binary files /dev/null and b/docs/images/rbafterlist.png differ
diff --git a/docs/images/rbstate1.png b/docs/images/rbstate1.png
new file mode 100644
index 000000000000..d8d05653c7a6
Binary files /dev/null and b/docs/images/rbstate1.png differ
diff --git a/docs/images/reminder_command.png b/docs/images/reminder_command.png
new file mode 100644
index 000000000000..72613a4baf50
Binary files /dev/null and b/docs/images/reminder_command.png differ
diff --git a/docs/images/rohan_brief_overview.PNG b/docs/images/rohan_brief_overview.PNG
new file mode 100644
index 000000000000..16de2694dcee
Binary files /dev/null and b/docs/images/rohan_brief_overview.PNG differ
diff --git a/docs/images/rohan_first_stats_display.PNG b/docs/images/rohan_first_stats_display.PNG
new file mode 100644
index 000000000000..8c466004a806
Binary files /dev/null and b/docs/images/rohan_first_stats_display.PNG differ
diff --git a/docs/images/rohan_patient_profile.PNG b/docs/images/rohan_patient_profile.PNG
new file mode 100644
index 000000000000..40be3b1e343f
Binary files /dev/null and b/docs/images/rohan_patient_profile.PNG differ
diff --git a/docs/images/statistics_activity_diagram.png b/docs/images/statistics_activity_diagram.png
new file mode 100644
index 000000000000..d3579a267ae0
Binary files /dev/null and b/docs/images/statistics_activity_diagram.png differ
diff --git a/docs/images/statistics_after_edit.PNG b/docs/images/statistics_after_edit.PNG
new file mode 100644
index 000000000000..41b6815352a7
Binary files /dev/null and b/docs/images/statistics_after_edit.PNG differ
diff --git a/docs/images/statistics_before_edit.PNG b/docs/images/statistics_before_edit.PNG
new file mode 100644
index 000000000000..f82f2a0736e6
Binary files /dev/null and b/docs/images/statistics_before_edit.PNG differ
diff --git a/docs/images/statistics_command.png b/docs/images/statistics_command.png
new file mode 100644
index 000000000000..f303d996b1a2
Binary files /dev/null and b/docs/images/statistics_command.png differ
diff --git a/docs/images/statistics_command_desc.png b/docs/images/statistics_command_desc.png
new file mode 100644
index 000000000000..d26c40b78b41
Binary files /dev/null and b/docs/images/statistics_command_desc.png differ
diff --git a/docs/images/statistics_command_sequence.jpg b/docs/images/statistics_command_sequence.jpg
new file mode 100644
index 000000000000..6ba60c62cf33
Binary files /dev/null and b/docs/images/statistics_command_sequence.jpg differ
diff --git a/docs/images/statistics_command_sequence.png b/docs/images/statistics_command_sequence.png
new file mode 100644
index 000000000000..edf9954d5900
Binary files /dev/null and b/docs/images/statistics_command_sequence.png differ
diff --git a/docs/images/yijinl.jpg b/docs/images/yijinl.jpg
deleted file mode 100644
index adbf62ad9406..000000000000
Binary files a/docs/images/yijinl.jpg and /dev/null differ
diff --git a/docs/images/yl_coder.jpg b/docs/images/yl_coder.jpg
deleted file mode 100644
index 17b48a732272..000000000000
Binary files a/docs/images/yl_coder.jpg and /dev/null differ
diff --git a/docs/team/brohandev.adoc b/docs/team/brohandev.adoc
new file mode 100644
index 000000000000..63d860fb3d7d
--- /dev/null
+++ b/docs/team/brohandev.adoc
@@ -0,0 +1,320 @@
+= Rohan Dev - Project Portfolio
+:site-section: AboutUs
+:imagesDir: ../images
+:stylesDir: ../stylesheets
+
+== Introduction
+
+Hello there! I am Rohan Dev, a Year 2 Computer Science undergraduate from the National University of Singapore (NUS).
+This portfolio documents the contributions I have made to Project HealthHub over the course of an academic semester.
+HealthHub has exposed me to making contributions to a pre-existing code base and morphing it into a desktop application
+of our choice. I have picked up many relevant skills and software engineering principles en route to completing this
+project.
+
+== HealthHub
+
+=== Problem needing to be solved
+
+With the number of elderly slated to reach 900,000 by 2030 resulting in an increasing need for Intermediate and
+Long-Term Care (ILTC) services, it comes as no surprise that the amount of documentation for these patients is also
+increasing rapidly. Furthermore, from our research, it had been brought to our attention that almost all records for
+homecare patients are being done on pen and paper, resulting in slower assignment of homecare jobs to the health
+professionals. The hospital administrative staff we spoke to even mentioned that the excessive paperwork contributes to
+an excessive number of binders being used and a permanent state of chaos and clutter on their desks. My team and I saw
+this as an opportunity to really come up with something relevant and helpful to the healthcare scene in Singapore and
+thus, HealthHub was born.
+
+== Brief Overview of HealthHub
+
+image::rohan_brief_overview.PNG[]
+
+HealthHub is a robust desktop application designed to be a centralized platform for hospital administrative staff to
+efficiently manage the assignment of health workers (doctors/nurses/volunteers with relevant certification) to homecare
+patients and monitor their statuses at their respective jobs. The digitization of the homecare job assignment process
+significantly reduces paperwork and allows for far more organization of information.
+
+HealthHub users interact through the Command Line Interface (CLI) and receive visual feedback through a User Interface
+(UI) created with JavaFX. It is written in Java. The features and implementations are well documented in guides for
+users and developers respectively. HealthHub has been well maintained with high code quality and coverage as it is
+covered by rigorous tests and checks.
+
+=== My Role
+
+My role was to facilitate the computation and display of statistics related to the occurrences of all health conditions
+on the HealthHub platform. Since the statistics feature needs to calculate each health condition’s frequency across all
+users on HealthHub, I also constructed the base Java class for Condition, such that the administrator can type in a
+patient’s health condition or homecare requirement (for e.g. ‘Cancer’, ‘Palliative’, ‘Physiotherapy’ and more) when
+adding a request for homecare, and the statistics feature adds to its specific number of occurrences. In addition, I
+wrote rigorous tests and test utilities to ensure reliability and simple maintenance.
+
+== Summary of contributions
+
+* *Major enhancement*: Adding the *ability to view the most common health conditions* amongst patients registered on HealthHub
+
+image::rohan_first_stats_display.PNG[]
+
+** *What it does*: allows the administrative staff to call for the frequencies of all health conditions registered on HealthHub. It can also call the frequency of a specific health condition in descending order. Calling the statistics command specific to a particular condition will likewise display the number of occurrences of that health condition.
+** *Justification*: It is imperative for the health administrators to know which health conditions have been seeing an increasing trend, as well as take note of those which have been experiencing a decline. Upon collating such data, the administrative staff can feedback and make suggestions to the hospital to increase or decrease training in certain departments. The staff can even suggest to the government to ramp up efforts in its Work Skills Qualification certification for certain healthcare skills to be taught to new aspiring healthcare professionals.
+** *Highlights*: The statistics feature needs to be able to ensure that the administrative staff can extract relevant information as fast as possible. Therefore, the TreeMap data structure was used to contain all occurrences of health conditions on HealthHub for the best overall performance for speed. I have had to overcome the difficulty of having to coordinate with all HealthHub commands and sync my statistical data with the data in the application. For example, when the `undo` command is made, my statistics data must also go back to the state prior to the `undo` call.
+
+* *Minor enhancement*: Incorporated a patient’s set of health conditions into requests for home care.
+
+image::rohan_patient_profile.PNG[]
+
+** *What it does*: When adding a request for home care in HealthHub, instead of merely typing in 1 health condition per request, the administrative staff can now add in a set of all health conditions the particular patient may suffer from.
+** *Justification*: Health practitioners, before attempting treatment on any patient, would want to know all health conditions the particular patient might be suffering from. There have been plenty of cases in the past where the administered treatment by the health care professional on a patient had triggered other health conditions in the patient, which the healthcare professionals were completely unaware of. Therefore, instead of just adding a request for a particular treatment, administrators can add a request with multiple health conditions.
+** *Highlights*: When the administrator adds a request for home care on the HealthHub platform, it takes in all the patient’s particulars (name, NRIC, phone number, home address) and a set of health conditions the patient suffers from. I made use of the hashset data structure to contain the set of health conditions inside it for each patient. The set of conditions guarantees no duplicate health condition being found inside and it can also speedily access any specific health condition the administrative staff may be looking for or may be interested in for further investigation.
+
+* *Other contributions*:
+
+** Project management:
+*** Setup codacy and coveralls badges for the team on GitHub
+** Enhancements to existing features:
+*** Wrote Conditions class based off Tag class from Address Book 4, and incorporated additional functionality for it to accept more than just 1 string input.
+*** Wrote tests for Condition class and condition-related features in Request class, including various test utility classes to assist other team members in their testing
+** Documentation:
+*** Added detailed implementation documentation for the statistics feature in the User Guide and the Developer Guide, including diagrams
+** Community:
+*** Reviewed and gave feedback to team members. PRs reviewed: https://github.com/CS2103-AY1819S2-W09-2/main/pull/80[#80], https://github.com/CS2103-AY1819S2-W09-2/main/pull/107[#107], https://github.com/CS2103-AY1819S2-W09-2/main/pull/142[#142]
+** Tools:
+*** Setup Codacy and Coveralls badges to perform automated testing of test cases and auto-publishing of documentation and reports on overall overage score of the application software.
+
+_{you can add/remove categories in the list above}_
+
+== 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._
+|===
+
+=== Getting health condition statistics: `statistics`
+
+We understand that it is imperative for you to know which health conditions have been seeing an increasing trend, as
+well as take note of those which have been experiencing a decline. The `statistics` command allows you to view all
+health conditions that have been registered on HealthHub, and also their respective numbers of occurrences.
+
+Format: `statistics` -> this command displays a list of all health conditions that you have typed into HealthHub, and
+shows each health condition’s related number of occurrences.
+
+[NOTE]
+====
+`statistics` will only show any useful information related to frequency of health conditions after you have added at least
+1 request for homecare on HealthHub. If there are no homecare requests made, the statistics panel will display the
+following:
+====
+
+image::empty_statistics.PNG[]
+
+Example of usage:
+
+Let’s say that no commands have been issued yet and HealthHub is on a clean slate with no prior records of requests.
+Suppose as an administrative staff, you input the following commands as your first 2 requests for home care into
+HealthHub:
+
+`add request n/John Doe i/S8974421C p/98765432 a/123 Brick Road, #01-01 dt/01-01-2019 14:50:00 c/Diabetes
+c/Physiotherapy`
+
+`add request n/Dohn Joe i/S9874421C p/98675432 a/Sheares Hall, #01-01 dt/06-05-2019 10:10:00 c/AIDS c/Physiotherapy`
+
+You can then subsequently type in the following command:
+
+`statistics`
+
+Voila! A list of health conditions (namely, the ones which were typed in the 2 abovementioned requests Physiotherapy,
+Diabetes, AIDS) will be generated and will be displayed in descending order of occurrences. The following screen is what
+you can expect to see after typing in the 3 commands.
+
+image::normal_statistics.PNG[]
+
+==== Updating of statistics
+
+Every time you decide to add a request, edit a request, delete a request or even undo and redo a request, it is
+important that the statistics display automatically keeps updating itself so that real-time accurate data is always
+showed whenever you type in `statistics`
+
+Example of usage:
+
+Let’s assume you still have the requests of John Doe and Dohn Joe (requests that you had placed into HealthHub from the
+previous section) in the request panel. You just received news that John Doe’s mobility has miraculously improved and
+you no longer need to tag him with the ‘Physiotherapy’ health condition in his health request record. You, thus, decided
+to edit John Doe’s health conditions from Diabetes and Physiotherapy to just Diabetes by issuing the following command:
+
+`edit r 1 c/Diabetes`
+
+image::statistics_before_edit.PNG[]
+
+You can then subsequently type in the following command to gather accurate statistical data,
+which reflects the deletion of one of the ‘Physiotherapy’ health conditions:
+
+`statistics`
+
+image::statistics_after_edit.PNG[]
+
+After issuing the aforementioned commands, you now receive news that John Doe had not really recovered entirely yet,
+and he still requires Physiotherapy treatment. Fret not! You can always issue the `undo` command to revert your changes to
+John’s earlier set of health conditions (Physiotherapy and Diabetes) and then the `statistics` command to view the new
+data.
+
+In essence, the `statistics` command is fully integrated with all request-related commands (`add`, `edit`, `delete`,
+`undo`, `redo`, `clr`) in its pursuit of always providing accurate, real-time statistical information.
+
+==== Application of `statistics` in the workplace
+
+Upon collating such data, you can feedback and make suggestions to the hospital to increase or decrease training in
+certain departments. Furthermore, you can even use this data as a basis for the health sector to ramp up efforts in its
+Work Skills Qualification certification for certain healthcare skills to be taught to new aspiring healthcare
+professionals.
+
+== 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._
+|===
+
+=== Statistics Feature
+
+The statistics mechanism is facilitated by Statistics class, which is a public Java class containing a private static
+TreeMap data structure and a private static LinkedHashMap data structure. The TreeMap contains key-value pairs, with the
+names of health conditions as keys and the number of occurrences of each health condition as corresponding values. The
+key-value pairs in the TreeMap are ordered in lexicographical order, whereas the LinkedHashMap is ordered in descending
+order by value.
+
+The statistics feature is called every time the user decides to use any request-related commands (such as `add request`,
+`edit r`, `delete r`, `undo`, `redo`, `clr`) since statistics need to keep track of every change in the frequency of all health
+conditions. Therefore, the Statistics class also carries out the following operations:
+
+• updateStatistics(): updates statistics with new health condition-related data after add or edit commands are called
+by the user.
+• deleteStatistics(): updates statistics by specifically removing the health condition-related data that need to be
+removed after the user calls the delete function.
+• sortStatistics(): sorts statistics by value in descending order of the number of occurrences of each health
+conditions, and puts the ordered key-value pairs into sortedMap
+• undoRedoStatistics(): clears statistics and sortedMap completely and uses an ObservableList of all requests in the
+request book to extract all the health conditions and their related number of occurrences. These health conditions and
+their statistics are then added back to statistics and sortedMap
+• clearStatistics(): renders both statistics and sortedMap empty after the user calls for the clr operation
+• getConditionStatistics(): when the user specifically wants to know the number of occurrences for a particular health
+condition
+
+Given below is an example of a usage scenario and how the statistics command is executed at each step:
+
+1. Starting up HealthHub: The user launches HealthHub for the first time. The `statistics` and `sortedMap` will be
+initialized as an empty TreeMap and an empty LinkedHashMap respectively.
+
+2. Issuing Add Request Command: The user executes `add request n/John Doe i/S8974421C p/98765432 a/123 Brick Road,
+#01-01 dt/01-01-2019 14:50:00 c/Diabetes c/Physiotherapy` command to add John Doe to the request book. The
+aforementioned command also calls updateStatistics(), which takes in a Set containing Diabetes Condition and
+Physiotherapy Condition, and adds an occurrence of one each to statistics. sortStatistics() is then subsequently called
+to order the health conditions by value in sortedMap.
+
+3. Issuing Edit Request Command: The user executes `edit r 1 c/Diabetes` command to make changes to the first request
+on the request panel in HealthHub. The aforementioned command also calls deleteStatistics(), which removes the
+statistics of health conditions of the first request in statistics. updateStatistics() is then subsequently called to
+add the new health condition (which in this case is just Diabetes) to statistics. sortStatistics() is lastly called to
+order the health conditions by value in sortedMap.
+4. Issuing Undo Request Command: The user executes `undo` command to reverse his earlier `edit r 1 c/Diabetes` command.
+The aforementioned commands calls undoRedoStatistics(). This method first clears statistics and sortedMap, and then
+takes an ObservableList of all requests from the request book. All health conditions are retrieved from the requests,
+and are used to update statistics and sortedMap.
+
+The following sequence shows how the statistics operation works when called by LogicManager:
+
+image::statistics_command_sequence.png[]
+
+The following activity diagram summarizes what happens when a HealthHub user executes a new command:
+
+image::statistics_activity_diagram.png[]
+
+==== Design Considerations
+
+[width="100%",cols="1, 5, 5",options="header"]
+|=======================================================================
+| Aspect
+| Alternative 1
+| Alternative 2
+
+| Choice of data structure for statistics and sortedMap
+| statistics: use TreeMap
+
+ sortedMap: use LinkedHashMap
+
+*Advantages*:
+
+1. Very fast retrieval of information with the TreeMap; guaranteed O(lgn) time complexity for containsKey, get, put,
+remove operations.
+
+2. TreeMap entries are sorted in the natural ordering of its keys.
+
+3. Having 2 separate data structures (1 to contain alphabetically arranged health conditions and 1 to contain sorted
+conditions by value) aids in the quicker retrieval of data
+
+
+*Disadvantages*:
+
+1. Space costly to have 2 separate data structures containing the same information but in different orders
+
+| Use any other reasonable data structure like an ArrayList or a LinkedList
+
+*Advantages*:
+
+1. Very easy to implement and understand
+
+2. Space-efficient to have only 1 list of health conditions and their corresponding number of occurrences
+
+*Disadvantages*:
+
+1. Will need to create another wrapper class around Conditions and their number of occurrences since lists do not allow
+for key-value pairing
+
+2. Retrieval of information for common operations like getting statistics for a particular condition may not be very
+fast
+
+|=======================================================================
+
+Decision to go with Alternative 1: The team prioritized speed over space since in hospitals, should they want to
+implement HealthHub, will not have an issue with having memory constraints. But they would definitely want to retrieve
+data as fast as possible. Moreover, Alternative 1 seems far more scalable for future developments
+
+[width="100%",cols="1, 5, 5",options="header"]
+|=======================================================================
+| Aspect
+| Alternative 1
+| Alternative 2
+
+| How `statistics` executes
+| The system saves an internal copy of statistics in its storage like a StatisticsBook, modelled after RequestBook or
+HealthWorkerBook
+
+*Advantages*:
+
+ 1. When HealthHub is closed and reopened, the old statistics will still exist.
+
+*Disadvantages*:
+
+ 1. Takes up memory space since statistics will now need to be stored as .json files
+
+ 2. Speed of retrieval will be lower since HealthHub will need to dig into its storage for data
+
+| Make the statistics class a static class.
+
+*Advantages*:
+
+1. Easier to implement; entirely removes the need for making storage files
+
+2. Speed of retrieval of data will be faster since it does not constantly need to keep digging into storage files
+
+*Disadvantages*:
+
+1. When HealthHub is closed and reopened, the old statistics will disappear since they have not been stored.
+
+|=======================================================================
+
+Decision to go with Alternative 2: Since RequestBook was already being stored in the storage component of HealthHub,
+I found it redundant and space-inefficient to have to create another StatisticsBook to store statistical data, since all
+of my statistical information can be found from the requests stored in RequestBook. I made sure that whenever
+request-related commands were being executed (add, edit, delete, undo, redo, clr) statistics was also being updated in
+tandem so that the statistical data was always accurate in real-time.
+
+To address the issue of losing statistical data upon closing down and reopening HealthHub, I have ensured that
+statistics and sortedMap are initialized with latest data from the RequestBook during the init() method in the MainApp.
+
diff --git a/docs/team/daviddl9.adoc b/docs/team/daviddl9.adoc
new file mode 100644
index 000000000000..5b52ad7b2f8b
--- /dev/null
+++ b/docs/team/daviddl9.adoc
@@ -0,0 +1,293 @@
+= David Livingston - Project Portfolio for HealthHub
+:site-section: AboutUs
+:imagesDir: ../images
+:stylesDir: ../stylesheets
+:xrefstyle: full
+:experimental:
+ifdef::env-github[]
+:tip-caption: :bulb:
+:note-caption: :information_source:
+:source-highlighter: rouge
+endif::[]
+
+== Overview
+I am a software developer and second year computer science student at the National University of Singapore. I am really passionate about developing technology that can make the world a better place. This portfolio page documents my contributions to one of the most meaningful projects I've worked for - HealthHub.
+
+== Project: Health Hub
+
+=== About the project
+
+image::HealthHub.png[width=800]
+
+HealthHub is a https://en.wikipedia.org/wiki/Command-line_interface[command-line] desktop application built by my team and I, for our Software Engineering project.
+We chose to morph it to a home-care patient management system, because of our passion in the health care industry. This enhanced application allows Hospital Administrators and senior management to create, assign and organise patient records seamlessly. HealhHub also organises staff information and manages statistics to assist in the Hospital's planning and allocation of resources.
+
+Note the following symbols and formatting used in this document:
+
+`add` A grey highlight (called a mark-up) indicates that this is a command that can be inputted into the command line and executed by the application. +
+`Request` Grey highlight beginning with a capital letter indicates a component, class or object in the architecture of the application.
+
+== Summary of contributions
+
+* *Major enhancement*: Created the `Request` class to encapsulate a request, and it's relevant CRUD commands.
+** What it does: Encapsulates the necessary information to be stored in a patient request.
+** Justification: Laid the foundation to the entire project. All components of our project (UI, Storage, Logic and Model) required the creation of a `Request` class for further development of core functionality.
+** Highlights: This enhancement affecting all existing classes, requiring some overhaul of the existing code base and thorough interaction of the differing components.
+
+//* *Major enhancement*: Created `add`, `edit`, `delete`, `list` and `clear` commands for the `Request` class.
+//** What it does: Lays the foundation to any `Request` based functionality. Allows the user to organise the requests made by the patients seamlessly.
+//** Justification: These enhancements provide necessary features to the admin so that the admin can create, edit or delete requests at any point of time.
+//** Highlights: This enhancement affects the existing existing classes, like the [blue]`Healthworker` class. It required an in-depth analysis of design alternatives. The implementation was also challenging as it required changes to existing commands and classes, during the integration-testing phase.
+//** Credits: Utilised the JACKSon library that serializes a [blue]`Request` object into JSON format for storage. This allows the user's state to be saved at all times.
+
+* *Major enhancement*: Created `assign` and `complete` request commands.
+** What it does: Allows the admin to assign Healthworkers to requests, and complete any ongoing requests.
+** Justification: These features are necessary for the product, and allows the administrator manage all patient requests by assigning the relevant healthworker with the appropriate skill sets.
+** Highlights: Creation of these features required thorough understanding of how the existing details of the [blue]`Logic` and [blue]`Model` components,
+as knowledge of how information is cached in the application's memory was essential to allow for rapid assigning. Also implemented a scheduling algorithm that allows users to ensure that requests assigned to `HealthWorker`s are at least 2 hours apart.
+This prevents the user from accidentally assigning the same Healthworker to requests with clashing times.
+
+* *Minor enhancement*: added a filter command that allows the user to navigate through all requests stored by filtering by a specific value.
+
+* *Code contributed*: [https://nus-cs2103-ay1819s2.github.io/cs2103-dashboard/#search=daviddl9&sort=displayName&since=2019-02-10&until=2019-04-12&timeframe=day&reverse=false&repoSort=true[Reposense]]
+
+* *Other contributions*:
+
+** Project management:
+*** Managed releases `v1.3` onwards (3 releases) on GitHub
+*** Added reposense compatibility
+*** Added coveralls compatibility to project README
+** Community:
+*** PRs reviewed: https://github.com/CS2103-AY1819S2-W09-2/main/pulls?q=is%3Apr+is%3Aclosed+reviewed-by%3Adaviddl9[view here]
+*** Reported bugs and suggestions for other teams in the class (examples: https://github.com/nus-cs2103-AY1819S2/pe-dry-run/issues/964[1], https://github.com/nus-cs2103-AY1819S2/pe-dry-run/issues/743[2], https://github.com/nus-cs2103-AY1819S2/pe-dry-run/issues/173[3], https://github.com/nus-cs2103-AY1819S2/pe-dry-run/issues/12[4])
+
+== Contributions to the User Guide
+
+=== *Filter requests*:
+
+Format: `filter request []`
+
+Shortcut(s): +
+1. `filter r []` +
+2. `filter 2 []`
+
+where `[ p/`
+filters the request list for requests whose patient's name contains the
+specified name substring *and* the specified phone number.
+====
+
+[NOTE]
+====
+To revert the view back to the original request list, enter the `list request` command.
+====
+
+Examples:
+
+* `filter request n/alice` +
+Returns all patients whose name contains "alice".
+* `filter r p/9177` +
+Returns all requests with contacts numbers that have "9177" in it's field.
+* `filter 2 dt/30-01-2019 10:00:00` +
+Returns all requests scheduled on 30th Jan 2019, at 10 am sharp.
+
+=== Filtering requests within a specific date range
+Let's say you've grown to have an overwhelming number of requests, because you've been doing so successfully! Suppose you now would like to
+look back and take a look at the requests that you had over a specific date range. You can do so using the following command:
+
+Format: `filter request dt/start dt/end` +
+Shortcut(s): +
+1. `filter r dt/start dt/end` +
+2. `filter 2 dt/start dt/end`
+
+*Examples:*
+
+* `filter r dt/01-01-2019 00:00:00 dt/01-06-2019` 00:00:00 +
+filters the requests between 1st Jan 2019 (inclusive) and 1st June 2019 (exclusive).
+
+
+== 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._
+|===
+
+=== Assign Request feature
+
+The assign request feature allows an administrator to assign a request to a particular healthworker.
+
+==== Current Implementation
+
+The following sequence diagram shows the sequence flow from the `LogicManager` to the `ModelManager` when a user enters a `assign request` command:
+
+image::assignreq.png[]
+Figure 3.3.1.1 Sequence diagram to illustrate `Logic` component interactions for `assign request` command.
+
+image::assignReqToHw.png[]
+Figure 3.3.1.2 Sequence diagram to illustrate `Logic` and `Model` component interactions for [blue]`AssignRequestCommand`.
+
+image::addHwRequestDates.png[]
+Figure 3.3.1.3 Sequence diagram illustrates addition of the relevant `Date` objects into the `TreeSet` of the `healthWorker`.
+
+image::checkConflictingRequests.png[]
+Figure 3.3.1.4 Sequence diagram illustrates interaction between `AssignRequestCommand` and `healthWorkerAppointments`
+
+1. When `LogicManager` receives the `execute` command, it calls the `parseCommand` method in `RequestBookParser`.
+2. `RequestBookParser` will receive `assign` as the command and instantiate `AssignRequestCommandParser` to further parse the command.
+3. If the arguments specified in the `assign` command are invalid, a `AssignCommand` will be created and returned back to the `LogicManager`.
+4. `LogicManager` will proceed to call the `execute` command of `AssignCommand`
+5. `AssignRequestCommand` will proceed to call the `getFilteredRequestList` method of `Model`.
+6. Iterate through the `requestIds`, if valid, add the `request` corresponding to that `index` to the set of `Request`.
+7. Iterates through all the requests already assigned to that `healthWorker`. If there is a conflict of schedule (i.e Requests assigned
+to that healthWorker are less than 2 hours apart), a `CommandException` is thrown.
+8. Writes the updated request to the `RequestBook` in `ModelManager`, if all the request timings are valid.
+
+==== Design Consideration
+
+===== Aspect: Algorithm in ensuring no clashing requests assigned to healthworkers - Data Structure and implementation
+* Alternative 1 (current choice): Using a Balanced Binary Search Tree (java `TreeSet`) to keep track of the [blue]`RequestDate` of each request attended to by a particular `healthWorker`.
+** Reasoning: Since the allowed time interval between 2 consecutive requests should be at least 2 hours, we can take advantage
+of of this by only keeping track of the start time of requests. Hence we can utilise the `ceiling()`, `contains()` and `floor()` methods of the `TreeSet`, which runs effeciently in O(log N) time (where N is the number of requests). Here is the code snippet that implements this:
+```
+ // Note: healthWorkerAppointments is the TreeSet that stores the appointment dates
+ Date date = request.getRequestDate().getDate();
+ calendar.setTime(date);
+ calendar.add(Calendar.HOUR_OF_DAY, -MIN_REQUEST_DURATION); // MIN_REQUEST_DURATION = 2 hours
+ Date lowerLimit = calendar.getTime();
+ calendar.add(Calendar.HOUR_OF_DAY, 2 * MIN_REQUEST_DURATION);
+ Date upperLimit = calendar.getTime();
+
+ if (healthWorkerAppointments.contains(date) || (healthWorkerAppointments.lower(date) != null
+ && healthWorkerAppointments.lower(date).after(lowerLimit))
+ || (healthWorkerAppointments.higher(date) != null
+ && healthWorkerAppointments.ceiling(date).before(upperLimit))) {
+ throw new CommandException(Messages.MESSAGE_HEALTHWORKER_OCCUPIED_CANNOT_ASSIGN);
+ }
+
+ healthWorkerAppointments.add(date);
+```
+Here is a pictorial representation of the algorithm:
+
+image::assignRegionCheck.png[]
+Figure 3.3.1.5 Shows the visualisation of time ranges that are valid.
+
+* Alternative 2: For each request to be assigned, manually iterate through the Request list to ensure that there are not clashing dates.
+Pros: Easy to implement
+Cons: Slow - in the worst case, if all the requests get assigned at once, this operation will run in O(n^2) time.
+
+=== Add Request feature
+
+==== Current Implementation
+The `add request` command allows the `LogicManager` to create a new request and add it to the list of requests. Adding a new request requires the
+patient's name, patient's phone number, patient's address, patient's NRIC number and the patient's conditions. The format of the add request command is
+add request n/NAME p/PHONE i/NRIC a/ADDRESS dt/DATETIME c/CONDITION.
+
+The following sequence shows the sequence when the add command is execute by the LogicManager:
+
+image::addrequest.png[width=800]
+Figure 3.2.1.1 Sequence Diagram for `add request` command
+
+From the diagram above:
+
+. `LogicManager` 's execute is called when the administrator keys in `add request` and it calls upon `parseCommand` of `HealthHubParser` to parse the command
+. `HealthHubParser` will initialize `AddCommandParser` and invoke the method `parse` to further parse the command.
+. `parse` will be invoked and passed the parameters of the add command.
+. If all the arguments of the `add` commands are valid, `AddRequestCommand` will be returned to the `LogicManager`
+. `LogicManger` will then calls the method `execute` method of `AddRequestCommand`
+. `AddRequestCommand` will call `addRequest` passing `Request` as an argument to `Model` and after calls `commitRequestBook` method from `Model`, if all the arguments in the `Request` are valid.
+. A `CommandResult` will be returned at the end.
+
+==== Design Considerations
+===== Aspect: Data Structure for the list of Requests
+* **Alternative 1 (Current Approach):** Using a `UniqueRequestList`
+** Pros: The comparison is not as rigid. You can create requests with similar names/phones as long as it passes a less stringent criteria.
+** Cons: You need additional overhead. You need to create an extra class and function to check.
+
+* **Alternative 2:** Using a `Set`
+** Pros: Do not need an extra function. You can use use `equals` for comparison
+** Cons: It is a strict check and as a result you will not be allowed to create requests with same phone/same name etc.
+
+===== Aspect: Data Structure of `Request`
+* **Alternative 1 (Current Approach):** All parameters in `Request` are abstracted out to have a class of its own.
+** Pros: It adheres to the Single Responsibility Principles (SRP) and the Separation of Concerns (SoC) as each parameter checks whether it is valid
+** Cons: Many different classes are created which increases the complexity of the code
+
+* **Alternative 2:** Store all parameters of `Request` as `String`
+** Pros: Easy to implement.
+** Cons: Violates SRP as one single class will need to check if the arguments are valid.
+
+[NOTE]
+The `RequestStatus` class within the `Request` object utilises the Java `Enum` to ensure type safety in user inputs.
+
+The implementation of the `RequestStatus` class is as follows:
+
+```
+ private enum Status {
+ PENDING,
+ ONGOING,
+ COMPLETED
+ }
+
+ public RequestStatus(String status) {
+ this.requestState = Status.valueOf(status);
+ }
+```
+
+Through this, any user String that is passed in as an argument for the `RequestStatus` field is automatically type checked,
+ensuring that there are no invalid request statuses entered.
+
+//include::../DeveloperGuide.adoc[tag=assignrequest]
+
+//include::../DeveloperGuide.adoc[tag=dataencryption]
+
diff --git a/docs/team/huichun66.adoc b/docs/team/huichun66.adoc
new file mode 100644
index 000000000000..91610e3b5c05
--- /dev/null
+++ b/docs/team/huichun66.adoc
@@ -0,0 +1,95 @@
+= Tay Hui Chun - Project Portfolio
+:site-section: AboutUs
+:imagesDir: ../images
+:stylesDir: ../stylesheets
+:icons: font
+
+== Project: Health Hub
+
+Hello there! Welcome to my project portfolio! This portfolio contains a list of contributions towards my CS2103T - Software Engineering module project,
+which requires me to work in a team to morph an existing functional product to something else that solves a real-world problem.
+
+Health Hub is a desktop application that aims to get rid of the messy system of palliative care requests for health administrative staff.
+Admin staff who are in-charge of assigning requests from patients to qualified health staff are often overwhelmed by the enormous filings and binders that take up so much of their time.
+
+image::Ui_home_orange.png[]
+
+My role in the team is to handle all the User Interface (UI) coding to render model data to display it to our users, who are hospital administrative staff.
+Thinking that this is not enough to ensure a pleasant experience for our users, I extended some of the original functionalities from AddressBook4 and added a new command.
+Tests in the form of component, integration and system tests are also added to ensure quality control.
+
+
+== Overview
+* Restructured most of the `.fxml` files associated with the UI components
+* Wrote code to render the model data into the different UI components
+* Wrote my own version of stylesheet to use for the application
+* Handle logic for displaying a request's details in the `InfoPanel`, which is the center panel of the app.
+* Extended the normal textfield to an additional autocomplete functionality.
+* Added a `setreminder` command
+
+== Summary of Contributions
+
+* *Major Enhancement 1*: restructured the original AB4 UI code into different code that will suit the context of our application.
+** What it does: Shows the lists of requests and health workers in two different panels. The UI has a center panel that displays a request's additional details that are not visible within the list,
+such as the health staff assigned, and a static map overview of the patient's address.
+** Justification: This is important as it is the interface that the user will be interacting with. Important details such as a patient's name and NRIC are displayed differently
+compared to the other details such as phone or address. Special noteworthy details such as the conditions of a patient or the skills of a health worker are also displayed differently.
+** Highlights: Coding the UI requires a deep understanding of how different UI components interact with each other and how the model data is rendered to the UI layer (via `ObservableValue