Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UG and DG #175

Merged
merged 2 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 38 additions & 2 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,44 @@ _{more aspects and alternatives to be added}_
Shows the medical records of a patient either through the `CLI` or the `GUI` in a Tableview.

#### Implementation
![showApptActivityDiagram](images/UML_Diagrams/ShowApptDiagram.png)

###### OVERVIEW

The **Activity Diagram** below shows an overview for users to show the Patient's appointments through
the `GUI` or `CLI`.
![showApptActivityDiagram](images/showAppt/ShowApptActivityDiagram.png)

###### Detailed Implementation

* Using the `GUI`
* **Sequence Diagram** for `GUI`\
![showApptGuiSequenceDiagram](images/showAppt/ShowApptGuiSequenceDiagram.png)
* Clicking on the Patient Card triggers the `onDoubleClick` controller which updates the
static `AppointmentWindow`.
* The controller calls `AppointmentWindow#setAppointmentWindow(patient)` to update the information of the
patient in `AppointmentWindow`.
* `AppointmentWindow` retrieves all the appointments of the patient and map the
appointment into a tableView before calling `AppointmentWindow#show()` to show the window.
* Using the `CLI`\
`ShowAppt` on the `CLI` is more complicated than using the `GUI` because we have to find the
patient and check if the NRIC entered is valid. On the `GUI`, we only have to use a controller
to check if the patient is clicked and show the `AppointmentWindow` on the click event.
* **Sequence Diagram** for `CLI`\
![showApptCliSequenceDiagram](images/showAppt/ShowApptCliSequenceDiagram.png)
**Brief Description**
1. The `MainWindow` takes in the command from the user in the `UI`.
1. `LogicManager` parses the command under `Logic`.
1. `ShowCommandparser` verifies the command is in the stipulated format.
1. `LogicManager` exceutes the command and updates the **filteredPersonList** which contains the patient found.
1. `MainWindow` in the `UI` then verifies if there is only **ONE** patient found. If not,
`MainWindow` throws an error to the User.
1. `MainWindow` updates the patient found to the `AppointmentWindow` by calling `AppointmentWindow#setAppointmentWindow(patient)`.
1. `AppointmentWindow` retrieves the appointments of the Patient and map the appointments
into a TableView.
1. Finally, `MainWindow` shows the updated `AppointmentWindow` to the User.

**:warning: Important:** AppointmentWindow is **STATIC** (i.e. only **ONE** instance of AppointmentWindow is allowed).
This design is to prevent Users from opening multiple windows of the same patient and freezing the App.

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

## **Documentation, logging, testing, configuration, dev-ops**
Expand Down
14 changes: 8 additions & 6 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ There are many versions of Java `11` listed. Select the correct version based on

1. You can now try typing your very first command in the command box and press `Enter` to execute it! Not sure what to type? Try typing **`help`** and pressing `Enter`. A help window as shown in figure 1.3 below should appear.<br>

![Help window](images/Help%20window.PNG)
![Help window](images/cleanHelpWindow.PNG)
Figure 1.3 Help window

Now, you can try out some other commands:
Expand Down Expand Up @@ -91,10 +91,12 @@ There are many versions of Java `11` listed. Select the correct version based on

### Displaying usage instructions: `help` (By Peh Jun Siang)

The `help` command shows a list of all the commands and their usages supported by **Hospify**.
The `help` command shows a list of all the commands and their usages with examples supported by **Hospify**.

Format: `help`
![tp_help_command](images/helpWindow.png)

Format: `help`

**:bulb: Tip:** You can click on the headers `COMMAND` and `USAGE` to sort the commands in a descending or ascending manner.

**:bulb: Tip:** You can copy the URL of the **Hospify User Guide** to your clipboard to view a more detailed description
Expand Down Expand Up @@ -285,9 +287,9 @@ Example: `showAppt S1234567A`
The Appointment window should pop up after successfully running the command either through the `GUI` or the `Command Line` shown below.
![Appointment Window](images/showAppt/showAppt_window.PNG)

**:bulb: Tip:** You can click on the headers to sort the appointments from earliest to latest or latest to earliest.
**:bulb: Tip:** You can **click on the headers** to sort the appointments from earliest to latest or latest to earliest.

**:information_source: Notes:** Only **ONE** appointment window is allowed to be opened at any moment.
**:warning: Important:** Only **ONE** appointment window is allowed to be opened at any moment.

**:information_source: Notes:** `showAppt` takes in only **ONE** NRIC of the patient to show.

Expand Down Expand Up @@ -433,7 +435,7 @@ _{explain the feature here}_

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

## FAQ
## FAQ (Peh Jun Siang)

**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 **Hospify** home folder.
Expand Down
68 changes: 68 additions & 0 deletions docs/diagrams/ShowApptCliSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
@startuml
!include style.puml

box UI MODEL_COLOR_T1
participant ":MainWindow" as MainWindow MODEL_COLOR
participant ":AppointmentWindow" as AppointmentWindow <<class>> MODEL_COLOR
end box

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":HospifyParser" as HospifyParser LOGIC_COLOR
participant ":ShowApptCommandParser" as ShowApptCommandParser LOGIC_COLOR
participant "o:ShowApptCommand" as ShowApptCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box


MainWindow-> LogicManager : execute("showAppt S1234567A")
activate LogicManager

LogicManager -> HospifyParser : parseCommand("showAppt S1234567A")
activate HospifyParser

create ShowApptCommandParser
HospifyParser -> ShowApptCommandParser
activate ShowApptCommandParser

ShowApptCommandParser --> HospifyParser
deactivate ShowApptCommandParser

HospifyParser -> ShowApptCommandParser : parse("S1234567A")
activate ShowApptCommandParser

create ShowApptCommand
ShowApptCommandParser -> ShowApptCommand
activate ShowApptCommand

ShowApptCommand --> ShowApptCommandParser : o
deactivate ShowApptCommand

ShowApptCommandParser --> HospifyParser : o
deactivate ShowApptCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
ShowApptCommandParser -[hidden]-> HospifyParser
destroy ShowApptCommandParser

HospifyParser --> LogicManager : o
deactivate HospifyParser

LogicManager -> ShowApptCommand : execute()
activate ShowApptCommand

create CommandResult
ShowApptCommand -> CommandResult
activate CommandResult

CommandResult --> ShowApptCommand
deactivate CommandResult

ShowApptCommand --> LogicManager : result
deactivate ShowApptCommand

MainWindow <--LogicManager : PatientFound
deactivate LogicManager

MainWindow --> AppointmentWindow : setAppointmentWindow(patientFound)
MainWindow --> AppointmentWindow : showAppointmentWindow()
@enduml
17 changes: 8 additions & 9 deletions docs/diagrams/ShowApptDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@ sprite $rake [16x16/8] {
0000000000000000
}
start
:User lists all the the patients
to checks appointments;
:User lists all the the patients;
:User selects a patient to check his appointments;
if () then ([User clicks on GUI])
: render appointments of the selected
patient in a tableview;
:Get all the appointments of
the selected Patient;
else([User uses the commandline])
:Find the patient with the NRIC;
if () then ([patient not found])
if () then ([Patient not found])
:Render error message;
stop
else([get Appointments of the patient])
: render appointments of the patient
found in a tableview;
else([Patient found])
:Get all the appointments of the
Patient;
endif
endif
:display appointment window <$rake>;
:Display appointment window <$rake>;
stop
partition "display appointment window" {
start
Expand Down
25 changes: 25 additions & 0 deletions docs/diagrams/showApptGuiSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@startuml
skinparam sequenceArrowThickness 2

actor User
participant "JohnCard:PatientCard" as A
participant ":AppointmentWindow" as B <<Class>>
participant "John:Patient" as C

User -> A: onDoubleClick()


A -> B: setAppointmentWindow(patient)
activate B

B -> C: getAppointments()
activate C
C --> B: Appointments
deactivate C

B --> User: Show()
deactivate B



@enduml
Binary file removed docs/images/UML_Diagrams/ShowApptDiagram.png
Binary file not shown.
Binary file added docs/images/cleanHelpWindow.PNG
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/showAppt/ShowApptActivityDiagram.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.