Skip to content

Commit

Permalink
Merge pull request #377 from G13nd0n/master
Browse files Browse the repository at this point in the history
Update UG and DG based on the refinement of methods
  • Loading branch information
kaboomzxc authored Nov 11, 2024
2 parents b3ce904 + dd1a3d9 commit b1557fd
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 31 deletions.
4 changes: 2 additions & 2 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ class and records it within the `AppointmentRecord` class. The appointment recor

**Doctor enters the command:** `appointment n/Patricia Chan ic/S9870789B date/06-11-2024 time/14:30`

> The Object Diagram before the execution of appointment command:
> The Object Diagram before the execution of appointment command:\
![img.png](BeforeAppointmentOD.png)

> The Object Diagram after the execution of appointment command:
> The Object Diagram after the execution of appointment command:\
![img.png](AfterAppointmentOD.png)

> The Sequence Diagram for the execution of appointment command:
Expand Down
38 changes: 26 additions & 12 deletions docs/NewAppointment.puml
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,40 @@ Doctor -> ":Main": appointment n/Patricia Chan ic/S9870789B date/06-11-2024 time
":CommandHandler" -> ":CommandHandler" ++: extractTime(input)
":CommandHandler" --> ":CommandHandler" --: time = "14:30"

":CommandHandler" -> ":AppointmentRecord" ++: checkAvailability(date, time)
":AppointmentRecord" --> ":CommandHandler" --: nextAvailableTime

opt nextAvailableTime == "14:30"
":CommandHandler" -> ":AppointmentRecord" ++: addAppointment(appointment)
":AppointmentRecord" -> ":AppointmentRecord" ++: checkAvailability(date, time)
":AppointmentRecord" --> ":AppointmentRecord" --: nextAvailableTime
":AppointmentRecord" -> ":AppointmentRecord" ++: checkDateTime(availableDate, availableTime)
":AppointmentRecord" --> ":AppointmentRecord" --:
":AppointmentRecord" -> ":AppointmentRecord" ++: checkExistingAppintmentRecords(name, nric, searchInput)
":AppointmentRecord" --> ":AppointmentRecord" --:

opt checkDateTime(availableDate, availableTime) == false
Doctor <-- ":AppointmentRecord": There is already an appointment at the given timeslot. The next available timeslot is: 18:30
end

opt checkExistingAppintmentRecords(name, nric, searchInput) == false
Doctor <-- ":AppointmentRecord":Please check if the name is correct
Doctor <-- ":AppointmentRecord":Appointment made previously with patient NRIC, S1234567A, has the name John Doe
end

alt nextAvailableTime == "14:30"
create ":Appointment"
":CommandHandler" -> ":Appointment" **: new Appointment("Patricia Chan", "S9870789B",\n"06-11-2024", "14:30")
":AppointmentRecord" -> ":Appointment" **: new Appointment("Patricia Chan", "S9870789B",\n"06-11-2024", "14:30")
activate ":Appointment"
":Appointment" --> ":CommandHandler" --: appointment
":Appointment" --> ":AppointmentRecord" --: appointment

":CommandHandler" -> ":AppointmentRecord" ++: addAppointment(appointment)
":AppointmentRecord" -> ":AppointmentRecord": appointments.add(appointment)
":AppointmentRecord" -> ":AppointmentRecord": sort()
return
":AppointmentRecord" -> ":AppointmentRecord" ++: sort()
":AppointmentRecord" --> ":AppointmentRecord" --:

":AppointmentRecord" --> ":CommandHandler" --:

":CommandHandler" -> ":FileHandler" ++: autosave(appointmentRecord)
return

Doctor <-- ":CommandHandler": Appointment on 06-11-2024 14:30 with Patient\nPatricia Chan, S9870789B has been added.
Doctor <-- ":AppointmentRecord": Appointment on 06-11-2024 14:30 with Patient\nPatricia Chan, S9870789B has been added.
else
Doctor <-- ":CommandHandler": There is already an appointment at the given timeslot.\nThe next available timeslot is: [nextAvailableTime]
Doctor <-- ":AppointmentRecord": There is already an appointment at the given timeslot.\nThe next available timeslot is: [nextAvailableTime]
end

":CommandHandler" --> ":Parser" --
Expand Down
Binary file modified docs/NewAppointmentSD.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/NewPatientSequenceDiagram_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions docs/NewPatientSequenceDiagram_2.puml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,22 @@ activate ":Visit"
":CommandHandler" <-- ":Visit": newVisit:Visit
deactivate ":Visit"

create "newPatient:Patient"
":CommandHandler" -> "newPatient:Patient"**: new Patient(name, nric, visits)
activate "newPatient:Patient"
":CommandHandler" -> ":Records" ++: name, nric, visits, sex, dateOfBirth, phoneNumber, homeAddress, allergies, medicalHistories

"newPatient:Patient" -> "newPatient:Patient": setSex(sex)
"newPatient:Patient" -> "newPatient:Patient": setDateOfBirth(dateOfBirth)
"newPatient:Patient" -> "newPatient:Patient": setPhoneNumber(phoneNumber)
"newPatient:Patient" -> "newPatient:Patient": setHomeAddress(homeAddress)
"newPatient:Patient" -> "newPatient:Patient": setAllergies(allergies)
"newPatient:Patient" -> "newPatient:Patient": setMedicalHistories(medicalHistories)
opt nricIsPresentInExistingRecords(name, nric) == true
Doctor <-- ":Records" : Duplicate NRIC is found in the records
end

":CommandHandler" <-- "newPatient:Patient": patient created
create "newPatient:Patient"
":Records" -> "newPatient:Patient" ++: new Patient(name, nric, visits)
":Records" <-- "newPatient:Patient": patient created
deactivate "newPatient:Patient"

":CommandHandler" -> ":Records" ++: addPatient(newPatient)
":Records" -> ":Records": patients.add(newPatient)
":Records" -> "newPatient:Patient": setSex(sex)
":Records" -> "newPatient:Patient": setDateOfBirth(dateOfBirth)
":Records" -> "newPatient:Patient": setPhoneNumber(phoneNumber)
":Records" -> "newPatient:Patient": setHomeAddress(homeAddress)
":Records" -> "newPatient:Patient": setAllergies(allergies)
":Records" -> "newPatient:Patient": setMedicalHistories(medicalHistories)
return

":CommandHandler" -> ":FileHandler" ++: autosave(records)
Expand Down
9 changes: 5 additions & 4 deletions docs/team/g13nd0n.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Interface (CLI), BookBob allows for efficient management of patient information
- What it does: allow user to add appointments made with patients
- Justifications: This features improve the product by allowing user to track their time to avoid possible
overbooking of time for consultation with patients
- Highlights:
- Highlights:
- The adding of appointment will also check if the time is available based on the current list of
appointments that have already been made. Additionally, it is taken into account that the consultation duration is
30 minutes. It will suggest the next available timing, ensuring that the time and consultation duration will not
Expand All @@ -37,7 +37,8 @@ Interface (CLI), BookBob allows for efficient management of patient information
- Find appointments based on specific keywords such as date, time, name or nric
- What it does: Display all appointments based on the search keyword
- Justifications: This feature improves the product by allowing users to find the appointments for the specific
name, nric, date or time instead of listing all appointments and look for the appointments wanted
name, nric, date or time instead of listing all appointments and look for the appointments wanted. The search
feature is case-insensitive.
- Appointments Notice upon logging in to the system
- What it does: Display all the appointments for the day
- Justification: This feature improves the product by removing the need for the user to list all appointments and
Expand Down Expand Up @@ -68,8 +69,8 @@ Interface (CLI), BookBob allows for efficient management of patient information
- AppointmentRecord Class Diagram\
![AppointmentRecord.png](..%2FAppointmentRecord.png)
- Object Diagram for Appointment Feature\
![BeforeExecutionOD.png](..%2FBeforeExecutionOD.png)
![AfterExecutionOD.png](..%2FAfterExecutionOD.png)
![BeforeAppointmentOD.png](..%2FBeforeAppointmentOD.png)
![AfterAppointmentOD.png](..%2FAfterAppointmentOD.png)
- Sequence Diagram for Appointment Feature\
![NewAppointmentSD.png](..%2FNewAppointmentSD.png)

Expand Down

0 comments on commit b1557fd

Please sign in to comment.