diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 90ef9545c5b..07e77a61ab5 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -4,7 +4,7 @@ title: User Guide nav_order : 2 --- # Nursing Address Book (NAB) -Nursing Address Book (NAB) is a desktop application tailored for ward nurses, optimizing patient contact management via a Command Line Interface (CLI) while incorporating a Graphical User Interface (GUI) for ease of use. +Nursing Address Book (NAB) is a desktop application tailored for ward nurses in Singapore, optimizing patient contact management via a Command Line Interface (CLI) while incorporating a Graphical User Interface (GUI) for ease of use. Designed for efficiency, NAB enables quick access to patient records, streamlined contact management, and simplified logging of care details, proving to be a valuable tool for fast typists and those who prefer the precision of CLI operations. ## Table of Contents @@ -78,7 +78,7 @@ Designed for efficiency, NAB enables quick access to patient records, streamline ### Adding a patient: `add` -Adds a new patient's information to the address book. +Allows you to add 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 [r\REMARK] [t\TAG]…​` @@ -115,15 +115,14 @@ You now have 1 patient(s) in your address book. ### Listing patients : `list` -Displays a list of patients in NAB. +Allows you to view a list of patients in NAB. With no optional parameters, you will be able to list all patients. -By using list with optional parameters, you will be able to list all patients. - -Optionally, you can filter by ward or tags to list only patients in a specific ward or with specific tags. +You may also filter by ward and/or tags to list only patients in a specific ward and/or with specific tags. Format: `list [w\WARD] [t\TAG]...` * WARD: Must only list at most 1 ward. +* If multiple tags are provided, only patients with tags that encompass all the provided tags will be listed. (For the below commands for list, we assume the list contains 2 people, John Doe and Jane Doe) @@ -142,10 +141,10 @@ Tags: FallRisk, Diabetes 2. Jane Doe IC: T1234765P DOB: 22 Apr 2000 -Ward: A2 +Ward: B4 Admission Date: 3 Feb 2022 Remarks: Likes to read -Tags: FallRisk, Diabetes +Tags: FallRisk, SevereAllergies ``` @@ -159,20 +158,20 @@ Ward: B4 1. Jane Doe IC: T1234765P DOB: 22 Apr 2000 -Ward: A2 +Ward: B4 Admission Date: 3 Feb 2022 Remarks: Likes to read -Tags: FallRisk, Diabetes +Tags: FallRisk, SevereAllergies ``` ### Editing a patient's details : `edit` -Edits an existing patient's details in the address book. +Allows you to edit 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] [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. +* You must provide at least one of the optional fields. * Existing values will be updated to the input values. * When editing tags, the existing tags of the patient will be removed i.e adding of tags is not cumulative. * You can remove all the patient’s tags by typing `t\ ` without @@ -209,7 +208,7 @@ Tags: ### Locating patients either by name or by IC: `find` -You can find patients whose names or IC contain any of the given keywords. +Allows you to find patients whose names or IC contain any of the given keywords. Format: `find n\NAME [MORE_NAMES] OR find ic\IC_NUMBER` @@ -228,7 +227,7 @@ Examples: ### Deleting a patient : `delete` -Deletes the specified patient from the address book. +Allows you to delete the specified patient from the address book. Format: `delete INDEX` @@ -250,7 +249,7 @@ Tags: SevereAllergies ``` ### Viewing help : `help` -Shows a message explaining the available commands and their usage. +Allows you to view a message explaining the available commands and their usage. Format: `help` @@ -293,13 +292,16 @@ For more detailed information on each command, please refer to the User Guide. ### Clearing all entries : `clear` -Clears all entries from the address book. +Allows you to clear all entries from the address book. + +:exclamation: **Caution:** This action is irreversible. + Format: `clear` ### Exiting the program : `exit` -Exits the program. +Allows you to exit the program. Format: `exit` @@ -316,10 +318,6 @@ If your changes to the data file makes its format invalid, Nursing Address Book 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. -### Viewing help : `help` - -Shows a message explaining commands available. - -------------------------------------------------------------------------------------------------------------------- ## FAQ @@ -345,6 +343,22 @@ Action | Format, Examples **List** | `list` **Help** | `help` +## Glossary + +Term | Further Explanation, Representation and Examples +--------|------------------ +**Alphanumeric** | A string that must contain any of alphabetical and numerical characters only. Excludes other special characters, whitespace etc. e.g., `A1`, `T1234567P`. +**CLI** | Command Line Interface +**GUI** | Graphical User Interface +**INDEX** | A positive integer that represents the position of a patient in the displayed list. e.g., `1`, `2`, `3`. +**NAME** | The name of a patient. e.g., `John Doe`. +**IC_NUMBER** | A unique identification number in the format of a capital letter, followed by a 7-digit number, and ending with a capital letter. e.g., `T1234567Z`. Note that while the platform performs some level of IC validation, it is up to the user to ensure that the IC is accurate. +**DATE_OF_BIRTH** | The date of birth of a patient in the format of dd/MM/yyyy. e.g., `21/03/2000`. Note that while the platform performs some level of date validation, it is up to the user to ensure that the date is accurate (not in the future etc). +**ADMISSION_DATE** | The date a patient was admitted to the ward in the format of dd/MM/yyyy. e.g., `21/03/2022`. Note that while the platform performs some level of date validation, it is up to the user to ensure that the date is accurate (not in the future etc). +**WARD** | The ward where a patient is located. e.g., `A1`. +**REMARK** | Optional remarks about a patient. e.g., `Patient is an amputee`. +**TAG** | Optional tags to categorize a patient by health condition or other descriptors. e.g., `FallRisk`, `Diabetes`. + -------------------------------------------------------------------------------------------------------------------- ## Troubleshooting diff --git a/src/main/java/seedu/address/logic/LogicManager.java b/src/main/java/seedu/address/logic/LogicManager.java index 5aa3b91c7d0..66b8c04851f 100644 --- a/src/main/java/seedu/address/logic/LogicManager.java +++ b/src/main/java/seedu/address/logic/LogicManager.java @@ -28,7 +28,6 @@ public class LogicManager implements Logic { "Could not save data to file %s due to insufficient permissions to write to the file or the folder."; private final Logger logger = LogsCenter.getLogger(LogicManager.class); - private final Model model; private final Storage storage; private final AddressBookParser addressBookParser; diff --git a/src/main/java/seedu/address/logic/Messages.java b/src/main/java/seedu/address/logic/Messages.java index 9245dc138c0..6ef941a8b4d 100644 --- a/src/main/java/seedu/address/logic/Messages.java +++ b/src/main/java/seedu/address/logic/Messages.java @@ -18,6 +18,7 @@ public class Messages { public static final String MESSAGE_PERSONS_LISTED_OVERVIEW = "%1$d persons listed!"; public static final String MESSAGE_DUPLICATE_FIELDS = "Multiple values specified for the following single-valued field(s): "; + /** * Returns an error message indicating the duplicate prefixes. */ @@ -50,5 +51,4 @@ public static String format(Person person) { person.getTags().forEach(builder::append); return builder.toString(); } - } diff --git a/src/main/java/seedu/address/logic/commands/ClearCommand.java b/src/main/java/seedu/address/logic/commands/ClearCommand.java index 9c86b1fa6e4..e62ad0df2d5 100644 --- a/src/main/java/seedu/address/logic/commands/ClearCommand.java +++ b/src/main/java/seedu/address/logic/commands/ClearCommand.java @@ -13,7 +13,6 @@ public class ClearCommand extends Command { public static final String COMMAND_WORD = "clear"; public static final String MESSAGE_SUCCESS = "Address book has been cleared!"; - @Override public CommandResult execute(Model model) { requireNonNull(model); diff --git a/src/main/java/seedu/address/logic/commands/DeleteCommand.java b/src/main/java/seedu/address/logic/commands/DeleteCommand.java index 1135ac19b74..03d5f6d2a24 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteCommand.java @@ -27,6 +27,9 @@ public class DeleteCommand extends Command { private final Index targetIndex; + /** + * Creates a DeleteCommand to delete the person at the specified {@code Index} + */ public DeleteCommand(Index targetIndex) { this.targetIndex = targetIndex; } diff --git a/src/main/java/seedu/address/logic/commands/EditCommand.java b/src/main/java/seedu/address/logic/commands/EditCommand.java index 3b39a462ea7..6848c033af3 100644 --- a/src/main/java/seedu/address/logic/commands/EditCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditCommand.java @@ -57,7 +57,6 @@ public class EditCommand extends Command { public static final String MESSAGE_EDIT_PERSON_SUCCESS = "Edited Person: %1$s"; public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided."; public static final String MESSAGE_DUPLICATE_PERSON = "A patient with this IC already exists in the address book."; - public static final String MESSAGE_DOB_AFTER_ADMISSION = "Date of birth should not be later than date of admission."; @@ -180,10 +179,16 @@ public boolean isAnyFieldEdited() { return CollectionUtil.isAnyNonNull(name, ic, dob, admissionDate, ward, tags, remark); } + /** + * Sets {@code name} to this object's {@code name}. + */ public void setName(Name name) { this.name = name; } + /** + * Returns an {@code Optional} containing the {@code name} of this object. + */ public Optional getName() { return Optional.ofNullable(name); } @@ -253,7 +258,6 @@ public boolean equals(Object other) { && Objects.equals(admissionDate, otherEditPersonDescriptor.admissionDate) && Objects.equals(ward, otherEditPersonDescriptor.ward) && Objects.equals(remark, otherEditPersonDescriptor.remark); - } @Override diff --git a/src/main/java/seedu/address/logic/commands/FindCommand.java b/src/main/java/seedu/address/logic/commands/FindCommand.java index 20a601f2084..464d5701322 100644 --- a/src/main/java/seedu/address/logic/commands/FindCommand.java +++ b/src/main/java/seedu/address/logic/commands/FindCommand.java @@ -27,6 +27,9 @@ public class FindCommand extends Command { private final Predicate predicate; + /** + * Creates a FindCommand to find the specified {@code Predicate} + */ public FindCommand(Predicate predicate) { this.predicate = predicate; } diff --git a/src/main/java/seedu/address/logic/commands/ListCommand.java b/src/main/java/seedu/address/logic/commands/ListCommand.java index df978612c3f..7de28362c81 100644 --- a/src/main/java/seedu/address/logic/commands/ListCommand.java +++ b/src/main/java/seedu/address/logic/commands/ListCommand.java @@ -28,10 +28,18 @@ public class ListCommand extends Command { public static final String MESSAGE_SUCCESS_LIST = "Listed all persons with: %1$s"; private final ListKeywordsPredicate predicate; + /** + * Creates a ListCommand to list relevant patients as filtered by predicate. + * + * @param predicate the predicate to filter the list of patients. + */ public ListCommand(ListKeywordsPredicate predicate) { this.predicate = predicate; } + /** + * Creates a ListCommand to list all persons. + */ public ListCommand() { this.predicate = null; } diff --git a/src/main/java/seedu/address/logic/parser/ParserUtil.java b/src/main/java/seedu/address/logic/parser/ParserUtil.java index fb1a10e44b0..2dd9a797ea2 100644 --- a/src/main/java/seedu/address/logic/parser/ParserUtil.java +++ b/src/main/java/seedu/address/logic/parser/ParserUtil.java @@ -174,5 +174,4 @@ public static Remark parseRemark(String remark) throws ParseException { return new Remark(trimmedRemark); } } - } diff --git a/src/main/java/seedu/address/model/person/AdmissionDate.java b/src/main/java/seedu/address/model/person/AdmissionDate.java index ef51af43dfd..8084a7f13af 100644 --- a/src/main/java/seedu/address/model/person/AdmissionDate.java +++ b/src/main/java/seedu/address/model/person/AdmissionDate.java @@ -16,6 +16,7 @@ public class AdmissionDate { public static final String MESSAGE_CONSTRAINTS_OCCURRENCE = "Admission date should not be earlier than date of birth or later than current date"; private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); + public final LocalDate date; public final String value; diff --git a/src/main/java/seedu/address/model/person/Dob.java b/src/main/java/seedu/address/model/person/Dob.java index 890aa7ddbed..a728d9490d0 100644 --- a/src/main/java/seedu/address/model/person/Dob.java +++ b/src/main/java/seedu/address/model/person/Dob.java @@ -59,7 +59,6 @@ public static boolean isValidDob(String dob) { return false; } - @Override public String toString() { return value; diff --git a/src/main/java/seedu/address/model/person/Ic.java b/src/main/java/seedu/address/model/person/Ic.java index 3b950c35e98..95548f2ea47 100644 --- a/src/main/java/seedu/address/model/person/Ic.java +++ b/src/main/java/seedu/address/model/person/Ic.java @@ -11,8 +11,9 @@ public class Ic { "ICs starts with a capital letter, followed by a 7 digit number and ends with a capital letter." + "It should not be blank."; - // singapore regex for ic + // Singapore regex for ic public static final String VALIDATION_REGEX = "^[A-Z]\\d{7}[A-Z]$"; + public final String value; /** @@ -25,6 +26,10 @@ public Ic(String value) { checkArgument(isValidIc(value), MESSAGE_CONSTRAINTS); this.value = value; } + + /** + * Returns true if a given string is a valid IC. + */ public static boolean isValidIc(String ic) { return ic.matches(VALIDATION_REGEX); } diff --git a/src/main/java/seedu/address/model/person/Name.java b/src/main/java/seedu/address/model/person/Name.java index 573f0e4b9b0..f149096fbf0 100644 --- a/src/main/java/seedu/address/model/person/Name.java +++ b/src/main/java/seedu/address/model/person/Name.java @@ -37,7 +37,6 @@ public static boolean isValidName(String test) { return test.matches(VALIDATION_REGEX); } - @Override public String toString() { return fullName; @@ -62,5 +61,4 @@ public boolean equals(Object other) { public int hashCode() { return fullName.hashCode(); } - } diff --git a/src/main/java/seedu/address/model/person/Person.java b/src/main/java/seedu/address/model/person/Person.java index 93e64889f7e..380e2562999 100644 --- a/src/main/java/seedu/address/model/person/Person.java +++ b/src/main/java/seedu/address/model/person/Person.java @@ -21,7 +21,6 @@ public class Person { private final Dob dob; private final Ic ic; - // Data fields private final Set tags = new HashSet<>(); private final AdmissionDate admissionDate; @@ -133,5 +132,4 @@ public String toString() { .add("remark", remark) .toString(); } - }