Skip to content

Commit

Permalink
Merge branch 'master' into fix-list
Browse files Browse the repository at this point in the history
  • Loading branch information
erv-teo authored Apr 4, 2024
2 parents 7006d29 + 7f65def commit e26efa9
Show file tree
Hide file tree
Showing 38 changed files with 764 additions and 439 deletions.
463 changes: 323 additions & 140 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/SettingUp.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ If you plan to use Intellij IDEA (highly recommended):

1. **Learn the design**

When you are ready to start coding, we recommend that you get some sense of the overall design by reading about [AddressBook’s architecture](DeveloperGuide.md#architecture).
When you are ready to start coding, we recommend that you get some sense of the overall design by reading about [Nursing Address Book’s architecture](DeveloperGuide.md#architecture).

1. **Do the tutorials**
These tutorials will help you get acquainted with the codebase.
Expand Down
147 changes: 89 additions & 58 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Designed for efficiency, NAB enables quick access to patient records, streamline

2. Download the latest `nab.jar` from [here](https://github.com/AY2324S2-CS2103T-F10-1/tp/releases).

3. Copy the file to the folder you want to use as the _home folder_ for your AddressBook.
3. Copy the file to the folder you want to use as the _home folder_ for your Nursing Address Book.

4. Open a command terminal, For Windows users, search for `cmd` in the Start menu and run it as an administrator if necessary. Use the `cd` command to navigate to the folder where you placed the jar file. Run the application by executing `java -jar nab.jar`.<br>
Shortly, a GUI resembling the following should display, including some sample input to get you started:<br>
Expand Down Expand Up @@ -80,75 +80,96 @@ Designed for efficiency, NAB enables quick access to patient records, streamline

Adds a new patient's information to the address book.

Format: `add n\NAME ic\IC_NUMBER dob\DATE_OF_BIRTH ad\ADMISSION_DATE w\WARD [t\TAG]…​`
Format: `add n\NAME ic\IC_NUMBER dob\DATE_OF_BIRTH ad\ADMISSION_DATE w\WARD [r\REMARK] [t\TAG]…​`

<div markdown="span" class="alert alert-primary">:bulb: **Tip:**
A person can have any number of tags (including 0)
</div>

* NAME: The full name of the patient. Only alphabetical characters are accepted. Each word should be split with a whitespace.
* IC: The Identification Number of the patient. It must start with a capital letter, followed by a 7-digit number and ends with a capital letter.
* DATE_OF_BIRTH: The patient's date of birth in DD/MM/YYYY format. Dates must be in the past.
* IC_NUMBER: The Identification Number of the patient. It must start with a capital letter, followed by a 7-digit number and ends with a capital letter.
* DATE_OF_BIRTH: The patient's date of birth in DD/MM/YYYY format. Date of birth must not be later than admission date, and not be later than the current date.
* ADMISSION_DATE: The date the patient was admitted to the ward, also in DD/MM/YYYY format. This date should not be later than the current date.
* WARD: The ward where the patient is located. This should contain alphanumeric characters only, with no spaces.
* REMARK: Optional remarks about the patient (e.g. "Patient is an amputee"). Remarks have no limited length, and can only be used once.
* TAG: Optional tags to categorize the patient by health condition or other descriptors. Tags should be alphanumeric and can be used multiple times.


* Example command:

`add n\John Doe ic\T1234567P dob\21/03/2000 ad\02/02/2022 w\A1 t\FallRisk t\Diabetes`
`add n\John Doe ic\T1234567P dob\21/03/2000 ad\02/02/2022 w\A1 t\FallRisk r\Requires assistance feeding. t\Diabetes`

```
The patient, John Doe, is added! Here are his details:
John Doe
1. John Doe
IC: T1234567P
Date of Birth: 21 Mar 2000
Admission Date: 2 Feb 2022
DOB: 21 Mar 2000
Ward: A1
Admission Date: 2 Feb 2022
Remarks:
Tags: FallRisk, Diabetes
You now have 1 patient(s) in your address book.
```

### Listing all patients : `list`
### Listing patients : `list`

Displays a list of patients in NAB.

Displays a list of all registered patients.
By using list with optional parameters, you will be able to list all patients.

Format: `list`, `list [w\WARD] [t\TAG]...`
Optionally, you can filter by ward or tags to list only patients in a specific ward or with specific tags.

Format: `list [w\WARD] [t\TAG]...`

* WARD: Must only list at most 1 ward.

Example command:
(For the below commands for list, we assume the list contains 2 people, John Doe and Jane Doe)

`list`
```
Here are the details of the 2 patients in your contact book:
Listed all persons
1. John Doe
IC: T1234567P
DOB: 21 Mar 2000
Ward: A1
Admission Date: 2 Feb 2022
Remarks:
Tags: FallRisk, Diabetes
2. Jane Doe
IC: T1234765P
DOB: 22 Apr 2000
Ward: A2
Admission Date: 3 Feb 2022
Remarks: Likes to read
Tags: FallRisk, Diabetes
```

Example command:

`list w\B4 t\SeverAllergies`
`list w\B4 t\SevereAllergies`

```
Listed all persons with:
Tags: FallRisk
Ward: B4
Jane Doe
IC: I2103210P
Date of Birth: 12 Nov 1999
Admission Date: 3 Mar 2024
Ward: B4
Tags: SevereAllergies
1. Jane Doe
IC: T1234765P
DOB: 22 Apr 2000
Ward: A2
Admission Date: 3 Feb 2022
Remarks: Likes to read
Tags: FallRisk, Diabetes
```

### Editing a patient : `edit`
### Editing a patient's details : `edit`

Edits an existing patient's details in the address book.

Format: `edit INDEX [n\NAME] [ic\IC_NUMBER] [dob\DATE_OF_BIRTH] [ad\ADMISSION_DATE] [w\WARD] [t\TAG]…​`
Format: `edit INDEX [n\NAME] [ic\IC_NUMBER] [dob\DATE_OF_BIRTH] [ad\ADMISSION_DATE] [w\WARD] [r\REMARK] [t\TAG]…​`

* Edits the patient details at the specified `INDEX`. The index refers to the index number shown in the displayed list. The index **must be a positive integer** 1, 2, 3, …​
* At least one of the optional fields must be provided.
Expand All @@ -159,10 +180,21 @@ Format: `edit INDEX [n\NAME] [ic\IC_NUMBER] [dob\DATE_OF_BIRTH] [ad\ADMISSION_DA

Example command:

`edit 1 ic\T0123456P t\ `
`edit 1 ic\T0123456P t\ r\`

_Edits the IC_NUMBER and TAGS of the 1st person to be `T0123456P` and empty respectively._
_Edits the IC_NUMBER, TAGS and REMARKS of the 1st person to be `T0123456P` for IC_NUMBER and empty for both tags and remarks._

**Before**:
```
John Doe
IC: T1234567P
Date of Birth: 21 Mar 2000
Admission Date: 2 Feb 2022
Ward: A1
Remarks: Requires assistance feeding.
Tags: FallRisk, Diabetes
```
**After**:
```
Edited details of patient 1 in your contact book as follows:
Expand All @@ -171,25 +203,28 @@ IC: T0123456P
Date of Birth: 21 Mar 2000
Admission Date: 2 Feb 2022
Ward: A1
Remarks:
Tags:
```

### Locating patients by name: `find`
### Locating patients either by name or by IC: `find`

Finds patients whose names contain any of the given keywords.
You can find patients whose names or IC contain any of the given keywords.

Format: `find KEYWORD [MORE_KEYWORDS]`
Format: `find [n\NAME] [ic\IC_NUMBER]`

* The search is case-insensitive. e.g `hans` will match `Hans`
* Exactly one of the optional fields must be provided
* 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`
* Only full IC will be matched e.g. `a1234567b` will not match `123`

Examples:
* `find John` returns `john` and `John Doe`
* `find alex david` returns `Alex Yeoh`, `David Li`<br>
* `find n\John` returns `john` and `John Doe`
* `find n\alex david` returns `Alex Yeoh` and `David Li`
* `find ic\a1234567b` returns `A1234567B`<br>

### Deleting a patient : `delete`

Expand All @@ -203,16 +238,15 @@ Format: `delete INDEX`

Example command:

`list` followed by `delete 2` deletes the 2nd person in the address book.
`delete 2` deletes the 2nd person in the address book.
```
Jane Doe is deleted. Their details were:
Date of Birth: 12 Nov 1999
Admission Date: 3 Mar 2024
Deleted Person: Jane Doe
IC: A1234567B
DOB: 02/02/2000
Ward: A1
Admitted: 02/02/2020
Remarks: likes to go to the park
Tags: SevereAllergies
You now have 1 patient(s) in your contact book.
```
### Viewing help : `help`

Expand All @@ -225,30 +259,31 @@ Output:
```
Here are the list of available commands:
Add: add n\NAME ic\IC_NUMBER dob\DATE_OF_BIRTH ad\ADMISSION_DATE w\WARD [t\TAG]...
Example: add n\John Doe ic\T1234567P dob\01/01/2000 ad\25/03/2024 w\A1 t\Diabetes t\FallRisk
Add: add n\NAME ic\IC_NUMBER dob\DATE_OF_BIRTH ad\ADMISSION_DATE w\WARD [r\REMARK] [t\TAG]...
Example: add n\John Doe ic\T1234567P dob\01/01/2000 ad\25/03/2024 w\A1 r\Has a sweet tooth. t\Diabetes t\FallRisk
Clear: clear
Clear: clear
Clears all entries from the address book.
Delete: delete INDEX
Example: delete 3
Edit: edit INDEX [n\NAME] [ic\IC_NUMBER] [dob\DATE_OF_BIRTH] [ad\ADMISSION_DATE] [w\WARD] [t\TAG]...
Edit: edit INDEX [n\NAME] [ic\IC_NUMBER] [dob\DATE_OF_BIRTH] [ad\ADMISSION_DATE] [w\WARD] [r\REMARK] [t\TAG]...
Example: edit 1 ic\T0123456P t\
Find: find KEYWORD [MORE_KEYWORDS]
Example: find John
Example: find John
List: list
Lists all patients.
Exit: exit
Exits the application.
For more detailed information on each command, please refer to the User Guide.
```


### Clearing all entries : `clear`

Clears all entries from the address book.
Expand All @@ -263,47 +298,43 @@ Format: `exit`

### Saving the data

AddressBook data are saved in the hard disk automatically after any command that changes the data. There is no need to save manually.
Data from Nursing Address Book are saved in the hard disk automatically after any command that changes the data. There is no need to save manually.

### Editing the data file

AddressBook data are saved automatically as a JSON file `[JAR file location]/data/addressbook.json`. Advanced users are welcome to update data directly by editing that data file.
Nursing Address Book data are saved automatically as a JSON file `[JAR file location]/data/addressbook.json`. Advanced users are welcome to update data directly by editing that data file.

<div markdown="span" class="alert alert-warning">:exclamation: **Caution:**
If your changes to the data file makes its format invalid, AddressBook will discard all data and start with an empty data file at the next run. Hence, it is recommended to take a backup of the file before editing it.<br>
Furthermore, certain edits can cause the AddressBook to behave in unexpected ways (e.g., if a value entered is outside of the acceptable range). Therefore, edit the data file only if you are confident that you can update it correctly.
If your changes to the data file makes its format invalid, Nursing Address Book will discard all data and start with an empty data file at the next run. Hence, it is recommended to take a backup of the file before editing it.<br>
Furthermore, certain edits can cause the Nursing Address Book to behave in unexpected ways (e.g., if a value entered is outside of the acceptable range). Therefore, edit the data file only if you are confident that you can update it correctly.
</div>

### Viewing help : `help`

Shows a message explaining commands available.

_coming in v1.3 ..._

--------------------------------------------------------------------------------------------------------------------

## FAQ

**Q**: How do I transfer my data to another Computer?<br>
**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 AddressBook home folder.
**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 Nursing Address Book home folder.

--------------------------------------------------------------------------------------------------------------------

## Known issues

1. **When using multiple screens**, if you move the application to a secondary screen, and later switch to using only the primary screen, the GUI will open off-screen. The remedy is to delete the `preferences.json` file created by the application before running the application again.

--------------------------------------------------------------------------------------------------------------------


## Command summary

Action | Format, Examples
--------|------------------
**Add** | `add n\NAME ic\IC_NUMBER dob\DATE_OF_BIRTH ad\ADMISSION_DATE w\WARD [t\TAG]…​` <br> e.g., `add n\James Ho ic\A1234567B dob\21/03/1999 ad\21/01/2023 w\A1 t\HearingImpaired`
**Add** | `add n\NAME ic\IC_NUMBER dob\DATE_OF_BIRTH ad\ADMISSION_DATE w\WARD [r\REMARK] [t\TAG]…​` <br> e.g., `add n\James Ho ic\A1234567B dob\21/03/1999 ad\21/01/2023 w\A1 r\Can read lips. t\HearingImpaired`
**Clear** | `clear`
**Delete** | `delete INDEX`<br> e.g., `delete 3`
**Edit** | `edit INDEX [n\NAME] [ic\IC_NUMBER] [dob\DATE_OF_BIRTH] [ad\ADMISSION_DATE] [w\WARD] [t\TAG]…​`<br> e.g.,`edit 2 n\James Lee w\A2`
**Find** | `find KEYWORD [MORE_KEYWORDS]`<br> e.g., `find James Jake`
**Edit** | `edit INDEX [n\NAME] [ic\IC_NUMBER] [dob\DATE_OF_BIRTH] [ad\ADMISSION_DATE] [w\WARD] [r\REMARK] [t\TAG]…​`<br> e.g.,`edit 2 n\James Lee w\A2`
**Find** | `find n\KEYWORD [MORE_KEYWORDS]`, `find ic\KEYWORD`<br> e.g., `find n\James Jake`, `find ic\a1234567b`
**List** | `list`
**Help** | `help`

Expand Down
19 changes: 8 additions & 11 deletions docs/diagrams/AddSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ end box
box Model MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
end box
'add parameters of add command here'
[-> LogicManager : execute("add")
[-> LogicManager : execute("add n\Alice \n ic\A0055679T ad\01/01/2022 \n dob\01/01/2002 w\WA")
activate LogicManager
'add parameters of add command here'
LogicManager -> AddressBookParser : parseCommand("add ")
LogicManager -> AddressBookParser : parseCommand("add n\Alice \n ic\A0055679T ad\01/01/2022 \n dob\01/01/2002 w\WA")
activate AddressBookParser

create AddCommandParser
Expand All @@ -26,8 +24,7 @@ activate AddCommandParser

AddCommandParser --> AddressBookParser
deactivate AddCommandParser
'add parameters of add command here; replace '1''
AddressBookParser -> AddCommandParser : parse("1")
AddressBookParser -> AddCommandParser : parse(" n\Alice \n ic\A0055679T ad\01/01/2022 \n dob\01/01/2002 w\WA")
activate AddCommandParser

create AddCommand
Expand All @@ -37,19 +34,19 @@ activate AddCommand
AddCommand --> AddCommandParser :
deactivate AddCommand

AddCommandParser --> AddressBookParser : a
AddCommandParser --> AddressBookParser
deactivate AddCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
AddCommandParser -[hidden]-> AddressBookParser
destroy AddCommandParser

AddressBookParser --> LogicManager : a
AddressBookParser --> LogicManager
deactivate AddressBookParser

LogicManager -> AddCommand : execute(m)
LogicManager -> AddCommand : execute(model)
activate AddCommand
'add parameters of add command here; replace '1''
AddCommand -> Model : AddPerson(1)
AddCommand -> Model : addPerson(person)
activate Model

Model --> AddCommand
Expand All @@ -62,7 +59,7 @@ activate CommandResult
CommandResult --> AddCommand
deactivate CommandResult

AddCommand --> LogicManager : r
AddCommand --> LogicManager :
deactivate AddCommand

[<--LogicManager
Expand Down
1 change: 1 addition & 0 deletions docs/diagrams/BetterModelClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ Person *--> Ic
Person *--> Dob
Person *--> AdmissionDate
Person *--> Ward
Person *--> Remark
@enduml
Loading

0 comments on commit e26efa9

Please sign in to comment.