From 92f96227abc05bd7e3d3a19efaf901c90a081785 Mon Sep 17 00:00:00 2001 From: "e0968962@u.nus.edu" Date: Mon, 11 Nov 2024 10:54:11 +0800 Subject: [PATCH 1/8] Modify DG to guide the users correctly --- docs/UserGuide.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 891ef52f61..a0a91f6c38 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -6,11 +6,12 @@ layout: default --- ## Introduction -BookBob is a desktop application tailored for Dr Bob's private General Practitioner clinic. It facilitates the storage -and retrieval of patient information, including names, NRICs, genders, dates of birth, phone numbers, home addresses, -allergies, medical histories and visit records with details on diagnoses and prescribed medications. BookBob also helps -Dr Bob stay organised by tracking daily appointments and providing reminders each morning. Optimised for a Command Line -Interface (CLI), BookBob allows for efficient management of patient information and appointments. +BookBob is a desktop application tailored for Dr Bob's private General Practitioner clinic, which operates on an +appointment basis. Patients book appointments to visit Dr Bob. BookBob helps streamline clinic management by storing +and retrieving patient information, including names, NRICs, genders, dates of birth, phone numbers, home addresses, +allergies, medical histories and detailed visit records with diagnoses and prescribed medications. BookBob also assists +Dr Bob in staying organised by tracking daily appointments and sending reminders each morning. Optimised for a Command +Line Interface (CLI), BookBob enables efficient management of patient information and appointment scheduling. --- ## Table of Contents @@ -389,7 +390,7 @@ No patient visit record found with NRIC: S7209876Y By diagnosis:
Format: findDiagnosis diagnosis
Note :
-• Single diagnosis to be entered. All corresponding patients' information and visit records will be printed to terminal, +• Single diagnosis to be entered (case-insensitive). All corresponding patients' information and visit records will be printed to terminal, with exactly matched diagnosis.
Example: `findDiagnosis Runny Nose` @@ -412,7 +413,7 @@ No patient found with symptom: Runny Nose By Medication:
Format: findMedication medication
Note :
-• Single diagnosis to be entered. All corresponding patients' information and visit records will be printed to terminal, +• Single medicationj to be entered (case-insensitive). All corresponding patients' information and visit records will be printed to terminal, with exactly matched medication.
Example: `findMedication Panadol` @@ -463,8 +464,8 @@ Format: appointment ic/NRIC date/DATE time/TIME \ Note: Deleting a Patient Appointment is case-insensitive. #### Extra Information -Date format is in DD-MM-YYYY and Time format is in HH:mm\ -The nric is case-insensitive +Date format is in DD-MM-YYYY and time format is in HH:mm\ +The NRIC is case-insensitive Example: `deleteAppointment ic/S1234567A date/18-11-2024 time/18:00` ``` @@ -488,7 +489,7 @@ Appointment on 18-11-2024 18:00 with Patient Will Smith, S7654321A. --- ## Finding a Patient Appointment -Find an appointment with a patient based on the given name, nric, date or time\ +Find an appointment with a patient based on the given name, NRIC, date or time\ Format: findAppointment n/NAME OR\ findAppointment ic/NRIC OR\ @@ -497,7 +498,7 @@ findAppointment time/TIME #### Extra Information: Date format is in DD-MM-YYYY and Time format is in HH:mm -The name and nric are case-insensitive +The name and NRIC are case-insensitive Example: `findAppointment n/John` ``` From 5b2e58b3c2e5c02b89311e0f83dc1a63d5b87906 Mon Sep 17 00:00:00 2001 From: "e0968962@u.nus.edu" Date: Mon, 11 Nov 2024 10:54:42 +0800 Subject: [PATCH 2/8] Modify findVisit to include patient's name when printing out (besides visit details) --- src/main/java/bookbob/functions/CommandHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/bookbob/functions/CommandHandler.java b/src/main/java/bookbob/functions/CommandHandler.java index 767709b270..ea07dda367 100644 --- a/src/main/java/bookbob/functions/CommandHandler.java +++ b/src/main/java/bookbob/functions/CommandHandler.java @@ -651,6 +651,7 @@ public void findVisitByIc(String nric, Records records) { if (patient.getNric().equals(nric)) { ArrayList visits = patient.getVisits(); isFound = true; + System.out.println("Patient name: " + patient.getName()); for (Visit visit : visits) { System.out.println(visit.toString()); From cbaa0fb9212bb751a17318ef399e67b582466bbb Mon Sep 17 00:00:00 2001 From: "e0968962@u.nus.edu" Date: Mon, 11 Nov 2024 10:55:18 +0800 Subject: [PATCH 3/8] Extract the method as printUnknownCommand(String command) --- src/main/java/bookbob/parser/Parser.java | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/bookbob/parser/Parser.java b/src/main/java/bookbob/parser/Parser.java index b3d152a7c5..749fa96182 100644 --- a/src/main/java/bookbob/parser/Parser.java +++ b/src/main/java/bookbob/parser/Parser.java @@ -32,8 +32,7 @@ public static boolean handleCommand(String input, CommandHandler commandHandler, switch (command) { case "help": if (inputArray.length > 1) { - System.out.println("Unknown command. Type 'help' for a list of commands."); - logger.log(Level.INFO, "Unknown command received: {0}", command); + printUnknownCommand(command); break; } logAndExecute("help", commandHandler::help); @@ -59,7 +58,7 @@ public static boolean handleCommand(String input, CommandHandler commandHandler, throw new RuntimeException(e); } } else { - System.out.println("Please specify an NRIC to delete."); + System.out.println("Please specify a NRIC to delete."); logger.log(Level.INFO, "Empty NRIC inputted for delete command"); } }); @@ -67,8 +66,7 @@ public static boolean handleCommand(String input, CommandHandler commandHandler, case "list": if (inputArray.length > 1) { - System.out.println("Unknown command. Type 'help' for a list of commands."); - logger.log(Level.INFO, "Unknown command received: {0}", command); + printUnknownCommand(command); break; } logAndExecute("list", () -> commandHandler.list(records)); @@ -123,8 +121,7 @@ public static boolean handleCommand(String input, CommandHandler commandHandler, case "listAppointments": if (inputArray.length > 1) { - System.out.println("Unknown command. Type 'help' for a list of commands."); - logger.log(Level.INFO, "Unknown command received: {0}", command); + printUnknownCommand(command); break; } logAndExecute("listAppointments", () -> commandHandler.listAppointments(appointmentRecord)); @@ -154,7 +151,7 @@ public static boolean handleCommand(String input, CommandHandler commandHandler, if (inputArray.length > 1) { logAndExecute("findVisit", () -> commandHandler.findVisitByIc(inputArray[1], records)); } else { - System.out.println("Please provide NRIC for findVisit."); + System.out.println("Please provide a NRIC for findVisit."); logger.log(Level.INFO, "Missing NRIC for findVisit"); } break; @@ -163,7 +160,7 @@ public static boolean handleCommand(String input, CommandHandler commandHandler, if (inputArray.length > 1) { logAndExecute("findMedication", () -> commandHandler.findVisitByMedication(inputArray[1], records)); } else { - System.out.println("Please provide medication for findMedication."); + System.out.println("Please provide a medication for findMedication."); logger.log(Level.INFO, "Missing medication for findMedication"); } break; @@ -172,15 +169,14 @@ public static boolean handleCommand(String input, CommandHandler commandHandler, if (inputArray.length > 1) { logAndExecute("findDiagnosis", () -> commandHandler.findVisitByDiagnosis(inputArray[1], records)); } else { - System.out.println("Please provide diagnosis for findDiagnosis."); + System.out.println("Please provide a diagnosis for findDiagnosis."); logger.log(Level.INFO, "Missing diagnosis for findDiagnosis"); } break; case "exit": if (inputArray.length > 1) { - System.out.println("Unknown command. Type 'help' for a list of commands."); - logger.log(Level.INFO, "Unknown command received: {0}", command); + printUnknownCommand(command); break; } logAndExecute("exit", () -> { @@ -194,8 +190,7 @@ public static boolean handleCommand(String input, CommandHandler commandHandler, break; default: - System.out.println("Unknown command. Type 'help' for a list of commands."); - logger.log(Level.INFO, "Unknown command received: {0}", command); + printUnknownCommand(command); break; } return true; @@ -206,6 +201,11 @@ public static boolean handleCommand(String input, CommandHandler commandHandler, } } + private static void printUnknownCommand(String command) { + System.out.println("Unknown command. Type 'help' for a list of commands."); + logger.log(Level.INFO, "Unknown command received: {0}", command); + } + private static void logAndExecute(String commandName, Runnable action) { logger.log(Level.INFO, "Processing {0} command", commandName); try { From 581d2afbd3f98b2308d1b3246978e2f806ed57c3 Mon Sep 17 00:00:00 2001 From: "e0968962@u.nus.edu" Date: Mon, 11 Nov 2024 10:55:32 +0800 Subject: [PATCH 4/8] Remove log file --- logs/logs.log.lck | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 logs/logs.log.lck diff --git a/logs/logs.log.lck b/logs/logs.log.lck deleted file mode 100644 index e69de29bb2..0000000000 From 4d03580db55b72ceaf67308482028a854fef1b70 Mon Sep 17 00:00:00 2001 From: "e0968962@u.nus.edu" Date: Mon, 11 Nov 2024 13:33:57 +0800 Subject: [PATCH 5/8] Modify UG to guide users correctly --- docs/UserGuide.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index a0a91f6c38..c4db986150 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -6,12 +6,12 @@ layout: default --- ## Introduction -BookBob is a desktop application tailored for Dr Bob's private General Practitioner clinic, which operates on an -appointment basis. Patients book appointments to visit Dr Bob. BookBob helps streamline clinic management by storing -and retrieving patient information, including names, NRICs, genders, dates of birth, phone numbers, home addresses, -allergies, medical histories and detailed visit records with diagnoses and prescribed medications. BookBob also assists -Dr Bob in staying organised by tracking daily appointments and sending reminders each morning. Optimised for a Command -Line Interface (CLI), BookBob enables efficient management of patient information and appointment scheduling. +BookBob is a desktop application tailored for Dr Bob's private General Practitioner clinic. BookBob helps +streamline clinic management by storing and retrieving patient information, including names, NRICs, genders, dates of +birth, phone numbers, home addresses, allergies, medical histories and detailed visit records with diagnoses and +prescribed medications. BookBob also assists Dr Bob in staying organised by tracking daily appointments and sending +reminders each morning. Optimised for a Command Line Interface (CLI), BookBob enables efficient management of patient +information and appointment scheduling. --- ## Table of Contents @@ -49,10 +49,11 @@ The following output would be shown :`Welcome to BookBob, Dr. Bob!`
**Note:** -1. Extra Input: Additional input provided after expected inputs for commands such as `list` and `listAppointments` will be ignored. -2. Case Sensitivity for Commands : Commands are case-sensitive. Ensure correct lowercase for commands e.g. `list` instead of `LIST`, +1. Extra Input After Input: Additional input provided after expected inputs for commands such as `list`, `listAppointments`, `help` and `exit` will be treated as unknown commands. +2. Extra Spaces After Commands: Additional spaces after expected inputs for commands such as `list`, `listAppointments`, `help` and `exit` will be ignored. +2. Case Sensitivity for Commands: Commands are case-sensitive. Ensure correct lowercase for commands e.g. `list` instead of `LIST`, and mixed-case for e.g. `addVisit` instead of `addvisit` -3. Case Sensitivity for Commands Prefixes : Command Prefixes are case-sensitive. Ensure correct lowercase for commands prefixes E.g. "n/", "ic/", instead of +3. Case Sensitivity for Commands Prefixes: Command Prefixes are case-sensitive. Ensure correct lowercase for commands prefixes E.g. "n/", "ic/", instead of "N/", "IC/" ## Viewing Help @@ -413,7 +414,7 @@ No patient found with symptom: Runny Nose By Medication:
Format: findMedication medication
Note :
-• Single medicationj to be entered (case-insensitive). All corresponding patients' information and visit records will be printed to terminal, +• Single medication to be entered (case-insensitive). All corresponding patients' information and visit records will be printed to terminal, with exactly matched medication.
Example: `findMedication Panadol` From 1501689a5ccc9c04d2911ae2d61b5ced7589bfc8 Mon Sep 17 00:00:00 2001 From: "e0968962@u.nus.edu" Date: Mon, 11 Nov 2024 13:34:35 +0800 Subject: [PATCH 6/8] Add an extra space between } and catch for better readability --- src/main/java/bookbob/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/bookbob/Main.java b/src/main/java/bookbob/Main.java index 61316bfb30..dccc6d0906 100644 --- a/src/main/java/bookbob/Main.java +++ b/src/main/java/bookbob/Main.java @@ -61,7 +61,7 @@ public static void main(String[] args) throws IOException { System.out.println("Please check data file or delete it to start afresh"); System.out.println("Exiting"); System.exit(0); - }catch (Exception e) { + } catch (Exception e) { logger.log(Level.SEVERE, "Error during initialization: " + e.getMessage(), e); System.out.println("Error initializing program. Please check data files."); System.exit(0); From d40c657462c4f76cc597e18b9115f54f26bb3e68 Mon Sep 17 00:00:00 2001 From: "e0968962@u.nus.edu" Date: Mon, 11 Nov 2024 13:44:21 +0800 Subject: [PATCH 7/8] Bold add and addVisit command so that users can differentiate between the two --- docs/UserGuide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index c4db986150..cd0e9c1b89 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -173,12 +173,12 @@ and optional fields with a different order as the format above. The examples above result in successful patient record additions, which are then saved automatically.
-💡 Best Practices of using "add" command together with "addVisit" command :
-1.) When a new patient visits the clinic, we use "add" command.
+💡 Best Practices of using "add" command together with "addVisit" command :
+1.) When a new patient visits the clinic, we use "add" command.
The "add" command is primarily used for adding a patient record with the patient's basic key details information (such as Name , NRIC , Phone Number), and that Name, NRIC, Patient's First Visit Date, are Compulsory fields.
Other Optional fields includes e.g. Phone Number, Home Address, DOB, and Diagnoses and Medications from patient's first visit.

-2.) If the same patient(with same NRIC) comes back to the clinic for a new visit, we use "addVisit" command, +2.) If the same patient(with same NRIC) comes back to the clinic for a new visit, we use "addVisit" command, to key in the visit Date&Time of this new visit event(which is a compulsory field along with NRIC), AND the Diagnoses of illnesses and Medications prescribed for this new visit event (which are optional fields).

3.) We then use "list" command to see all patient information. From aa23e9faa2ad47e248e5c13a54171bf0e9738ec6 Mon Sep 17 00:00:00 2001 From: "e0968962@u.nus.edu" Date: Mon, 11 Nov 2024 13:51:11 +0800 Subject: [PATCH 8/8] Modify UG for numbering issues and minor formatting issues --- docs/UserGuide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 0a876fc39a..0ac3e36236 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -51,9 +51,9 @@ The following output would be shown :`Welcome to BookBob, Dr. Bob!` **Note:** 1. Extra Input After Commands: Additional input provided after expected inputs for commands such as `list`, `listAppointments`, `help` and `exit` will be treated as unknown commands. 2. Extra Spaces After Commands: Additional spaces after expected inputs for commands such as `list`, `listAppointments`, `help` and `exit` will be ignored. -2. Case Sensitivity for Commands: Commands are case-sensitive. Ensure correct lowercase for commands e.g. `list` instead of `LIST`, +3. Case Sensitivity for Commands: Commands are case-sensitive. Ensure correct lowercase for commands e.g. `list` instead of `LIST`, and mixed-case for e.g. `addVisit` instead of `addvisit` -3. Case Sensitivity for Commands Prefixes: Command Prefixes are case-sensitive. Ensure correct lowercase for commands prefixes E.g. "n/", "ic/", instead of +4. Case Sensitivity for Commands Prefixes: Command Prefixes are case-sensitive. Ensure correct lowercase for commands prefixes E.g. "n/", "ic/", instead of "N/", "IC/" ## Viewing Help @@ -173,7 +173,7 @@ and optional fields with a different order as the format above. The examples above result in successful patient record additions, which are then saved automatically.
-💡 Best Practices of using "add" command together with "addVisit" command :
+💡 Best Practices of using "add" command together with "addVisit" command :
1.) When a new patient visits the clinic, we use "add" command.
The "add" command is primarily used for adding a patient record with the patient's basic key details information (such as Name , NRIC , Phone Number), and that Name, NRIC, Patient's First Visit Date, are Compulsory fields.
Other Optional fields includes e.g. Phone Number, Home Address, DOB, and Diagnoses and Medications from patient's first visit.