Skip to content

Commit

Permalink
Merge pull request #186 from Ella-e/dummy-pe-fix
Browse files Browse the repository at this point in the history
Fix documentation bugs for dummy pe
  • Loading branch information
SeaHogs authored Apr 14, 2024
2 parents ac53b31 + 85ea8ee commit cf613e0
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 59 deletions.
109 changes: 61 additions & 48 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ 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. When `Logic` is called upon to execute a command, it is passed to an `ClinicParser` 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).<br>
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.
Expand All @@ -113,15 +113,14 @@ Here are the other classes in `Logic` (omitted from the class diagram above) tha
<img src="images/ParserClasses.png" width="600"/>

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.
* When called upon to parse a user command, the `ClinicParser` 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 `ClinicParser` returns back as a `Command` object.
* 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/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/model/Model.java)

<img src="images/ModelClassDiagram.png" width="450" />


The `Model` component,

* stores the address book data i.e., all `Person` objects (which are contained in a `UniquePersonList` object).
Expand All @@ -137,8 +136,8 @@ The `Model` component,
<img src="images/StorageClassDiagram.png" width="550" />

The `Storage` component,
* can save both address book data and user preference data in JSON format, and read them back into corresponding objects.
* inherits from both `AddressBookStorage` and `UserPrefStorage`, which means it can be treated as either one (if only the functionality of only one is needed).
* can save both clinic data and user preference data in JSON format, and read them back into corresponding objects.
* inherits from both `ClinicStorage` and `UserPrefStorage`, which means it can be treated as either one (if only the functionality of only one is needed).
* depends on some classes in the `Model` component (because the `Storage` component's job is to save/retrieve objects that belong to the `Model`)

### Common classes
Expand Down Expand Up @@ -330,113 +329,128 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (good
(For all use cases below, the **System** is the `vitalconnect` and the **Actor** is the `user`, unless specified otherwise)

**Use case: UC1 - Add a patient**

**MSS**
1. User requests to add a patient by specifying the patient's name and NRIC.
2. vitalconnect adds the patient with name and NRIC.
3. vitalconnect displays the updated patient list with the new patient added.
Use case ends.
</br>Use case ends.

**Extensions**
* 1a. The NRIC already exists in the system.
* 1a1. vitalconnect displays warning message and the existing patient's information.
Use case ends.
* 1a1. vitalconnect displays warning message and the existing patient's information.
</br>Use case ends.
* 1b. The NRIC or name entered is invalid.
* 1b1. vitalconnect shows an error message.
Use case ends.
* 1b1. vitalconnect shows an error message.
</br>Use case ends.

**Use case: UC2 - Delete a patient**

**MSS**
1. User requests to delete a patient by specifying the index of the patient in the patient list.
2. vitalconnect deletes the patient from patient list.
3. vitalconnect displays the updated patient list with the patient removed.
Use case ends.
</br>Use case ends.

**Extensions**
* 1a. The patient doesn't exist in the system.
* 1a1. vitalconnect displays an error message.
Use case ends.
* 1a1. vitalconnect displays an error message.
</br>Use case ends.

**Use case: UC3 - Add an appointment**
**MSS**
1. User requests to add an appointment for a patient by providing the patient's NRIC, appointment start time, and duration.
2. vitalconnect add the appointment to the appointment list under this patient's NRIC.
3. vitalconnect displays the updated appointment list with the new appointment added.
Use case ends.
</br>Use case ends.

**Extensions**
* 1a. Critical information (start time and duration) missing or in invalid format in the add appointment command.
* 1a1. vitalconnect displays a warning message.
Use case ends.
* 1a1. vitalconnect displays a warning message.
</br>Use case ends.
* 1b. The assigned patient doesn't exist in the database.
* 1b1. vitalconnect displays a warning message.
Use case ends.
* 1b1. vitalconnect displays a warning message.
</br>Use case ends.
* 1c. The appointment time overlaps with existing appointment time.
* 1c1. vitalconnect displays a warning message and shows all the appointments with overlapping time.
Use case ends.
* 1c1. vitalconnect displays a warning message and shows all the appointments with overlapping time.
</br>Use case ends.

**Use case: UC4 - Delete an appointment**

**MSS**
1. User requests to delete an appointment for a patient by specifying the index of the appointment in the appointment list.
2. vitalconnect removes the appointment from the appointment list.
3. vitalconnect displays the updated appointment list with the appointment removed.
Use case ends.
</br>Use case ends.

**Extensions**
* 1a. The appointment doesn't exist in the database.
* 1a1. vitalconnect displays a warning message.
Use case ends.
* 1a1. vitalconnect displays a warning message.
</br>Use case ends.

**Use case: UC5 - Modify an appointment**

**MSS**
1. User requests to modify an appointment for a patient by specifying the index of the appointment in the appointment list.
2. vitalconnect saves the new appointment information.
3. vitalconnect displays the updated detail of the appointment modified.
Use case ends.
</br>Use case ends.

**Extensions**
* 1a. The appointment referred by the index doesn't exist in the database.
* 1a1. vitalconnect displays an error message.
Use case ends.
* 1a1. vitalconnect displays an error message.
</br>Use case ends.
* 1b. The id is not a valid number.
* 1b1. vitalconnect displays an error message.
Use case ends.
* 1b1. vitalconnect displays an error message.
</br>Use case ends.
* 1c. The new information is in invalid form.
* 1c1. vitalconnect displays an error message.
Use case ends.
* 1c1. vitalconnect displays an error message.
</br>Use case ends.
* 1d. The modified appointment time overlaps with existing appointment time.
* 1d1. vitalconnect displays an error message and shows all the conflicting appointments.
Use case ends.
* 1d1. vitalconnect displays an error message and shows all the conflicting appointments.
</br>Use case ends.

**Use case: UC6 - Add specific information (contact/medical information) for a patient**

**MSS**
1. User requests to add specific information for a patient by specifying the patient's NRIC and the information to be added.
2. vitalconnect save the specific information to the database.
Use case ends.
</br>Use case ends.

**Extensions**
* 1a. The patient doesn't exist in the database.
* 1a1. vitalconnect displays a warning message.
Use case ends.
* 1a1. vitalconnect displays a warning message.
</br>Use case ends.
* 1b. The information is invalid.
* 1b1. vitalconnect displays a warning message.
Use case ends.
* 1b1. vitalconnect displays a warning message.
</br>Use case ends.

**Use case: UC7 - Delete specific information (contact/medical information) for a patient**

**MSS**
1. User requests to delete specific information for a patient by specifying the patient's NRIC.
2. vitalconnect remove the specific information to the database.
Use case ends.
1. User requests to delete specific information for a patient by specifying the patient's NRIC.
2. vitalconnect remove the specific information to the database.
</br>Use case ends.

**Extensions**
* 1a. The patient or specific information doesn't exist in the database.
* 1a1. vitalconnect displays a warning message.
Use case ends.
* 1a1. vitalconnect displays a warning message.
</br>Use case ends.

**Use case: UC8 - Modify specific information**

**MSS**
1. User requests to modify specific information for a patient by specifying the patient's NRIC and new information.
2. vitalconnect displays the updated specific information of the patient.
Use case ends.
</br>Use case ends.

**Extensions**
* 1a. The patient or specific information doesn't exist in the database.
* 1a1. vitalconnect displays a warning message.
Use case ends.
* 1a1. vitalconnect displays a warning message.
</br>Use case ends.
* 1b. The specific information is invalid.
* 1b1. vitalconnect displays a warning message.
Use case ends.
* 1b1. vitalconnect displays a warning message.
</br>Use case ends.

### Non-Functional Requirements

Expand Down Expand Up @@ -472,7 +486,6 @@ Use case ends.
* **ID (Identification Number)**: A unique identifier associated with a specific appointment, used to distinguish and reference individual appointments.
* **Warning Message**: An alert displayed by the vitalconnect system to notify the user of a potential issue or discrepancy.
* **Error Message**: A notification displayed by the vitalconnect system to inform the user about a critical issue or mistake.
* **Crashing Time**: A situation where the proposed time for an appointment conflicts with an existing appointment time in the system.
* **Invalid Data Entry**: Information entered by the user that does not meet the required format or criteria.
* **Valid Data Entry**: Information entered by the user that meets the required format or criteria.
* **Tooltip**: A common graphical user interface element in which, when hovering over a screen element or component, a text box displays information about that element.
Expand Down
33 changes: 29 additions & 4 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ For first time users, you can first go through the steps listed under [Installat

5. Type `cd` followed by the location of the folder that you are putting the `vitalconnect.jar` file in. Find out more [here](https://www.wikihow.com/Change-Directories-in-Command-Prompt)

6. Type `java -jar vitalConnect.jar` and press Enter to launch java and run the application. A GUI should appear in a few seconds.
6. Type `java -jar vitalConnect.jar` and press Enter to launch java and run the application. A GUI should appear in a few seconds. The calendar view will only be shown if the right panel is large enough. You can resize the panel by dragging the divider between the two panels. More instructions can be found in the `Timetable` section. (Note that your application might contain different initial placeholder datas.)

![Launch without calendar](images/launch_1.png)
![Launch with calendar](images/launch_2.png)

7. Type any command in the command box and press Enter to execute it. e.g. typing `help` and pressing Enter will open the help window.<br>
Some example commands you can try:
Expand Down Expand Up @@ -223,7 +226,8 @@ Items in square brackets are optional.<br>

* The NRIC must be a NRIC of an already existing patient.
* At least one of the optional fields must be provided.
* Phone number should be of 3 to 15 digits long.
* If a prefix (i.e. `p/`, `e/`, `a/`) is included in the command, the value following it should not be empty. If user does not want to add a specific field, do not include its prefix in the command. Otherwise an error message will be shown as empty values for these fields are not allowed.
* Phone numbers should only contain numeric value without any other characters, and it should be 3 to 15 digits long.
* Emails should be of the format local-part@domain and adhere to the following constraints:
1. The local-part should only contain alphanumeric characters and these special characters, excluding the parentheses, (+_.-). The local-part may not start or end with any special characters, and the special characters should not be adjacent to each other.
2. This is followed by a '@' and then a domain name. The domain name is made up of domain labels separated by periods.
Expand Down Expand Up @@ -258,6 +262,15 @@ Items in square brackets are optional.<br>
* To delete an `optional field`, leave the `VALUE` part empty.
* If the `VALUE` part is not empty, the corresponding patient contact's field will either be updated or added with the new value.
* If all three fields of contact information (phone, email, and address) become empty, the contact information of the patient will be considered deleted. If one want to add a new contact information, please use `addc` command.
* Phone numbers should only contain numeric value without any other characters, and it should be 3 to 15 digits long.
* Emails should be of the format local-part@domain and adhere to the following constraints:
1. The local-part should only contain alphanumeric characters and these special characters, excluding the parentheses, (+_.-). The local-part may not start or end with any special characters, and the special characters should not be adjacent to each other.
2. This is followed by a '@' and then a domain name. The domain name is made up of domain labels separated by periods.
The domain name must:
- end with a domain label at least 2 characters long
- have each domain label start and end with alphanumeric characters
- have each domain label consist of alphanumeric characters, separated only by hyphens, if any.
* Address has a max length of 50 characters, and it should not be empty upon adding. Although in particular cases, the address can be larger than the current limit, 50 characters is able to suffice the needs in most situations. For long addresses that exceeds the 50 character limit, the compromise is to use shorforms, such as b123 instead of block 123.

Examples:
* `editc ic/S1234567D p/91234567` will result in the phone number of the patient with NRIC `S1234567D` being updated to `91234567`.
Expand Down Expand Up @@ -572,11 +585,15 @@ Incorrect or certain edits can cause the Clinic to behave in unexpected ways (e.
--------------------------------------------------------------------------------------------------------------------
## Timetable

![Timetable1](images/timetable1.png)

This feature allows the user to visualise the appointment throughout the day.

The timetable has an auto adjustment feature, if window size is larger enough(larger than 700 pixel), the timetable will show an extra calendar view with agenda on the left side of the timetable.
The right part of the timetable (marked by green box) is a visual representation of the appointment for today. Each appointment is represented by a blue box with patient's name and nric. If the box is large enough, it will also display the appointment's start time. The height of the box represents the time length of the appointment.

The three buttons on the top left of the timetable allows user to adjust which day to look at using mouse.
The left part of the timetable (marked by purple box) is a calendar view with agendas for the current day. The complete information for the apopintment can be found in the agenda view, including the patient's name, nric, and the start time and end time of the appointments.

The three buttons on the top left of the timetable (marked by yellow box) allows user to adjust which day to look at using mouse.
1. `Today` button will show the timetable of the current day.
2. `<` button will show the timetable of the previous day.
3. `>` button will show the timetable of the next day.
Expand All @@ -586,6 +603,14 @@ The timetable also support changing the view using keyboard shortcuts.
2. `Ctrl + N` will show the timetable of the next day.
3. `Ctrl + T` will show the timetable of the today.

It is worth noting that the left calendar view (marked by purple box in the above image) is only shown when the left panel size is large enough (i.e. larger than 700 pixels). If the calendar is not currently showing, users can resize the panel by dragging the divider in the middle of the application. The divider is highlighted in **green color** in the following two images below.

![Timetable without calendar](images/timetable3.png)

After dragging the divider to the left, the calendar view will be shown.

![Timetable with calendar](images/timetable2.png)

[<span style="font-size: small;">Back to table of contents</span>](#toc)

--------------------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/diagrams/ArchitectureSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ activate model MODEL_COLOR
model -[MODEL_COLOR]-> logic
deactivate model

logic -[LOGIC_COLOR]> storage : saveAddressBook(addressBook)
logic -[LOGIC_COLOR]> storage : saveClinic(clinic)
activate storage STORAGE_COLOR

storage -[STORAGE_COLOR]> storage : Save to file
Expand Down
6 changes: 0 additions & 6 deletions docs/diagrams/ModelClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ Class Allergy

Class UniqueAppointmentList
Class Appointment
Class Doctor
Class Patient
Class Time

Class I #FFFFFF
}
Expand Down Expand Up @@ -70,9 +67,6 @@ Address -[hidden]right-> Email

Clinic *--> "1" UniqueAppointmentList
UniqueAppointmentList --> "~* all" Appointment
Appointment *--> Doctor
Appointment *--> Patient
Appointment *--> Time

ModelManager --> "~* filtered" Person
ModelManager --> "~* filtered" Appointment
Expand Down
Binary file modified docs/images/ArchitectureSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/ModelClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/launch_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/launch_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/timetable1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/timetable2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/timetable3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cf613e0

Please sign in to comment.