From c701e658302f19577b2af9ee30cc4902f5fc3e7d Mon Sep 17 00:00:00 2001 From: ryanlimdx Date: Fri, 12 Apr 2024 17:26:11 +0800 Subject: [PATCH 1/8] Attempt to fix formatting in DG --- docs/DeveloperGuide.md | 196 +++++++++++++++++++++-------------------- 1 file changed, 102 insertions(+), 94 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index a3ae48daad9..0f7861c2f7f 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -7,19 +7,20 @@ title: Developer Guide -------------------------------------------------------------------------------------------------------------------- -## **Acknowledgements** +## Acknowledgements * Libraries used: [JavaFX](https://openjfx.io/), [JUnit5](https://github.com/junit-team/junit5), [Jackson](https://github.com/FasterXML/jackson) * The [original AB3 project](https://github.com/se-edu/addressbook-level3), which Nursing Address Book is based from. + -------------------------------------------------------------------------------------------------------------------- -## **Setting up, getting started** +## Setting up, getting started Refer to the guide [_Setting up and getting started_](SettingUp.md). -------------------------------------------------------------------------------------------------------------------- -## **Design** +## Design
@@ -27,10 +28,12 @@ Refer to the guide [_Setting up and getting started_](SettingUp.md). + The ***Architecture Diagram*** given above explains the high-level design of the App. Given below is a quick overview of main components and how they interact with each other. + **Main components of the architecture** **`Main`** (consisting of classes [`Main`](https://github.com/AY2324S2-CS2103T-F10-1/tp/blob/master/src/main/java/seedu/address/Main.java) and [`MainApp`](https://github.com/AY2324S2-CS2103T-F10-1/tp/blob/master/src/main/java/seedu/address/MainApp.java) is in charge of the app launch and shut down. @@ -55,9 +58,13 @@ The *Sequence Diagram* below shows how the components interact with each other f Each of the four main components (also shown in the diagram above), * defines its *API* in an `interface` with the same name as the Component. -* implements its functionality using a concrete `{Component Name}Manager` class (which follows the corresponding API `interface` mentioned in the previous point. +* implements its functionality using a concrete `{Component Name}Manager` class (which follows the corresponding API +`interface` mentioned in the previous point. -For example, the `Logic` component defines its API in the `Logic.java` interface and implements its functionality using the `LogicManager.java` class which follows the `Logic` interface. Other components interact with a given component through its interface rather than the concrete class (reason: to prevent outside component's being coupled to the implementation of a component), as illustrated in the (partial) class diagram below. +For example, the `Logic` component defines its API in the `Logic.java` interface and implements its functionality using +the `LogicManager.java` class which follows the `Logic` interface. Other components interact with a given component +through its interface rather than the concrete class (reason: to prevent outside component's being coupled to the +implementation of a component), as illustrated in the (partial) class diagram below. @@ -88,6 +95,7 @@ Here's a (partial) class diagram of the `Logic` component: + The sequence diagram below illustrates the interactions within the `Logic` component, taking `execute("delete 1")` API call as an example. ![Interactions Inside the Logic Component for the `delete 1` Command](images/DeleteSequenceDiagram.png) @@ -112,6 +120,7 @@ How the parsing works: * All `XYZCommandParser` classes (e.g., `AddCommandParser`, `DeleteCommandParser`, ...) inherit from the `Parser` interface so that they can be treated similarly where possible e.g, during testing. ### Model component + **API** : [`Model.java`](https://github.com/AY2324S2-CS2103T-F10-1/tp/blob/master/src/main/java/seedu/address/model/Model.java) @@ -147,6 +156,23 @@ This section contains some noteworthy details on how certain features are being ### Adding a patient into Nursing Address Book +The add patient feature is facilitated by `AddCommand`, `AddCommandParser` and `Person`. + +Given below is an example usage scenario and how the add patient feature behaves at each step. + +Step 1. The user launches the application for the first time. + +Step 2. The user executes an Add Command (e.g. 'add n\Alice ic\A0055679T ad\01/01/2022 dob\01/01/2002 w\WA') to add a new patient to the address book. + +n\: Indicates the name of the patient +ic\: Indicates the NRIC of the patient +ad\: Indicates the admission date of the patient +dob\: Indicates the date of birth of the patient +w\: Indicates the ward of the patient is currently in + +The `AddCommandParser` parses the user input, creating a new `AddCommand` object. +The `AddCommand` object then creates a new `Person` object with the parsed details. + #### Implementation The add patient feature is facilitated by `AddCommand`, `AddCommandParser` and `LogicManager`. @@ -206,84 +232,16 @@ The following sequence diagram summarizes what happens when a user executes a ne ![EditSequenceDiagram.png](images/EditSequenceDiagram.png) -### Showing help for commands - -#### Implementation - -The help command is facilitated by the `HelpCommand` class. It allows users to view the usage instructions for the application. - - - -The `HelpCommand` class extends the `Command` interface and is responsible for executing the `help` command. It creates a `CommandResult` object with the help message to be displayed to the user. - -**UML Diagrams:** - -The following class diagram shows the relevant classes involved in the help command implementation: - -Step 1. The `LogicManager` is called to execute the "help" command. -Step 2. The `AddressBookParser` parses the command and creates a new `HelpCommand` instance. -Step 3. The `LogicManager` calls the `execute()` method of the `HelpCommand`. -Step 4. The `HelpCommand` creates a new `CommandResult` with the help message. -Step 5. The `MainWindow` handles the help command and calls the `handleHelp()` method. -Step 6. The `ResultDisplay` is updated with the help message obtained from `HelpCommand.SHOWING_HELP_MESSAGE`. - -The `HelpCommand` class interacts with the `Logic` component and utilizes the `CommandResult` class to encapsulate the result of executing the `help` command. The `MainWindow` and `ResultDisplay` classes in the UI component are responsible for handling the display of the help message to the user. - - -![HelpCommandClassDiagram](images/HelpClassDiagram.png) - -The following sequence diagram shows how the help command works: - -![HelpCommandSequenceDiagram](images/HelpSequenceDiagram.png) - -The following activity diagram summarizes what happens when a user executes a new command: - - - -When the user executes the help command, the following steps occur: - - -1. The `LogicManager` is called to execute the "help" command. -2. The `AddressBookParser` parses the command and creates a new `HelpCommand` instance. -3. The `LogicManager` calls the `execute()` method of the `HelpCommand`. -4. The `HelpCommand` creates a new `CommandResult` with the help message. -5. The `MainWindow` handles the help command and calls the `handleHelp()` method. -6. The `ResultDisplay` is updated with the help message obtained from `HelpCommand.SHOWING_HELP_MESSAGE`. - - -The `HelpCommand` class interacts with the `Logic` component and utilizes the `CommandResult` class to encapsulate the result of executing the `help` command. The `MainWindow` and `ResultDisplay` classes in the UI component are responsible for handling the display of the help message to the user. - -### Add a patient - -#### Implementation - -The add patient feature is facilitated by `AddCommand`, `AddCommandParser` and `Person`. - -Given below is an example usage scenario and how the add patient feature behaves at each step. - -Step 1. The user launches the application for the first time. - -Step 2. The user executes an Add Command (e.g. 'add n\Alice ic\A0055679T ad\01/01/2022 dob\01/01/2002 w\WA') to add a new patient to the address book. - -n\: Indicates the name of the patient -ic\: Indicates the NRIC of the patient -ad\: Indicates the admission date of the patient -dob\: Indicates the date of birth of the patient -w\: Indicates the ward of the patient is currently in - -The `AddCommandParser` parses the user input, creating a new `AddCommand` object. -The `AddCommand` object then creates a new `Person` object with the parsed details. - ### List with filter by tags and/or ward feature #### Introduction -This section describes the implementation of the list with filter by tags and/or ward mechanism in NAB. This mechanism -allows users to list patients based on their tags and/or ward, on top of listing all patients. This feature is useful +This section describes the implementation of the list with filter by tags and/or ward mechanism in NAB. This mechanism +allows users to list patients based on their tags and/or ward, on top of listing all patients. This feature is useful for nurses to quickly find patients with specific medical conditions or patients in a specific ward. #### Implementation The filter by tags and/or ward mechanism is facilitated by `ListCommand`, `ListCommandParser`, `ListKeywordsPredicate` -and `LogicManager`, which implements the `Logic` interface. `LogicManager` holds a `AddressBookParser` that parses the +and `LogicManager`, which implements the `Logic` interface. `LogicManager` holds a `AddressBookParser` that parses the user input, and a model where the command is executed. Additionally, it implements the following operations: * `LogicManager#execute(String)`— Executes the given user String input to return a `CommandResult` object. @@ -292,22 +250,22 @@ These operations are exposed in the UI interface as `MainWindow#executeCommand(S Given below is an example usage scenario and how the filter by tags and/or ward mechanism behaves at each step. -Step 1. The user executes `list t\diabetes` command to list patients with the diabetes tag in the address book. +Step 1. The user executes `list t\diabetes` command to list patients with the diabetes tag in the address book. - The `list` command triggers `AddressBookParser` to parse the user input, identifying the `list` command word to call -`ListCommandParser#parse(String)` to parse the rest of the user input. + `ListCommandParser#parse(String)` to parse the rest of the user input. -Step 2. `ListCommandParser#parse(String)` parses the user input. If there are subsequent arguments, a +Step 2. `ListCommandParser#parse(String)` parses the user input. If there are subsequent arguments, a `ListKeywordPredicate` object is created with the keyword(s) provided. The keywords can be either a ward or tag(s) or both, supplied by the user with the relevant prefix. In this case, it would be a tag, `t\diabetes`. -Step 3. A new `ListCommand` instance is created using the `ListKeywordsPredicate` object. (If there are no parameters +Step 3. A new `ListCommand` instance is created using the `ListKeywordsPredicate` object. (If there are no parameters provided, it will still simply create a `ListCommand` object.) The following is a list of objects created thus far: ![ListObjectDiagram](images/ListObjectDiagram.png) -Step 4. The `ListCommand` object is returned to `LogicManager` and `execute` is called. `ListCommand#execute(Model)` -filters the list of patients in `Model` based on the `ListKeywordsPredicate` object if it is present. (Otherwise, it +Step 4. The `ListCommand` object is returned to `LogicManager` and `execute` is called. `ListCommand#execute(Model)` +filters the list of patients in `Model` based on the `ListKeywordsPredicate` object if it is present. (Otherwise, it returns the full list of patients.) Step 5. The filtered list of patients (with diabetes) is displayed to the user through the GUI. @@ -343,6 +301,7 @@ The following activity diagram summarizes what happens when a user executes a ne * Pros: Easy to be more specific. * Cons: Not relevant for the nurses use case. Allowing more wards also make it harder to filter fast. + ### Find feature #### Introduction @@ -387,6 +346,54 @@ The following activity diagram summarizes what happens when a user executes a ne * Pros: Able to search even if lacking patient information. * Cons: Harder to get specific patient as result will be a list. + +### Showing help for commands + +#### Implementation + +The help command is facilitated by the `HelpCommand` class. It allows users to view the usage instructions for the application. + + +The `HelpCommand` class extends the `Command` interface and is responsible for executing the `help` command. It creates a `CommandResult` object with the help message to be displayed to the user. + +**UML Diagrams:** + +The following class diagram shows the relevant classes involved in the help command implementation: + +Step 1. The `LogicManager` is called to execute the "help" command. +Step 2. The `AddressBookParser` parses the command and creates a new `HelpCommand` instance. +Step 3. The `LogicManager` calls the `execute()` method of the `HelpCommand`. +Step 4. The `HelpCommand` creates a new `CommandResult` with the help message. +Step 5. The `MainWindow` handles the help command and calls the `handleHelp()` method. +Step 6. The `ResultDisplay` is updated with the help message obtained from `HelpCommand.SHOWING_HELP_MESSAGE`. + +The `HelpCommand` class interacts with the `Logic` component and utilizes the `CommandResult` class to encapsulate the result of executing the `help` command. The `MainWindow` and `ResultDisplay` classes in the UI component are responsible for handling the display of the help message to the user. + + +![HelpCommandClassDiagram](images/HelpClassDiagram.png) + +The following sequence diagram shows how the help command works: + +![HelpCommandSequenceDiagram](images/HelpSequenceDiagram.png) + +The following activity diagram summarizes what happens when a user executes a new command: + + + +When the user executes the help command, the following steps occur: + + +1. The `LogicManager` is called to execute the "help" command. +2. The `AddressBookParser` parses the command and creates a new `HelpCommand` instance. +3. The `LogicManager` calls the `execute()` method of the `HelpCommand`. +4. The `HelpCommand` creates a new `CommandResult` with the help message. +5. The `MainWindow` handles the help command and calls the `handleHelp()` method. +6. The `ResultDisplay` is updated with the help message obtained from `HelpCommand.SHOWING_HELP_MESSAGE`. + + +The `HelpCommand` class interacts with the `Logic` component and utilizes the `CommandResult` class to encapsulate the result of executing the `help` command. The `MainWindow` and `ResultDisplay` classes in the UI component are responsible for handling the display of the help message to the user. + + -------------------------------------------------------------------------------------------------------------------- ## **Documentation, logging, testing, configuration, dev-ops** @@ -421,17 +428,17 @@ Ward nurses Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unlikely to have) - `*` -| Priority | As a …​ | I want to …​ | So that I can…​ | -| ---- | -------------------------------------- |---------------------------------------------|--------------------------------------------------------------| -| `* * *` | user | add patient records | keep track of their medical condition in the hospital | -| `* * *` | user | view existing patient records | access information on existing patients | -| `* * *` | user | delete a patient record | remove outdated or irrelevant patient data | -| `* *` | user | edit patient records | ensure that all patient details are current and accurate | -| `* *` | user | list patients based on their tags | view patients based on category | -| `* *` | user | list all patients tied to a specific ward | know which patients belong to which ward | -| `* *` | user | find patients via their name or NRIC | quickly find information of specific patient | -| `* *` | user | access the user guide through the app easily | learn how to use the Nursing Address Book | -| `*` | user | view patient list sorted by name | look through the list of patients in a more organized manner | +| Priority | As a …​ | I want to …​ | So that I can…​ | +|----------|---------|----------------------------------------------|--------------------------------------------------------------| +| `* * *` | user | add patient records | keep track of their medical condition in the hospital | +| `* * *` | user | view existing patient records | access information on existing patients | +| `* * *` | user | delete a patient record | remove outdated or irrelevant patient data | +| `* *` | user | edit patient records | ensure that all patient details are current and accurate | +| `* *` | user | list patients based on their tags | view patients based on category | +| `* *` | user | list all patients tied to a specific ward | know which patients belong to which ward | +| `* *` | user | find patients via their name or NRIC | quickly find information of specific patient | +| `* *` | user | access the user guide through the app easily | learn how to use the Nursing Address Book | +| `*` | user | view patient list sorted by name | look through the list of patients in a more organized manner | ### Use cases @@ -663,7 +670,8 @@ Given below are instructions to test the app manually. Expected: List of patients is shown. 3. Test case: `list 181` or any command with extra characters supplied
- Expected: Similar to previous. + Expected: No change in displayed patient list. Error details shown in the status message. + 2. Viewing patients by tags and ward From d1d3334f9bb8e6b1d3b89ea92c3a5e6648727e67 Mon Sep 17 00:00:00 2001 From: ryanlimdx Date: Fri, 12 Apr 2024 17:37:28 +0800 Subject: [PATCH 2/8] Fix bold text after logic section --- docs/DeveloperGuide.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 0f7861c2f7f..6f38be50e8c 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -100,7 +100,8 @@ The sequence diagram below illustrates the interactions within the `Logic` compo ![Interactions Inside the Logic Component for the `delete 1` Command](images/DeleteSequenceDiagram.png) -:information_source: Note: The lifeline for `DeleteCommandParser` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram. +
+:information_source: Note: The lifeline for `DeleteCommandParser` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram.
How the `Logic` component works: @@ -262,6 +263,7 @@ Step 3. A new `ListCommand` instance is created using the `ListKeywordsPredicate provided, it will still simply create a `ListCommand` object.) The following is a list of objects created thus far: + ![ListObjectDiagram](images/ListObjectDiagram.png) Step 4. The `ListCommand` object is returned to `LogicManager` and `execute` is called. `ListCommand#execute(Model)` From 7b1c5014f05b17d4ac5103b243c46aca5257cf37 Mon Sep 17 00:00:00 2001 From: ryanlimdx Date: Fri, 12 Apr 2024 19:39:34 +0800 Subject: [PATCH 3/8] Standardise image format --- docs/DeveloperGuide.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 8747f530fd4..51ad7e23775 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -1,3 +1,14 @@ + + --- layout: page title: Developer Guide @@ -803,4 +814,4 @@ Given below are instructions to test the app manually. 1. Prerequisites: The addressbook.json file in the data directory must exist. 1. Test case: Delete the addressbook.json file.
- Expected: The app launches successfully, populated with the sample data. + Expected: The app launches successfully, populated with the sample data. From 9a15396a55bcdc91c5d73ac96c4a5ab65f47bbb0 Mon Sep 17 00:00:00 2001 From: ryanlimdx Date: Sun, 14 Apr 2024 13:07:22 +0800 Subject: [PATCH 4/8] Add planned enhancements --- docs/DeveloperGuide.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 51ad7e23775..740e1570be0 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -815,3 +815,34 @@ Given below are instructions to test the app manually. 1. Test case: Delete the addressbook.json file.
Expected: The app launches successfully, populated with the sample data. + +-------------------------------------------------------------------------------------------------------------------- + +## Appendix: Planned Enhancements +Team size: 5 + +**1. Checking if a date is valid:** + Currently, the app performs some form of date validation in terms of the syntax of the date. For the day, month and + year, the range is also limited to within reasonable calendar days (i.e. up till 31), months (i.e. up till 12) and + years (i.e. up till 9999). The entire date itself must also be up till the current date. However, the app does not + check if the date is valid. For example, a nurse could key in 30/02/2022 (reasonable range for each date segment and + before current date) as the date of birth of a patient. + +For more accurate error checking, we plan to perform more concrete validation of the dates to check if the date exists. + This is done by checking if the input date is a valid date as a whole (not just its parts), and throwing the error that + the date does not exist if it is invalid. + +**2. Standardise patient look-up/ accessing:** + Currently, the app does not allow users to delete or edit a patient's details by their Singapore Identity Card (NRIC) + number. As patients will predominantly (except foreigners) have an NRIC number, it would be more intuitive for nurses to + be able to edit and delete by NRIC as well. + +**3. Editing of patient details:** + Currently, the app does not directly edit patient contact details from the patient list. Some patient entries (or + details) may be accidentally deleted. For example, when editing the tags field, all tags will be overwritten. This + may result in key information being lost. + +We plan to allow nurses to view the corresponding patient's details while editing. This can be done by having the nurse + first input only edit INDEX (as per the original command) and then the app will show the patient's details. The nurse + will then be able to edit the specific field(s) of the patient's details with a follow-up command. This will prevent + accidental deletion of critical details. From bb511b00947855e845401b585dac8c5695f10459 Mon Sep 17 00:00:00 2001 From: ryanlimdx Date: Sun, 14 Apr 2024 15:38:06 +0800 Subject: [PATCH 5/8] Centralise images individually --- docs/DeveloperGuide.md | 110 ++++++++++++++++++++++++++--------------- 1 file changed, 70 insertions(+), 40 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 740e1570be0..7e1c94352c5 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -1,14 +1,3 @@ - - --- layout: page title: Developer Guide @@ -35,7 +24,9 @@ Refer to the guide [_Setting up and getting started_](SettingUp.md). ### Architecture - +
+ Architecture diagram +
The ***Architecture Diagram*** given above explains the high-level design of the App. @@ -60,7 +51,9 @@ The bulk of the app's work is done by the following four components: The *Sequence Diagram* below shows how the components interact with each other for the scenario where the user issues the command `delete 1`. - +
+ Architecture sequence diagram +
Each of the four main components (also shown in the diagram above), @@ -73,7 +66,9 @@ the `LogicManager.java` class which follows the `Logic` interface. Other compone through its interface rather than the concrete class (reason: to prevent outside component's being coupled to the implementation of a component), as illustrated in the (partial) class diagram below. - +
+ Component managers +
The sections below give more details of each component. @@ -81,7 +76,9 @@ The sections below give more details of each component. The **API** of this component is specified in [`Ui.java`](https://github.com/AY2324S2-CS2103T-F10-1/tp/blob/master/src/main/java/seedu/address/ui/Ui.java) -![Structure of the UI Component](images/UiClassDiagram.png) +
+ +
The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class which captures the commonalities between classes that represent parts of the visible GUI. @@ -100,11 +97,15 @@ The `UI` component, Here's a (partial) class diagram of the `Logic` component: - +
+ Logic class diagram +
The sequence diagram below illustrates the interactions within the `Logic` component, taking `execute("delete 1")` API call as an example. -![Interactions Inside the Logic Component for the `delete 1` Command](images/DeleteSequenceDiagram.png) +
+ +
:information_source: Note: The lifeline for `DeleteCommandParser` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline continues till the end of diagram. @@ -113,14 +114,16 @@ The sequence diagram below illustrates the interactions within the `Logic` compo How the `Logic` component works: 1. When `Logic` is called upon to execute a command, it is passed to an `AddressBookParser` object which in turn creates a parser that matches the command (e.g., `DeleteCommandParser`) and uses it to parse the command. -1. This results in a `Command` object (more precisely, an object of one of its subclasses e.g., `DeleteCommand`) which is executed by the `LogicManager`. -1. The command can communicate with the `Model` when it is executed (e.g. to delete a person).
+2. This results in a `Command` object (more precisely, an object of one of its subclasses e.g., `DeleteCommand`) which is executed by the `LogicManager`. +3. The command can communicate with the `Model` when it is executed (e.g. to delete a person).
Note that although this is shown as a single step in the diagram above (for simplicity), in the code it can take several interactions (between the command object and the `Model`) to achieve. -1. The result of the command execution is encapsulated as a `CommandResult` object which is returned back from `Logic`. +4. The result of the command execution is encapsulated as a `CommandResult` object which is returned back from `Logic`. Here are the other classes in `Logic` (omitted from the class diagram above) that are used for parsing a user command: - +
+ +
How the parsing works: * When called upon to parse a user command, the `AddressBookParser` class creates an `XYZCommandParser` (`XYZ` is a placeholder for the specific command name e.g., `AddCommandParser`) which uses the other classes shown above to parse the user command and create a `XYZCommand` object (e.g., `AddCommand`) which the `AddressBookParser` returns back as a `Command` object. @@ -130,8 +133,9 @@ How the parsing works: **API** : [`Model.java`](https://github.com/AY2324S2-CS2103T-F10-1/tp/blob/master/src/main/java/seedu/address/model/Model.java) - - +
+ +
The `Model` component, @@ -144,7 +148,9 @@ The `Model` component, **API** : [`Storage.java`](https://github.com/AY2324S2-CS2103T-F10-1/tp/blob/master/src/main/java/seedu/address/storage/Storage.java) - +
+ +
The `Storage` component, * can save both address book data and user preference data in JSON format, and read them back into corresponding objects. @@ -195,12 +201,16 @@ Given below is an example usage scenario and how the add patient feature behaves The following sequence diagram summarizes what happens when a user executes a new command: -![AddSequenceDiagram.png](images%2FAddSequenceDiagram.png) +
+ +
The following activity diagram summarizes what happens when a user executes a new command: -![AddActivityDiagram.png](images%2FAddActivityDiagram.png) +
+ +
### Deleting a patient from Nursing Address Book @@ -224,11 +234,15 @@ Given below is an example usage scenario and how the delete patient feature beha Given below is the sequence diagram that summarizes what happens when a user executes a new command: -![DeleteSequenceDiagram.png](images/DeleteSequenceDiagram.png) +
+ +
The following activity diagram summarizes what happens when a user executes a new command: -![DeleteActivityDiagram.png](images/DeleteActivityDiagram.png) +
+ +
### Editing a patient's details @@ -254,8 +268,9 @@ The patient specified will have its ward updated to the new ward specified. The following sequence diagram summarizes what happens when a user executes a new command: -![EditSequenceDiagram.png](images/EditSequenceDiagram.png) - +
+ +
### Showing help for commands @@ -263,8 +278,6 @@ The following sequence diagram summarizes what happens when a user executes a ne The help command is facilitated by the `HelpCommand` class. It allows users to view the usage instructions for the application. - - The `HelpCommand` class extends the `Command` interface and is responsible for executing the `help` command. It creates a `CommandResult` object with the help message to be displayed to the user. **UML Diagrams:** @@ -285,16 +298,21 @@ Step 6. The `ResultDisplay` is updated with the help message obtained from `Help The `HelpCommand` class interacts with the `Logic` component and utilizes the `CommandResult` class to encapsulate the result of executing the `help` command. The `MainWindow` and `ResultDisplay` classes in the UI component are responsible for handling the display of the help message to the user. - -![HelpCommandClassDiagram](images/HelpClassDiagram.png) +
+ +
The following sequence diagram shows how the help command works: -![HelpCommandSequenceDiagram](images/HelpSequenceDiagram.png) +
+ +
The following activity diagram summarizes what happens when a user executes a new command: +
+
When the user executes the help command, the following steps occur: @@ -336,7 +354,9 @@ provided, it will still simply create a `ListCommand` object.) The following is a list of objects created thus far: -![ListObjectDiagram](images/ListObjectDiagram.png) +
+ +
Step 4. The `ListCommand` object is returned to `LogicManager` and `execute` is called. `ListCommand#execute(Model)` filters the list of patients in `Model` based on the `ListKeywordsPredicate` object if it is present. (Otherwise, it @@ -347,11 +367,16 @@ Step 5. The filtered list of patients (with diabetes) is displayed to the user t **UML Diagrams:** The following sequence diagram shows how the listing of relevant patients would work: -![ListCommandSequenceDiagram](images/ListCommandSequenceDiagram.png) + +
+ +
The following activity diagram summarizes what happens when a user executes a new command to list relevant patients: - +
+ +
#### Design considerations: @@ -401,11 +426,16 @@ the patient will be shown in result. **UML Diagrams:** The following sequence diagram shows how the finding of patient would work: -![FindCommandSequenceDiagram](images/FindSequenceDiagram.png) + +
+ +
The following activity diagram summarizes what happens when a user executes a new command to find a patient: -![FindActivityDiagram](images/FindActivityDiagram.png) +
+ +
#### Design considerations: From 163d201387d69cbbee6e3ccdd11f008ebde082c4 Mon Sep 17 00:00:00 2001 From: ryanlimdx Date: Sun, 14 Apr 2024 18:16:22 +0800 Subject: [PATCH 6/8] Fix formatting --- docs/DeveloperGuide.md | 66 ++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index d75cec762cb..97b33d54ab7 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -14,13 +14,13 @@ title: Developer Guide -------------------------------------------------------------------------------------------------------------------- -## Setting up, getting started +## **Setting up, getting started** Refer to the guide [_Setting up and getting started_](SettingUp.md). -------------------------------------------------------------------------------------------------------------------- -## Design +## **Design** ### Architecture @@ -77,7 +77,7 @@ The sections below give more details of each component. The **API** of this component is specified in [`Ui.java`](https://github.com/AY2324S2-CS2103T-F10-1/tp/blob/master/src/main/java/seedu/address/ui/Ui.java)
- +
The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class which captures the commonalities between classes that represent parts of the visible GUI. @@ -104,7 +104,7 @@ Here's a (partial) class diagram of the `Logic` component: The sequence diagram below illustrates the interactions within the `Logic` component, taking `execute("delete 1")` API call as an example.
- +
@@ -134,7 +134,7 @@ How the parsing works: **API** : [`Model.java`](https://github.com/AY2324S2-CS2103T-F10-1/tp/blob/master/src/main/java/seedu/address/model/Model.java)
- +
The `Model` component, @@ -149,7 +149,7 @@ The `Model` component, **API** : [`Storage.java`](https://github.com/AY2324S2-CS2103T-F10-1/tp/blob/master/src/main/java/seedu/address/storage/Storage.java)
- +
The `Storage` component, @@ -204,14 +204,14 @@ Given below is an example usage scenario and how the add patient feature behaves The following sequence diagram summarizes what happens when a user executes a new command:
- +
The following activity diagram summarizes what happens when a user executes a new command:
- +
### Deleting a patient from Nursing Address Book @@ -239,13 +239,13 @@ Given below is an example usage scenario and how the delete patient feature beha Given below is the sequence diagram that summarizes what happens when a user executes a new command:
- +
The following activity diagram summarizes what happens when a user executes a new command:
- +
### Editing a patient's details @@ -275,13 +275,13 @@ The patient specified will have its ward updated to the new ward specified. The following sequence diagram summarizes what happens when a user executes an edit command:
- +
The following activity diagram summarizes what happens when a user executes an edit command:
- +
### Showing help for commands @@ -291,7 +291,7 @@ The following activity diagram summarizes what happens when a user executes an e Showing help for commands is facilitated by the `HelpCommand` class. It allows users to view the usage instructions for the application.
- +
The `HelpCommand` class interacts with the following components: @@ -390,10 +390,10 @@ provided, it will still simply create a `ListCommand` object.) The following is a list of objects created thus far:
- +
-Step 4. The `ListCommand` object is returned to `LogicManager` and `execute` is called. `ListCommand#execute(Model)` +**Step 4.** The `ListCommand` object is returned to `LogicManager` and `execute` is called. `ListCommand#execute(Model)` filters the list of patients in `Model` based on the `ListKeywordsPredicate` object if it is present. (Otherwise, it returns the full list of patients.) @@ -404,7 +404,7 @@ returns the full list of patients.) The following sequence diagram shows how the listing of relevant patients would work:
- +
The following activity diagram summarizes what happens when a user executes a new command to list relevant patients: @@ -459,13 +459,13 @@ the patient will be shown in result. The following sequence diagram shows how the finding of patient would work:
- +
The following activity diagram summarizes what happens when a user executes a new command to find a patient:
- +
#### Design considerations: @@ -491,9 +491,11 @@ The following activity diagram summarizes what happens when a user executes a ne * [DevOps guide](DevOps.md) -------------------------------------------------------------------------------------------------------------------- -## **Appendix: Requirements** +## **Appendix** -### Product scope +### **Appendix: Requirements** + +#### Product scope **Target user profile**: Ward nurses @@ -509,7 +511,7 @@ Ward nurses **Value proposition**: streamlined text-based commands to manage contacts faster than a typical mouse/GUI driven app -### User stories +#### User stories Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unlikely to have) - `*` @@ -526,7 +528,7 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli | `* *` | user | access the user guide through the app easily | learn how to use the Nursing Address Book | | `*` | user | view patient list sorted by name | look through the list of patients in a more organized manner | -### Use cases +#### Use cases (For all use cases below, the **System** is the `Nursing Address Book` and the **Actor** is the `user`, unless specified otherwise) @@ -680,7 +682,7 @@ specified otherwise) Use case ends. -### Non-Functional Requirements +#### Non-Functional Requirements 1. Should work on any _mainstream OS_ as long as it has Java `11` installed. 1. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) @@ -702,7 +704,7 @@ specified otherwise) -------------------------------------------------------------------------------------------------------------------- -## **Appendix: Instructions for manual testing** +### **Appendix: Instructions for manual testing** Given below are instructions to test the app manually. @@ -712,7 +714,7 @@ Given below are instructions to test the app manually. [//]: # (
) -### Launch and shutdown +#### Launch and shutdown 1. Initial launch @@ -726,7 +728,7 @@ Given below are instructions to test the app manually. 2. Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained. -### Adding a patient +#### Adding a patient 1. Adding a patient @@ -755,7 +757,7 @@ Given below are instructions to test the app manually. 8. Test case (Date of Birth after Admission Date): `add n\John Smith ic\A1234567B dob\03/03/2000 ad\01/01/1999 w\a1`
Expected: Similar to previous. -### Viewing patients +#### Viewing patients 1. Viewing all patients @@ -781,7 +783,7 @@ Given below are instructions to test the app manually. 1. Test case: `list w\a1`
Expected: List of patients is shown. -### Editing a patient +#### Editing a patient 1. Edit a patient while all patients are being shown @@ -823,7 +825,7 @@ Given below are instructions to test the app manually. 6. Test case (Invalid Ward): `edit 1 w\B-1 `
Expected: Patient ward is not changed. Error details shown in the status bar. -### Finding a patient +#### Finding a patient 1. Finding a patient by name @@ -857,7 +859,7 @@ Given below are instructions to test the app manually. 1. Test case: `find ic\`
Expected: No patient is shown. -### Deleting a person +#### Deleting a person 1. Deleting a patient while all patients are being shown @@ -873,7 +875,7 @@ Given below are instructions to test the app manually. Expected: Similar to previous. -### Saving data +#### Saving data 1. Dealing with missing/corrupted data files @@ -884,7 +886,7 @@ Given below are instructions to test the app manually. -------------------------------------------------------------------------------------------------------------------- -## Appendix: Planned Enhancements +### Appendix: Planned Enhancements Team size: 5 **1. Checking if a date is valid:** From 22c568379351e505e342673f86bed155dabc320e Mon Sep 17 00:00:00 2001 From: ryanlimdx Date: Sun, 14 Apr 2024 18:36:30 +0800 Subject: [PATCH 7/8] Clean up img tags, bring out glossary --- docs/DeveloperGuide.md | 69 +++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 97b33d54ab7..3469fc17e8a 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -26,6 +26,7 @@ Refer to the guide [_Setting up and getting started_](SettingUp.md).
Architecture diagram +
The ***Architecture Diagram*** given above explains the high-level design of the App. @@ -53,6 +54,7 @@ The *Sequence Diagram* below shows how the components interact with each other f
Architecture sequence diagram +
Each of the four main components (also shown in the diagram above), @@ -68,6 +70,7 @@ implementation of a component), as illustrated in the (partial) class diagram be
Component managers +
The sections below give more details of each component. @@ -77,7 +80,8 @@ The sections below give more details of each component. The **API** of this component is specified in [`Ui.java`](https://github.com/AY2324S2-CS2103T-F10-1/tp/blob/master/src/main/java/seedu/address/ui/Ui.java)
- + Ui class diagram +
The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class which captures the commonalities between classes that represent parts of the visible GUI. @@ -99,12 +103,14 @@ Here's a (partial) class diagram of the `Logic` component:
Logic class diagram +
The sequence diagram below illustrates the interactions within the `Logic` component, taking `execute("delete 1")` API call as an example.
- + Delete sequence diagram +
@@ -122,7 +128,8 @@ How the `Logic` component works: Here are the other classes in `Logic` (omitted from the class diagram above) that are used for parsing a user command:
- + Parser classes +
How the parsing works: @@ -134,7 +141,8 @@ How the parsing works: **API** : [`Model.java`](https://github.com/AY2324S2-CS2103T-F10-1/tp/blob/master/src/main/java/seedu/address/model/Model.java)
- + Model class diagram +
The `Model` component, @@ -149,7 +157,8 @@ The `Model` component, **API** : [`Storage.java`](https://github.com/AY2324S2-CS2103T-F10-1/tp/blob/master/src/main/java/seedu/address/storage/Storage.java)
- + Storage class diagram +
The `Storage` component, @@ -204,14 +213,14 @@ Given below is an example usage scenario and how the add patient feature behaves The following sequence diagram summarizes what happens when a user executes a new command:
- + Add sequence diagram +
- The following activity diagram summarizes what happens when a user executes a new command:
- + Add activity diagram
### Deleting a patient from Nursing Address Book @@ -239,13 +248,14 @@ Given below is an example usage scenario and how the delete patient feature beha Given below is the sequence diagram that summarizes what happens when a user executes a new command:
- + Delete sequence diagram +
The following activity diagram summarizes what happens when a user executes a new command:
- + Delete activity diagram
### Editing a patient's details @@ -275,13 +285,14 @@ The patient specified will have its ward updated to the new ward specified. The following sequence diagram summarizes what happens when a user executes an edit command:
- + Edit sequence diagram +
The following activity diagram summarizes what happens when a user executes an edit command:
- + Edit activity diagram
### Showing help for commands @@ -291,7 +302,8 @@ The following activity diagram summarizes what happens when a user executes an e Showing help for commands is facilitated by the `HelpCommand` class. It allows users to view the usage instructions for the application.
- + Help class diagram +
The `HelpCommand` class interacts with the following components: @@ -324,10 +336,9 @@ Here are the steps involved when a user calls the `help` command: The following sequence diagram shows how the help command works:
- + Help sequence diagram
- #### Design considerations **Aspect: Displaying the help message** @@ -360,7 +371,6 @@ Here are some possible enhancements for the help feature: These enhancements would improve the user experience and make the help feature more interactive and user-friendly. - ### List by tags and/or ward feature #### Implementation @@ -390,7 +400,8 @@ provided, it will still simply create a `ListCommand` object.) The following is a list of objects created thus far:
- + List object diagram +
**Step 4.** The `ListCommand` object is returned to `LogicManager` and `execute` is called. `ListCommand#execute(Model)` @@ -404,13 +415,14 @@ returns the full list of patients.) The following sequence diagram shows how the listing of relevant patients would work:
- + List sequence diagram +
The following activity diagram summarizes what happens when a user executes a new command to list relevant patients:
- + List activity diagram
#### Design considerations: @@ -459,13 +471,14 @@ the patient will be shown in result. The following sequence diagram shows how the finding of patient would work:
- + Find sequence diagram +
The following activity diagram summarizes what happens when a user executes a new command to find a patient:
- + Find activity diagram
#### Design considerations: @@ -695,13 +708,6 @@ specified otherwise) 1. The product should be available as a single JAR file of size 100MB or below. 1. The product should process a user input command within 2 second. -### Glossary - -* **Mainstream OS**: Windows, Linux, Unix, MacOS -* **Patient**: A person receiving medical services at a hospital -* **NRIC**: Identity card number of the National Registration Identity Card, used as a unique identifier for - patients in Nursing Address Book - -------------------------------------------------------------------------------------------------------------------- ### **Appendix: Instructions for manual testing** @@ -914,3 +920,10 @@ We plan to allow nurses to view the corresponding patient's details while editin first input only edit INDEX (as per the original command) and then the app will show the patient's details. The nurse will then be able to edit the specific field(s) of the patient's details with a follow-up command. This will prevent accidental deletion of critical details. + +## Glossary + +* **Mainstream OS**: Windows, Linux, Unix, MacOS +* **Patient**: A person receiving medical services at a hospital +* **NRIC**: Identity card number of the National Registration Identity Card, used as a unique identifier for + patients in Nursing Address Book From 284302b90c6a987a1f2d810a05548a8897b87887 Mon Sep 17 00:00:00 2001 From: ryanlimdx Date: Sun, 14 Apr 2024 18:38:20 +0800 Subject: [PATCH 8/8] Replaced Nursing Address Book with NAB --- docs/DeveloperGuide.md | 72 +++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 3469fc17e8a..1fc6131067d 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -9,7 +9,7 @@ title: Developer Guide ## **Acknowledgements** -* The [original AB3 project](https://github.com/se-edu/addressbook-level3), which Nursing Address Book is based from. +* The [original AB3 project](https://github.com/se-edu/addressbook-level3), which Nursing Address Book (NAB) is based from. * Libraries used: [JavaFX](https://openjfx.io/), [JUnit5](https://github.com/junit-team/junit5), [Jackson](https://github.com/FasterXML/jackson) -------------------------------------------------------------------------------------------------------------------- @@ -176,7 +176,7 @@ Classes used by multiple components are in the `seedu.addressbook.commons` packa This section outlines some notable details on how specific features are being implemented. -### Adding a patient into Nursing Address Book +### Adding a patient into NAB #### Implementation @@ -223,7 +223,7 @@ The following activity diagram summarizes what happens when a user executes a ne Add activity diagram
-### Deleting a patient from Nursing Address Book +### Deleting a patient from NAB #### Implementation @@ -231,7 +231,7 @@ The delete patient feature is facilitated mainly by `DeleteCommand`, `DeleteComm Given below is an example usage scenario and how the delete patient feature behaves at each step. -**Step 1.** The user inputs a delete Command (e.g. `delete 1`) to delete the patient at index 1 in Nursing Address Book. +**Step 1.** The user inputs a delete Command (e.g. `delete 1`) to delete the patient at index 1 in NAB. **Step 2.** `LogicManager#execute(String)` is called to execute the delete command. @@ -266,7 +266,7 @@ Editing a patient's details is facilitated mainly by `EditCommand`, `EditCommand Given below is an example usage scenario and how the edit patient feature behaves at each step. -**Step 1.** The user inputs an edit Command (e.g. `edit 1 w\WB`) to edit the ward of the patient at index 1 in Nursing Address Book. +**Step 1.** The user inputs an edit Command (e.g. `edit 1 w\WB`) to edit the ward of the patient at index 1 in NAB. **Step 2.** `LogicManager#execute(String)` is called to execute the edit command. @@ -538,12 +538,12 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli | `* *` | user | list patients based on their tags | view patients based on category | | `* *` | user | list all patients tied to a specific ward | know which patients belong to which ward | | `* *` | user | find patients via their name or NRIC | quickly find information of specific patient | -| `* *` | user | access the user guide through the app easily | learn how to use the Nursing Address Book | +| `* *` | user | access the user guide through the app easily | learn how to use the NAB | | `*` | user | view patient list sorted by name | look through the list of patients in a more organized manner | #### Use cases -(For all use cases below, the **System** is the `Nursing Address Book` and the **Actor** is the `user`, unless +(For all use cases below, the **System** is the `NAB` and the **Actor** is the `user`, unless specified otherwise) **Use case: `UC01 - View all patient records`** @@ -551,14 +551,14 @@ specified otherwise) **MSS** 1. User requests to list patients. -2. Nursing Address Book shows a list of patients. +2. NAB shows a list of patients. Use case ends. **Extensions** -* 1a. Nursing Address Book detects that the command is invalid. - * 1a1. Nursing Address Book shows an error message. +* 1a. NAB detects that the command is invalid. + * 1a1. NAB shows an error message. Use case ends. @@ -567,15 +567,15 @@ specified otherwise) **MSS** 1. User requests to add a patient. -2. Nursing Address Book adds the patient. -3. Nursing Address Book shows success message to the user. +2. NAB adds the patient. +3. NAB shows success message to the user. Use case ends. **Extensions** -* 1a. Nursing Address Book detects that the patient details is invalid. - * 1a1. Nursing Address Book shows an error message. +* 1a. NAB detects that the patient details is invalid. + * 1a1. NAB shows an error message. Use case ends. @@ -585,8 +585,8 @@ specified otherwise) 1. User requests to view patient records(UC01). 2. User requests to delete a patient in the list. -3. Nursing Address Book deletes the person. -4. Nursing Address Book shows success message to the user. +3. NAB deletes the person. +4. NAB shows success message to the user. Use case ends. @@ -603,15 +603,15 @@ specified otherwise) 1. User requests to view patient records(UC01). 2. User requests to edit a patient's record in the list. -3. Nursing Address Book edits the patient's record. -4. Nursing Address Book shows success message to the user. +3. NAB edits the patient's record. +4. NAB shows success message to the user. Use case ends. **Extensions** -* 2a. Nursing Address Book detects that the patient details is invalid. - * 2a1. Nursing Address Book shows an error message. +* 2a. NAB detects that the patient details is invalid. + * 2a1. NAB shows an error message. Use case ends. @@ -620,14 +620,14 @@ specified otherwise) **MSS** 1. User requests to find a patient in the list with specific name. -2. Nursing Address Book shows the patient. +2. NAB shows the patient. Use case ends. **Extensions** -* 1a. Nursing Address Book detects that the given parameter is invalid. - * 1a1. Nursing Address Book shows an error message. +* 1a. NAB detects that the given parameter is invalid. + * 1a1. NAB shows an error message. Use case ends. @@ -636,14 +636,14 @@ specified otherwise) **MSS** 1. User requests to find a patient in the list with specific NRIC. -2. Nursing Address Book shows the patient. +2. NAB shows the patient. Use case ends. **Extensions** -* 1a. Nursing Address Book detects that the given parameter is invalid. - * 1a1. Nursing Address Book shows an error message. +* 1a. NAB detects that the given parameter is invalid. + * 1a1. NAB shows an error message. Use case ends. @@ -652,14 +652,14 @@ specified otherwise) **MSS** 1. User requests to view patients with specific tags. -2. Nursing Address Book shows the patient list. +2. NAB shows the patient list. Use case ends. **Extensions** -* 1a. Nursing Address Book detects that the given parameter is invalid. - * 1a1. Nursing Address Book shows an error message. +* 1a. NAB detects that the given parameter is invalid. + * 1a1. NAB shows an error message. Use case ends. @@ -668,14 +668,14 @@ specified otherwise) **MSS** 1. User requests to view patients in specific ward. -2. Nursing Address Book shows the patient. +2. NAB shows the patient. Use case ends. **Extensions** -* 1a. Nursing Address Book detects that the given parameter is invalid. - * 1a1. Nursing Address Book shows an error message. +* 1a. NAB detects that the given parameter is invalid. + * 1a1. NAB shows an error message. Use case ends. @@ -684,14 +684,14 @@ specified otherwise) **MSS** 1. User requests to get help with command usage. -2. Nursing Address Book shows command usage. +2. NAB shows command usage. Use case ends. **Extensions** -* 1a. Nursing Address Book detects that the command is invalid. - * 1a1. Nursing Address Book shows an error message. +* 1a. NAB detects that the command is invalid. + * 1a1. NAB shows an error message. Use case ends. @@ -926,4 +926,4 @@ We plan to allow nurses to view the corresponding patient's details while editin * **Mainstream OS**: Windows, Linux, Unix, MacOS * **Patient**: A person receiving medical services at a hospital * **NRIC**: Identity card number of the National Registration Identity Card, used as a unique identifier for - patients in Nursing Address Book + patients in NAB