Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/AY2324S2-CS2103T-T15-1/tp
Browse files Browse the repository at this point in the history
…into branch-fixUGbugs
  • Loading branch information
Alteqa committed Apr 10, 2024
2 parents 54faf9a + f32c0dc commit 7d5c7a1
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 18 deletions.
29 changes: 16 additions & 13 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ Command Constraints:
* The ordering of the fields does not influence the command.

Examples:
* `addpatient i/S1234567A n/John Doe d/2003-01-30 p/98765432`
* `addpatient n/Amy Smith i/T7654321B p/87654321 d/1980-12-05`
* `addpatient i/T0334567A n/John Doe d/2003-01-30 p/98765432`
* `addpatient n/Amy Smith i/S8054321B p/87654321 d/1980-12-05`

![add_patient_result](images/addPatient.png)

Expand All @@ -115,15 +115,15 @@ Command Constraints:
* The ordering of the fields does not influence the command.

Examples:
* `adddoctor i/S1234567A n/John Doe d/2003-01-30 p/98765432`
* `adddoctor n/Amy Smith i/T7654321B p/87654321 d/1980-12-05`
* `adddoctor i/T0334567A n/John Doe d/2003-01-30 p/98765432`
* `adddoctor n/Amy Smith i/S8054321B p/87654321 d/1980-12-05`

![add_doctor_result](images/addDoctor.png)

### Adding an appointment: `addappt`

Adds an appointment to MediCLI. Appointments are between a doctor with the specified `DOCTOR_NRIC` and a patient with the `PATIENT_NRIC` on a specific date and time.

Note that while you cannot create a new appointment with the date/time in the past, appointments that were valid when created but are now past their date will be allowed to remain in the system. This is an intended feature to allow the hospital admins to track a patient/doctors past appointments.
Format: `addappt ad/DATE dn/DOCTOR_NRIC pn/PATIENT_NRIC`

Field Constraints:
Expand All @@ -138,7 +138,7 @@ Command Constraints:

Examples:
- `addappt ad/2024-08-11 23:50 dn/S1234567A pn/S1234567B`
- `addappt ad/2025-04-09 11:10 dn/T1234567A pn/T1234567B`
- `addappt ad/2025-04-09 11:10 dn/S8054321B pn/T0334567A`

![add_appointment_result](images/addAppointment.png)

Expand All @@ -151,6 +151,7 @@ Format: `edit INDEX [i/NRIC] [n/NAME] [p/PHONE] [d/DOB]`
* Edits the patient or doctor at the specified `INDEX`. The index refers to the index number shown in the displayed person list. The index **must be a positive integer** 1, 2, 3, …​
* At least one of the optional fields must be provided.
* Existing values will be updated to the input values.
* Note that editing a patient or doctor and not changing any of the values of the parameters is allowed and is considered a valid edit by the system.

Field Constraints:
* **NRIC** : Follows the correct Singapore NRIC format. Begin with one of S, T, G, F, or M, followed by 7 numerical digits, then ended by an alphabetical letter. This field is non-case-sensitive.
Expand All @@ -163,7 +164,7 @@ Command Constraints:
* The ordering of the fields does not influence the command.

Examples:
* `edit 1 i/s1234567a n/Betsy Crower` Edits the NRIC and name of the 1st person to be `s1234567a` and `Betsy Crower` respectively.
* `edit 1 i/S1234567A n/Betsy Crower` Edits the NRIC and name of the 1st person to be `s1234567a` and `Betsy Crower` respectively.

![add_appointment_result](images/editPerson.png)

Expand Down Expand Up @@ -239,13 +240,13 @@ match appointments that involve `S1234562A` and `S1234561A`.
* Appointments with `Patient`s whose NRICs match at least one keyword will be returned (i.e. `OR` search).

Example:
* `apptforpatient s1234561a` returns all `Appointment` object(s) that `Patient` with NRIC `S1234561A` is involved in.
* `apptforpatient s0123456a` returns all `Appointment` object(s) that `Patient` with NRIC `S0123456A` is involved in.

* Initial State (All `Appointment`s listed)
![result for 'apptforpatient S1234561A'](images/findAppointmentInitialPatient.png)
![result for 'list'](images/findAppointmentInitialPatient.png)

* After Querying (Only `Appointment`s with `Patient` of NRIC `S1234561A`)
![result for 'apptforpatient S1234561A'](images/findAppointmentResultPatient.png)
* After Querying (Only `Appointment`s with `Patient` of NRIC `S0123456A`)
![result for 'apptforpatient S0123456A'](images/findAppointmentResultPatient.png)


### Querying appointments by NRIC `apptfordoctor`
Expand Down Expand Up @@ -273,7 +274,7 @@ Example:

### Deleting a doctor or patient : `delete`

Deletes the specified doctor / patient from the mediCLI system.
Deletes the specified doctor / patient from the mediCLI system. <u>**Note that all associated appointments with this doctor / patient will also be recursively deleted.**</u> Please exercise caution when using the delete command and removing a patient or a doctor from MediCLI, as this action cannot be undone.

* Deletes the doctor / patient at the specified `INDEX`.
* The index refers to the index number shown in the displayed doctor and patient list.
Expand Down Expand Up @@ -309,7 +310,9 @@ Visual Guide

### Clearing all entries : `clear`
Clears all entries from MediCLI.
Clears all entries from MediCLI.

Warning!!! This will wipe the entire data from the system upon being executed. Please be very purposeful and cautious when you use this.

Format: `clear`

Expand Down
2 changes: 1 addition & 1 deletion docs/_sass/minima/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ table {
text-align: center;
}
.site-header:before {
content: "AB-3";
content: "MediCLI";
font-size: 32px;
}
}
Expand Down
Binary file modified docs/images/Ui.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/addAppointment.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/addDoctor.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/addPatient.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/editPerson.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/findAppointmentInitialDoctor.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/findAppointmentInitialPatient.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/findAppointmentResultDoctor.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/findAppointmentResultPatient.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/helpMessage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static String getErrorMessageForDuplicatePrefixes(Prefix... duplicatePref
*/
public static String format(Person person) {
final StringBuilder builder = new StringBuilder();
builder.append("; NRIC: ")
builder.append("NRIC: ")
.append(person.getNric())
.append("; Name: ")
.append(person.getName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class DeleteCommand extends Command {

public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Deletes the person identified by the index number used in the displayed person list.\n"
+ "*Note that this also deletes all appointments associated with the person in the appointments list"
+ "*Note that this also deletes all appointments associated with the person in the appointments list.\n"
+ "Parameters: INDEX (must be a positive integer)\n"
+ "Example: " + COMMAND_WORD + " 1";

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ public static Set<Tag> parseTags(Collection<String> tags) throws ParseException
public static AppointmentDateTime parseAppointmentDateTime(String apptDateTime) throws ParseException {
requireNonNull(apptDateTime);
String trimmedDate = apptDateTime.trim();
if (trimmedDate.length() < 16) {
throw new ParseException(AppointmentDateTime.MESSAGE_CONSTRAINTS);
}
String datetime = trimmedDate.substring(0, 11) + trimmedDate.substring(11).strip();
if (!AppointmentDateTime.isValidDate(datetime)) {
throw new ParseException(AppointmentDateTime.MESSAGE_CONSTRAINTS);
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/seedu/address/logic/MessagesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MessagesTest {
@Test
public void format_validPatient_stringFormattedPerson() {
Person patient = new PatientBuilder().build();
assertEquals(Messages.format(patient), "; NRIC: "
assertEquals(Messages.format(patient), "NRIC: "
+ patient.getNric()
+ "; Name: "
+ patient.getName()
Expand All @@ -29,7 +29,7 @@ public void format_validPatient_stringFormattedPerson() {
@Test
public void format_validDoctor_stringFormattedPerson() {
Person doctor = new DoctorBuilder().build();
assertEquals(Messages.format(doctor), "; NRIC: "
assertEquals(Messages.format(doctor), "NRIC: "
+ doctor.getNric()
+ "; Name: "
+ doctor.getName()
Expand Down

0 comments on commit 7d5c7a1

Please sign in to comment.