Skip to content

Commit

Permalink
Add images to UG and navigating section (#329)
Browse files Browse the repository at this point in the history
* Update glossary

* Add images to UG

* Add images

* Add date time in Singapore in UG

* Set limit to medical history and update UG and DG

* Fix checkstyle
  • Loading branch information
didymental authored Nov 8, 2021
1 parent a666f05 commit de875e9
Show file tree
Hide file tree
Showing 22 changed files with 146 additions and 26 deletions.
9 changes: 1 addition & 8 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -938,15 +938,8 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

Use case ends.

**Extensions**

* 2a. No patient has a name or medical history that matches the user's keywords.

* 2a1. `Doc'it` shows an error message.

Use case resumes at step 1.

**Use case: UC014 - Exit program**
**Use case: UC14 - Exit program**

**MSS**

Expand Down
63 changes: 55 additions & 8 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ layout: page
title: User Guide
---

![Doc'it icon](images/DocitHeader.png)

`Doc'it` provides a centralised platform for authorised staff from small family clinics to view, update, and onboard
patient records, solving the inefficient paper records and files used today. With `Doc'it`, small family clinics can
reduce man-hours in managing paper files, translating this saved time into better front-line care services.
Expand Down Expand Up @@ -58,6 +60,8 @@ reduce man-hours in managing paper files, translating this saved time into bette
* **`doc exit`** : Exits the app.

6. Refer to the **Features** section below for details of each command.
this on
7. Doc'it is built specifically for small clinic staff based in Singapore. Hence, the date and time run in Singapore time.

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

Expand Down Expand Up @@ -92,6 +96,32 @@ understanding of basic functionalities of `Doc'it`, before diving into specific
7. Managing appointment prescriptions
1. Add prescription
2. Remove prescription

##Navigating Doc'it
This section details the various components of Doc'it interface and how you could go about navigating Doc'it.

![Navigability](images/Navigability.png)

### Patient View
![Navigability](images/PatientView.png)
In this view, you can view all Patients. Each Patient has a name, phone number, address, email and a Medical History.

All patient-related commands will have change parts of the Patient View.

### Appointment View
![Navigability](images/AppointmentView.png)
In this view, you can view all Appointments. Each Appointment has the patient, date and time.

The AppointmentView comprises of two types of Appointments: Upcoming and Archive. Upcoming appointments are scheduled appointments, while Archived appointments are previous appointments that have been archived. You can switch between the two with the `apmt list` and `apmt alist` command. Alternatively, you could also click on the corresponding tab.

### Command Result Status Display
![Navigability](images/CommandResultStatusDisplay.png)
In this component, you can view the messages and feedback from Doc'it after every command.

### Command Box
![Navigability](images/CommandBox.png)
This is the component where you will input your commands. After inputting your commands, you may click the `Enter` key on your keyboard. Alternatively, you can click the `Send` button displayed here.


## Features

Expand Down Expand Up @@ -143,6 +173,8 @@ Shows the user manual for `Doc'it` explaining how to access the help page.

Format: `doc help`

![DocHelp](images/DocHelp.png)

---

### Exit the program: `doc exit`
Expand Down Expand Up @@ -177,6 +209,10 @@ New patient added:
Joshen Lim; Phone: 99988888; Email: [email protected]; Address: 123 Clementi Road SG293821
```

**GUI Display:**
![PtAdd](images/PtAdd.png)


---

### List all patients: `pt list`
Expand All @@ -185,7 +221,12 @@ Shows a list of all patients in the record system.

Format: `pt list`

GUI Display:
**Expected Outcome:**
```
Listed all patients
```

**GUI Display:**
![Patient Card](images/PatientCard.png)
---

Expand All @@ -205,6 +246,7 @@ Edits the details of a specified patient.
Edited Patient:
Joshen Tan; Phone: 12345678; Email: [email protected]; Address: 311 clementi SG540192; Medical History: Heartache, recorded 31 Oct 2021
```

---

### Delete a patient: `pt delete`
Expand All @@ -229,9 +271,9 @@ Joshen Tan; Phone: 12345678; Email: [email protected]; Address: 311 clementi SG54

---

### Add a Medical History: `pt ma`
### Add a Medical Entry: `pt ma`

Adds a medical history to the Patient Record, saving the medical history and ```today``` as the date of entry.
Adds a medical entry to the Medical History of a Patient Record, saving the medical history and ```today``` as the date of entry.

**Format:** `pt ma INDEX m/MEDICAL_HISTORY...`

Expand All @@ -247,13 +289,17 @@ pt ma 1 m/diabetes

**Expected Outcome:**
```
Updated:
Alex Yeoh; Phone: 87438807; Email: alexyeoh@example.com; Address: Blk 30 Geylang Street 29, #06-40; Medical History: diabetes, recorded 28 Oct 2021, high blood pressure, recorded 28 Oct 2021, diabetes, recorded 28 Oct 2021
Updated:
Charlotte Oliveiro; Phone: 93210283; Email: charlotte@example.com; Address: Blk 11 Ang Mo Kio Street 74, #11-04; Medical History: diabetes, recorded 8 Nov 2021
```

**GUI Display:**
![Add Medical History](images/AddMedicalHistory.png)

**Restrictions:**
- Can only add up to 8 medical entries per patient
- Each medical entry can only have up to 50 characters

---

### Delete a Medical History: `pt md`
Expand All @@ -269,11 +315,10 @@ Deletes a medical history to the Patient Record.

**Expected Outcome:**
```
Updated:
Alex Yeoh; Phone: 87438807; Email: alexyeoh@example.com; Address: Blk 30 Geylang Street 29, #06-40; Medical History: high blood pressure, recorded 28 Oct 2021, diabetes, recorded 28 Oct 2021
Updated:
Charlotte Oliveiro; Phone: 93210283; Email: charlotte@example.com; Address: Blk 11 Ang Mo Kio Street 74, #11-04
```


---

### Find a Patient with keywords: `pt find [keywords...]`
Expand Down Expand Up @@ -525,3 +570,5 @@ from John Doe's appointment.
| Patient Record | A record of a patient's name, phone number, address, email and medical history. |
| Prescription | The issued medication/treatment for a patient along with a duration and volume. |
| Expired Appointment | An appointment that is 24-hours past its scheduled time. |
| Medical History | A list of past medical conditions faced by a patient. Each medical condition is stored as a Medical Entry. |
| Medical Entry | Description of the past medical condition of a patient, with a date of record when the entry was recorded. |
Binary file added docs/images/AppointmentView.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/CommandBox.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/CommandResultStatusDisplay.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/DocHelp.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/DocitHeader.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/Navigability.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/PatientView.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/PtAdd.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/PtDelete.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/PtEdit.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/PtList.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/PtMa.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/PtMd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ public CommandResult execute(Model model) throws CommandException {
}

Patient patientToEdit = lastShownList.get(index.getZeroBased());
Patient editedPatient = patientToEdit.addMedicalHistory(this.medicalHistory);
Patient editedPatient = patientToEdit;

try {
editedPatient = patientToEdit.addMedicalHistory(this.medicalHistory);
} catch (RuntimeException e) {
throw new CommandException(e.getMessage());
}

model.setPatient(patientToEdit, editedPatient);
model.updateAppointmentBook(patientToEdit, editedPatient);
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/seedu/docit/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ public static MedicalHistory parseMedicalHistory(Collection<String> medicalEntri
toParseMh.delete(0);

for (String medicalEntry : medicalEntries) {
if (medicalEntry.length() > MedicalHistory.MAX_CHAR_LIMIT) {
throw new ParseException("Max number of characters for a medical entry is "
+ MedicalHistory.MAX_CHAR_LIMIT + "!!!");
}

MedicalHistory mh = parseMedicalEntry(medicalEntry);
if (mh.equals(MedicalHistory.EMPTY_MEDICAL_HISTORY)) {
toParseMh = MedicalHistory.EMPTY_MEDICAL_HISTORY;
Expand Down
49 changes: 47 additions & 2 deletions src/main/java/seedu/docit/model/patient/MedicalHistory.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import seedu.docit.model.Entry;
import seedu.docit.model.EntryList;
import seedu.docit.model.patient.exceptions.ExceedCharacterLimit;
import seedu.docit.model.patient.exceptions.TooManyMedicalEntriesException;

public class MedicalHistory {
public static final MedicalHistory EMPTY_MEDICAL_HISTORY = new MedicalHistory(null);
Expand All @@ -17,9 +19,13 @@ public class MedicalHistory {
+ "should not be numerical only, "
+ "and should not be blank";
public static final String VALIDATION_REGEX = "[\\p{Alnum} \\-,]*";
public static final int MAX_SIZE = 8;
public static final int MAX_CHAR_LIMIT = 50;

private EntryList<Entry<MedicalEntry>> entryList = new EntryList<>();



/**
* Constructs an {@code DateOfBirth}.
*
Expand Down Expand Up @@ -100,6 +106,14 @@ public MedicalHistory delete(int i) {
* @param date date of recording of the medical entry.
*/
public void add(String desc, String date) {
if (this.isMax()) {
throw new TooManyMedicalEntriesException();
}

if (hasExceededMaxCharLimit(desc)) {
throw new ExceedCharacterLimit();
}

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("d MMM uuuu");
LocalDate dateOfEntry = LocalDate.parse(date, formatter);
MedicalEntry entryToAdd = new MedicalEntry(desc, dateOfEntry);
Expand All @@ -110,7 +124,15 @@ public void add(String desc, String date) {
* Adds a MedicalEntry into the MedicalHistory, with the entry consisting of a description.
* @param desc description of the medical entry.
*/
public void add(String desc) {
public void add(String desc) throws TooManyMedicalEntriesException {
if (this.isMax()) {
throw new TooManyMedicalEntriesException();
}

if (hasExceededMaxCharLimit(desc)) {
throw new ExceedCharacterLimit();
}

MedicalEntry entryToAdd = new MedicalEntry(desc);
this.entryList.add(Entry.of(entryToAdd));
}
Expand All @@ -119,11 +141,17 @@ public void add(String desc) {
* Appends medical entries of another {@code MedicalHistory} object to this {@code MedicalHistory} object.
* @param mh {@code MedicalHistory} object that is to be added to
*/
public MedicalHistory append(MedicalHistory mh) {
public MedicalHistory append(MedicalHistory mh) throws TooManyMedicalEntriesException {
if (this.isEmpty()) { // if no record was stored
return mh;
}

if (mh.size() + this.size() > MAX_SIZE) {
throw new TooManyMedicalEntriesException();
}

//MedicalHistory copiedMedicalHistory = copy(this);

for (int i = 0; i < mh.size(); i++) {
this.entryList.add(mh.entryList.get(i));
}
Expand Down Expand Up @@ -289,4 +317,21 @@ public List<MedicalEntry> toList() {
return toReturn;
}

private boolean isMax() {
return this.entryList.size() == MAX_SIZE;
}

private boolean hasExceededMaxCharLimit(String s) {
return s.length() > MAX_CHAR_LIMIT;
}

private MedicalHistory copy(MedicalHistory mh) {
MedicalHistory toCopy = MedicalHistory.generate();
for (int i = 0; i < mh.entryList.size(); i++) {
toCopy.entryList.add(mh.entryList.get(i));
}

return toCopy;
}

}
11 changes: 10 additions & 1 deletion src/main/java/seedu/docit/model/patient/Patient.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,16 @@ public MedicalHistory getMedicalHistory() {
* @return patient with combined {@code MedicalHistory} object.
*/
public Patient addMedicalHistory(MedicalHistory mH) { // tell-don't-ask
return new Patient(name, phone, email, address, this.medicalHistory.append(mH));
try {
MedicalHistory copy = MedicalHistory.generate().append(this.medicalHistory);
copy.append(mH);
} catch (RuntimeException e) {
throw e;
}

MedicalHistory editedMedicalHistory = this.medicalHistory.append(mH);

return new Patient(name, phone, email, address, editedMedicalHistory);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package seedu.docit.model.patient.exceptions;

import seedu.docit.model.patient.MedicalHistory;

public class ExceedCharacterLimit extends RuntimeException {
public ExceedCharacterLimit() {
super("Max number of characters for a medical entry is " + MedicalHistory.MAX_CHAR_LIMIT + "!!!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package seedu.docit.model.patient.exceptions;

import seedu.docit.model.patient.MedicalHistory;

public class TooManyMedicalEntriesException extends RuntimeException {
public TooManyMedicalEntriesException() {
super("Max number of medical entries is " + MedicalHistory.MAX_SIZE + "!!!");
}
}
9 changes: 3 additions & 6 deletions src/main/resources/view/PatientListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@
<Label fx:id="email" styleClass="cell_small_label" text="\$email" wrapText="true" />
</children>
</VBox>
<VBox alignment="CENTER_LEFT" minHeight="105" prefWidth="90" GridPane.columnIndex="1">
<padding>
<Insets bottom="5" left="15" right="5" top="5" />
</padding>
<VBox alignment="CENTER_LEFT" minHeight="105" maxHeight="600" prefWidth="90" GridPane.columnIndex="1">
<HBox alignment="TOP_CENTER" spacing="5">
<Label styleClass="cell_small_label_bold" text="Medical History">
<minWidth>
Expand All @@ -60,9 +57,9 @@
</minWidth>
</Label>
</HBox>
<children>
<HBox alignment="CENTER" spacing="5">
<Label fx:id="medicalHistory" styleClass="cell_small_label" text="\$medicalHistory" wrapText="true" />
</children>
</HBox>
</VBox>
</items>
</SplitPane>
Expand Down

0 comments on commit de875e9

Please sign in to comment.