Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/AY2324S1-CS2103T-T09-3/tp
Browse files Browse the repository at this point in the history
…into BugFix
  • Loading branch information
cmHuang777 committed Nov 14, 2023
2 parents cc4cc6f + d12c0a3 commit 1772acb
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 73 deletions.
57 changes: 53 additions & 4 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,11 @@ The following sequence diagram shows how the add patient works:
### Delete Patient/Doctor Feature

This feature allows users to delete the desired patient or doctor based on the
nric provided.
NRIC provided.

#### Implementation

Implementation of the delete feature is similar to the original delete command, except that it is done with Ic instead
Implementation of the delete feature is similar to the original delete command, except that it is done with nric instead
of Index.

Given below is an example usage scenario and how the delete mechanism behaves at each step.
Expand All @@ -306,14 +306,16 @@ address book state.
Step 2. The user populates the AddressBook with patients and doctors using the appropriate commands, if not already
done.

Step 3. The user types `delete` as the command, with the appropriate nric of the patient/doctor to be deleted, for
Step 3. The user types `delete` as the command, with the appropriate NRIC of the patient/doctor to be deleted, for
example `delete S9567312G`.

Step 4. The `deleteCommandParser` parses the delete command and creates a `deleteCommand` with the target Ic.

Step 5. The PatientCard / DoctorCard then processes the deletion and The UI should display the updated list without the
deleted Doctor/Patient.

![DeleteSequenceDiagram](images/DeleteSequenceDiagram.png)

### Create New Appointment Feature

This feature allows users to create a new appointment between patients and doctors. The patient and doctor for whom the
Expand Down Expand Up @@ -693,6 +695,47 @@ Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unli

Use case ends.

**Use case: UC9 - Find Appointment**

**MSS**

1. User inputs a query of the Ic of the Patient/Doctor whose appointment is required.
2. Medilink Contacts lists all appointments with the involved Patient/Doctor.

Use case ends.

**Extensions**

* 2a. Appointment does not involve query Patient.

* 2a1. Medilink Contacts shows error message.

Use case ends.

* 2b. Appointment does not involve query Doctor.

* 2b1. Medilink Contacts shows error message.

Use case ends.

**Use case: UC10 - Delete Appointment**

**MSS**

1. User inputs the index of appointment to be deleted.
2. Medilink Contacts located the appointment by index.
3. Medilink Contacts deletes the appointment.

Use case ends.

**Extensions**

* 2a. Appointment index does not exist.

* 2a1. Medilink Contacts shows error message.

Use case ends.

### Non-Functional Requirements

1. Should work on any _mainstream OS_ as long as it has Java `11` or above installed.
Expand Down Expand Up @@ -748,15 +791,21 @@ MediLink Contacts adapted from the AB3 to use the Patient and Doctor classes to

Some changes were also made to such that the two classes have their own attributes on top of the original Person attributes and inherit from the common class Person. There are now 2 instead of just 1 entity that has to be handled. This translates to more Parsers, attribute classes and input validations to support these two classes.

We also decided that Patient and Doctor tags should provide meaning in the context of our app and thus, we decided to create restrictions. The biggest challenge here was the parsing of the tags as it had to be changed throughout multiple commands and in the EditCommand, the initial parsing does not check if the person is a Patient or Doctor, which meant we had to carefully check later on that valid tags were indeed edited.

Additionally, we moved away from using Index for most of our operations. Instead, we perform all operations using the NRIC. This also means more changes to the existing command such as Edit/Find/Delete commands.

### Appointment class
This is a newly created class that represents a relationship between the Doctor and Patient class. Am AppointmentTime class was also created to represent the time used in the Appointment class. One challenge that we faced was to come up with the required checks for adding new appointment. We decided to go with whether the inputted IC exist in MediLink Contacts and whether the new appointment causes a clash with the doctor and patient. However, actually implementing these checks were difficult as we had to find a way to get the same Patient and Doctor stored in the model.

Storing the appointment was a challenge too. We store each appointment in the involved doctor and patient such that we can search for their appointments more easily as well as a separate list in the model, that has all the appointments. We had to create new JsonAdaptedAppointment class for this purpose.

### UniqueObjectList class
To further enhance our application, we created an abstract UniqueObjectList class that can store any object in the required format for use in the addressbook. Using this class, we instantiated UniquePatientList, UniqueObjectList and UniqueAppointmentList. This also allows for future improvements as any new object list to be store can be simply instantiated as a child of UniqueObjectList.

### Undo and Redo
As we wanted to allow our users to revert back some mistakes, we implemented the undo and redo functions, which are fairly new compared to the existing functions that are mainly CRUD related. These changes had to be tied to each individual commands as we had to store the different states of the system before and after each operation is performed. Hence, the code changes were across many files and had to be linked well for it to work.
As we wanted to allow our users to revert back some mistakes, we implemented the undo and redo functions, which are fairly new compared to the existing functions that are mainly CRUD related. These changes had to be tied to each individual commands as we had to store the different states of the system before and after each operation is performed. Hence, the code changes were across many files and had to be linked well for it to work. Additionally, we faced a challenge coming up with the best possible implementation, as there were multiple ways for us to revert the data files. We eventually decided on
storing an ArrayList of AddressBooks and faced a challenge figuring out how to update the UI, which we eventually managed to resolve through extensive searching and fixing.

## **Appendix: Instructions for manual testing**

Expand Down
22 changes: 11 additions & 11 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title: User Guide
MediLink Contacts (MLC) is a **desktop application** for **medical administrative assistants** to manage patients and
doctors details within clinics.

Hereʼs an overview of how MediLink Contacts can help you streamline your hospital management
Hereʼs an overview of how MediLink Contacts can help you streamline your clinic management
processes:

* Store and edit information about your patients and doctors.
Expand Down Expand Up @@ -39,7 +39,7 @@ hospital management tasks done faster than current GUI apps in the industry.

4. Open a command terminal, `cd` into the folder you put the jar file in, and use the `java -jar MediLink.jar` command
to run the application.<br>
A GUI similar to the below should appear in a few seconds. Note how the app contains some sample data.<br>
A GUI similar to the one below should appear in a few seconds. Note how the app contains some sample data.<br>
![quickview](images/quickorientation.png)

5. Type the command in the command box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will
Expand All @@ -51,7 +51,7 @@ hospital management tasks done faster than current GUI apps in the industry.
* `add-doctor n/John Doe ic/S9851386G g/M p/98765432 e/johnd@example.com a/John street, block 123, #01-01` : Adds a
doctor named `John Doe` to MediLink Contacts.

* `delete S9851386G` : Deletes the person with ic S9851386G.
* `delete S9851386G` : Deletes the person with NRIC S9851386G.

* `clear` : Deletes all contacts.

Expand All @@ -64,7 +64,7 @@ hospital management tasks done faster than current GUI apps in the industry.

The list below contains the parameters that are used in various commands as well as their various constraints. Failing to input valid parameters will lead to errors when entering commands. Users should follow these constraints for all commands, unless otherwise stated.

**Note**: Certain commands may have special requirements for parameter inputs (eg. `find`) so do please follow them when necessary!
**Note**: Certain commands may have special requirements for parameter inputs (eg. `find`) so please do follow them when necessary!

| Parameter | Constraints | Valid Examples | Invalid Examples |
|:--------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------|:-----------------------------------|
Expand Down Expand Up @@ -134,9 +134,9 @@ A doctor can have any number of tags (including 0). Duplicate tags, however, are

- A doctor **MUST** have all fields non-empty except TAG.
Failure to include these details may result in an error.
- The order is not important (i.e, IC can come before NAME). What matters is that all the mandatory fields are declared,
- The order is not important (i.e, NRIC can come before NAME). What matters is that all the mandatory fields are declared,
and the format for each field is adhered to.
- A person can either be a doctor or a patient, but not both. Hence if the doctor's IC is already in the app
- A person can either be a doctor or a patient, but not both. Hence, if the doctor's NRIC is already in the app
as a patient, it may result in an error.

</div>
Expand Down Expand Up @@ -191,7 +191,7 @@ Format: `new-appt pic/NRIC dic/NRIC time/yyyy-MM-dd HH:mm`
- All fields are Required.
- NRIC for pic/ must contain the valid NRIC of a Patient in MediLink Contacts.
- NRIC for dic/ must contain the valid NRIC of a Doctor in MediLink Contacts.
- There must not be conflicting Appointments. (eg. the doctor already has an appointment with another patient at the same time) However, the duration of each appointment is flexible and up to the users. As long as appointments are not at the exact same time, users can add it in.
- There must not be conflicting Appointments (eg. the doctor already has an appointment with another patient at the same time). However, the duration of each appointment is flexible and up to the users. As long as appointments are not at the exact same time, users can add it in.

</div>

Expand Down Expand Up @@ -245,7 +245,7 @@ Format: `list`

### Editing a person : `edit`

Edits an existing person in the MediLink Contacts.
Edits an existing person in MediLink Contacts.

Format: `edit NRIC [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]…​`

Expand All @@ -259,12 +259,12 @@ Format: `edit NRIC [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]…​`
However, if it is different, there will be an error.
* Must edit appropriate fields based on whether the person is a patient or doctor (e.g. can't update condition, blood type or
emergency contact of a doctor).
* Existing values will be updated to the input values.g
* Existing values will be updated to the input values.
* When editing tags, the existing tags of the person will be removed i.e adding of tags is not cumulative.
* You can remove all the person’s tags by typing `t/` without
specifying any tags after it.
* If extraneous parameters are provided, it may lead to an error.
* Note: In our app, the Remark Section will be left blank by default. The edit Command can be used to add any miscellaneous info not captured by other fields such as possible allergies, medical history, etc.
* Note: In our app, the Remark Section will be left blank by default. The Edit Command can be used to add any miscellaneous info not captured by other fields such as possible allergies, medical history, etc.

</div>

Expand Down Expand Up @@ -487,7 +487,7 @@ the data of your previous MediLink Contacts home folder.
| **Redo** | `redo` |
| **Delete** | `delete NRIC`<br> e.g., `delete T0666485G` |
| **Edit** | `edit NRIC [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]…​`<br> e.g.,`edit S9760431H n/James Lee e/jameslee@example.com` |
| **Find** | `find KEYWORD [MORE_KEYWORDS]`<br> e.g., `find James Jake` |
| **Find** | `find KEYWORD [MORE_KEYWORDS]`<br> e.g., `find James Jake`<br> `find GENDER`<br> e.g., `find M`, `find F`<br> `find NRIC`<br> e.g., `find T0137689Y` |
| **List** | `list` |
| **Help** | `help` |
| **Exit** | `exit` |
Expand Down
8 changes: 4 additions & 4 deletions docs/team/chonguschonguschongus.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@ JavaFX.

Given below are my contributions to the project.

* **New Feature**: Enhanced the Find feature to function with NRIC, blood type, gender as well as name.
* What it does: Allows users to search for Patients/Doctors by their NRIC, blood type, gender or simply name
* **New Feature**: Enhanced the Find feature to function with NRIC, gender as well as name.
* What it does: Allows users to search for Patients/Doctors by their NRIC and gender or simply name
* Justification: Users can search by a specific attribute, increasing convenience

* **New Feature**: Added a Find Appointment function to locate a specific appointment by NRIC of people involved
* **New Feature** Added a Delete Appointment function to delete a specific appointment by index
* **New Feature** Added display of list of Appointments made in the Ui

* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2324s1.github.io/tp-dashboard/?search=&sort=groupTitle&sortWithin=title&timeframe=commit&mergegroup=&groupSelect=groupByRepos&breakdown=true&checkedFileTypes=docs~functional-code~test-code&since=2023-09-22&tabOpen=true&tabType=authorship&tabAuthor=chonguschonguschongus&tabRepo=AY2324S1-CS2103T-T09-3%2Ftp%5Bmaster%5D&authorshipIsMergeGroup=false&authorshipFileTypes=docs~functional-code~test-code&authorshipIsBinaryFileTypeChecked=false&authorshipIsIgnoredFilesChecked=false)

* **Project management**:
* Managed releases `v1.1` - `v1.4` (5 releases) on GitHub

* **Enhancements to existing features**:
* Abstracted out Person class so that Patient and Doctor can inherit from it
* Wrote an abstract UniqueObjectList that can be inherited to form UniqueLists of Patients, Doctors and Appointments
* Updated the GUI color scheme
* Wrote additional tests for existing features
Expand All @@ -38,5 +40,3 @@ Given below are my contributions to the project.

* **Community**:
* Reviewed the team's PRs

* _{you can add/remove categories in the list above}_
5 changes: 4 additions & 1 deletion docs/team/mohammed-faizzzz.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
git---
---
layout: page
title: Faiz's Project Portfolio Page
---
Expand Down Expand Up @@ -27,6 +27,9 @@ Given below are my contributions to the project.
* **Code Quality**: Removed Unnecessary Code and Classes to prevent confusion
* Removed AddCommandClass and made adjustments to code to accomodate changes

* **Testing**: Created JUnit Test Classes
* Created Testcases for Doctor and related Classes (e.g AddDoctorCommand, AddDoctorCommandParser)

* **Project management**:
* Managed milestones and issues
* Did Peer Reviews on other teammates' Pull Requests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class FindAppointmentCommand extends Command {

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds all appointments that involve the "
+ "the specified case-sensitive NRIC and displays them as a list with index numbers.\n"
+ "Parameters: KEYWORD [MORE_KEYWORDS]...\n"
+ "Parameters: INDEX ...\n"
+ "Example: " + COMMAND_WORD + " T1234567Z";

private final Predicate<Appointment> predicate;
Expand Down
50 changes: 0 additions & 50 deletions src/main/java/seedu/address/model/person/BloodTypePredicate.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"patients": [],
"doctors": [],
"appointments" : [
{
"doctorIc": "S9712346B",
"patientIc": "S8192320E",
"appointmentTime": "2022-02-14 13:30",
"status": "Scheduled"
},
{
"doctorIc": "S9712346B",
"patientIc": "S8192320E",
"appointmentTime": "2022-02-14 13:30",
"status": "Scheduled"
}]
}

Loading

0 comments on commit 1772acb

Please sign in to comment.