diff --git a/docs/UserGuide.md b/docs/UserGuide.md index bf878d7d9c1..5f285caff14 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -110,7 +110,7 @@ in our current version: Examples: -* `add-doctor n/John Doe ic/S9851386G g/M p/98765432 e/johnd@example.com a/John street, block 123, #01-01 pt/T0123456H` +* `add-doctor n/John Doe ic/S9851386G g/M p/98765432 e/johnd@example.com a/John street, block 123, #01-01 t/Pediatrician` * `add-doctor n/Betsy Crowe ic/S9851586G g/F p/98765433 e/betsycrowe@example.com a/#104-C, Wakanda St 42 t/Surgeon` ### Adding a Patient: `add-patient` @@ -128,7 +128,10 @@ Format: `add-patient n/NAME ic/IC g/GENDER p/PHONE_NUMBER ec/EMERGENCY_CONTACT e - Phone Numbers and Emails have to be in a valid format. - PHONE_NUMBER must have exactly 8 digits. - EMAIL must contain email domain (eg. `@gmail.com`). -- DOCTOR must contain the valid IC of a doctor in the Database. +- TAG must indicate Priority Level of the Patient and be one of the following: + - Low + - Medium + - High - EMERGENCY_CONTACT must contain valid emergency contact number, which needs to be a valid phone number. - Blood type must be a combination of A/B/AB/O and +/-. - A patient can only have up to one tag at any time. @@ -139,8 +142,8 @@ Format: `add-patient n/NAME ic/IC g/GENDER p/PHONE_NUMBER ec/EMERGENCY_CONTACT e Examples: -* `add-patient n/John Doe ic/S9851386G g/M p/98765432 ec/90123456 e/johnd@example.com a/John street, block 123, #01-01 c/pneumothorax b/O+` -* `add-patient n/Betsy Crowe ic/S9851586G g/F p/98765433 ec/98765432 e/betsycrowe@example.com a/#104-C, Wakanda St 42 t/High Priority c/Flu b/O-` +* `add-patient n/John Doe ic/S9851386G g/M p/98765432 ec/90123456 e/johnd@example.com a/John street, block 123, #01-01 c/pneumothorax b/O+ t/Low` +* `add-patient n/Betsy Crowe ic/S9851586G g/F p/98765433 e/betsycrowe@example.com a/#104-C, Wakanda St 42 c/AIDS b/O+ t/High` ### Creating an Appointment : `new-appt` @@ -152,9 +155,10 @@ Format: `new-appt pic/IC dic/IC time/yyyy-MM-dd HH:mm` **:information_source: Take Note:**
- All fields are Required. -- TIME must follow the specified format (ie. `yyyy-MM-dd HH:mm:ss`). +- TIME must follow the specified format (ie. `yyyy-MM-dd HH:mm`), where `HH:mm` follows the 24hr format. - PATIENT must contain the valid IC of a Patient in the Database. - DOCTOR must contain the valid IC of a Doctor in the Database. +- There must not be conflicting Appointments (eg the doctor already has an appointment with another patient at the same time) @@ -220,12 +224,13 @@ Format: `edit NRIC [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]…​` * 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. +* Note: In our app, the Remark Section will be left blank by default. Edit Command can be used to add any misc info not captured by other fields such as possible allergies, medical history, etc. Examples: * `edit T0123456A p/91234567 e/johndoe@example.com g/F` Edits the phone number and email address of the 1st person to be `91234567` and `johndoe@example.com` respectively. -* `edit S9876543B pt/T0123456A n/Betsy Crower t/` Edits the name of the 2nd person to be `Betsy Crower` and clears all +* `edit S9876543B n/Betsy Crower t/` Edits the name of the 2nd person to be `Betsy Crower` and clears all existing tags. ### Locating persons by name: `find` @@ -355,18 +360,20 @@ the data of your previous MediLink Contacts home folder. ## Command summary -| Action | Format, Examples | -|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **New Doctor** | `add-doctor n/NAME ic/IC g/GENDER p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…​`
e.g., `add-doctor n/John Doe ic/S9851386G g/M p/98765432 e/johnd@example.com a/John street, block 123, #01-01 pt/T0123456H` | -| **New Patient** | `add-patient n/NAME ic/IC g/GENDER p/PHONE_NUMBER ec/EMERGENCY_CONTACT e/EMAIL a/ADDRESS [t/TAG] [d/DOCTOR] [c/CONDITION] [b/BLOODTYPE]​`
e.g., `add-patient n/John Doe ic/S9851386G g/M p/98765432 ec/90123456 e/johnd@example.com a/John street, block 123, #01-01 d/T0123456H c/pneumothorax b/O+` | -| **New Appointment** | `new-appt pic/IC dic/IC time/yyyy-MM-dd HH:mm:ss`
e.g., `new-appt pic/T0123456H dic/S9851586G time/yyyy-MM-dd 13:00:00` | -| **Clear** | `clear` | -| **Undo** | `undo` | -| **Redo** | `redo` | -| **Delete** | `delete NRIC`
e.g., `delete T0666485G` | -| **Edit** | `edit NRIC [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]…​`
e.g.,`edit S9760431H n/James Lee e/jameslee@example.com` | -| **Find** | `find KEYWORD [MORE_KEYWORDS]`
e.g., `find James Jake` | -| **List** | `list` | -| **Remark** | `remark NRIC r/REMARK`
e.g., `remark S4876031G r/Injured` | -| **Help** | `help` | +| Action | Format, Examples | +|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **New Doctor** | `add-doctor n/NAME ic/IC g/GENDER p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…​`
e.g., `add-doctor n/John Doe ic/S9851386G g/M p/98765432 e/johnd@example.com a/John street, block 123, #01-01 t/Pediatrician` | +| **New Patient** | `add-patient n/NAME ic/IC g/GENDER p/PHONE_NUMBER ec/EMERGENCY_CONTACT e/EMAIL a/ADDRESS [t/TAG] [d/DOCTOR] [c/CONDITION] [b/BLOODTYPE] …​`
e.g., `add-patient n/Betsy Crowe ic/S9851586G g/F p/98765433 e/betsycrowe@example.com a/#104-C, Wakanda St 42 c/AIDS b/O+ t/High` | +| **New Appointment** | `new-appt pic/IC dic/IC time/yyyy-MM-dd HH:mm`
e.g., `new-appt pic/T0123456H dic/S9851586G time/2023-10-30 13:00` | +| **Delete Appointment** | `delete-appt INDEX`
e.g., delete-appt 1 | +| **Find Appointment** | `find-appt NRIC`
e.g., find-appt T00012220 | +| **Clear** | `clear` | +| **Undo** | `undo` | +| **Redo** | `redo` | +| **Delete** | `delete NRIC`
e.g., `delete T0666485G` | +| **Edit** | `edit NRIC [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]…​`
e.g.,`edit S9760431H n/James Lee e/jameslee@example.com` | +| **Find** | `find KEYWORD [MORE_KEYWORDS]`
e.g., `find James Jake` | +| **List** | `list` | +| **Help** | `help` | +| **Exit** | `exit` | diff --git a/src/main/java/seedu/address/logic/Messages.java b/src/main/java/seedu/address/logic/Messages.java index 45e29a8ac0a..2a2c08675c7 100644 --- a/src/main/java/seedu/address/logic/Messages.java +++ b/src/main/java/seedu/address/logic/Messages.java @@ -64,9 +64,7 @@ public static String format(Appointment appointment) { .append("; Doctor involved: ") .append(appointment.getDoctor()) .append("; Time of appointment: ") - .append(appointment.getAppointmentTime()) - .append("; Status: ") - .append(appointment.getStatus()); + .append(appointment.getAppointmentTime()); return builder.toString(); } diff --git a/src/main/java/seedu/address/logic/commands/AddDoctorCommand.java b/src/main/java/seedu/address/logic/commands/AddDoctorCommand.java index a3b571785a7..484e755d37b 100644 --- a/src/main/java/seedu/address/logic/commands/AddDoctorCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddDoctorCommand.java @@ -40,7 +40,7 @@ public class AddDoctorCommand extends Command { + PREFIX_EMAIL + "johnd@example.com " + PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 " + PREFIX_GENDER + "M " - + PREFIX_NRIC + "S1234567Z" + + PREFIX_NRIC + "S1234567Z " + PREFIX_TAG + "SURGEON"; public static final String MESSAGE_SUCCESS = "New doctor added: %1$s"; diff --git a/src/main/java/seedu/address/model/appointment/Appointment.java b/src/main/java/seedu/address/model/appointment/Appointment.java index 667fc168887..770fc86995e 100644 --- a/src/main/java/seedu/address/model/appointment/Appointment.java +++ b/src/main/java/seedu/address/model/appointment/Appointment.java @@ -15,7 +15,6 @@ public class Appointment { private Ic doctorIc; private Ic patientIc; private AppointmentTime appointmentTime; - private String status = "Scheduled"; /** * Constructs a new appointment with the specified doctor, patient, and appointment time. @@ -49,7 +48,6 @@ public Appointment(Ic doctorIc, Ic patientIc, AppointmentTime appointmentTime, S this.doctorIc = doctorIc; this.patientIc = patientIc; this.appointmentTime = appointmentTime; - this.status = status; } public AppointmentTime getAppointmentTime() { @@ -64,12 +62,7 @@ public Ic getPatient() { return patientIc; } - public String getStatus() { - return status; - } - public void setAppointmentTime(AppointmentTime appointmentTime) { - this.appointmentTime = appointmentTime; } public void changeDoctor(Ic newDoctorIc) { @@ -80,10 +73,6 @@ public void changePatient(Ic newPatientIc) { this.patientIc = newPatientIc; } - public void changeStatus(String newStatus) { - this.status = newStatus; - } - @Override public boolean equals(Object other) { if (other == this) { @@ -98,13 +87,12 @@ public boolean equals(Object other) { Appointment otherAppointment = (Appointment) other; return this.doctorIc.equals(otherAppointment.doctorIc) && this.patientIc.equals(otherAppointment.patientIc) - && this.appointmentTime.equals(otherAppointment.appointmentTime) - && this.status.equals(otherAppointment.status); + && this.appointmentTime.equals(otherAppointment.appointmentTime); } @Override public int hashCode() { - return Objects.hash(doctorIc, patientIc, appointmentTime, status); + return Objects.hash(doctorIc, patientIc, appointmentTime); } @Override diff --git a/src/main/java/seedu/address/storage/JsonAdaptedAppointment.java b/src/main/java/seedu/address/storage/JsonAdaptedAppointment.java index 0c43f6bb8d8..816c2936201 100644 --- a/src/main/java/seedu/address/storage/JsonAdaptedAppointment.java +++ b/src/main/java/seedu/address/storage/JsonAdaptedAppointment.java @@ -19,7 +19,6 @@ class JsonAdaptedAppointment { private final String doctorIc; private final String patientIc; private final String appointmentTime; - private final String status; /** * Constructs a {@code JsonAdaptedTag} with the given {@code tagName}. @@ -27,12 +26,10 @@ class JsonAdaptedAppointment { @JsonCreator public JsonAdaptedAppointment(@JsonProperty("doctorIc") String doctorIc, @JsonProperty("patientIc") String patientIc, - @JsonProperty("appointmentTime") String appointmentTime, - @JsonProperty("status") String status) { + @JsonProperty("appointmentTime") String appointmentTime) { this.doctorIc = doctorIc; this.patientIc = patientIc; this.appointmentTime = appointmentTime; - this.status = status; } /** @@ -42,14 +39,6 @@ public JsonAdaptedAppointment(Appointment source) { doctorIc = source.getDoctor().value; patientIc = source.getPatient().value; appointmentTime = source.getAppointmentTime().toString(); - status = source.getStatus(); - } - - public String checkStatus() throws IllegalValueException { - if (status == null) { - throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, "Status")); - } - return status; } public AppointmentTime checkAppointmentTime() throws IllegalValueException { @@ -92,8 +81,7 @@ public Appointment toModelType() throws IllegalValueException { final Ic modelDoctor = checkIc(doctorIc); final Ic modelPatient = checkIc(patientIc); final AppointmentTime modelAppointmentTime = checkAppointmentTime(); - final String modelStatus = checkStatus(); - return new Appointment(modelDoctor, modelPatient, modelAppointmentTime, modelStatus); + return new Appointment(modelDoctor, modelPatient, modelAppointmentTime); } } diff --git a/src/main/java/seedu/address/ui/AppointmentCard.java b/src/main/java/seedu/address/ui/AppointmentCard.java index d67a060106d..5f2abd43400 100644 --- a/src/main/java/seedu/address/ui/AppointmentCard.java +++ b/src/main/java/seedu/address/ui/AppointmentCard.java @@ -1,5 +1,7 @@ package seedu.address.ui; +import java.time.format.DateTimeFormatter; + import javafx.fxml.FXML; import javafx.scene.control.Label; import javafx.scene.layout.HBox; @@ -12,6 +14,7 @@ public class AppointmentCard extends UiPart { private static final String FXML = "AppointmentListCard.fxml"; + private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); /** * Note: Certain keywords such as "location" and "resources" are reserved keywords in JavaFX. diff --git a/src/main/java/seedu/address/ui/DoctorCard.java b/src/main/java/seedu/address/ui/DoctorCard.java index 2d9404fed11..f876a7e479f 100644 --- a/src/main/java/seedu/address/ui/DoctorCard.java +++ b/src/main/java/seedu/address/ui/DoctorCard.java @@ -7,7 +7,6 @@ import javafx.scene.layout.FlowPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Region; -import seedu.address.model.appointment.Appointment; import seedu.address.model.person.Doctor; @@ -42,8 +41,6 @@ public class DoctorCard extends UiPart { @FXML private FlowPane tags; @FXML - private FlowPane appointments; - @FXML private Label remark; @FXML private Label gender; @@ -67,14 +64,5 @@ public DoctorCard(Doctor doctor, int displayedIndex) { doctor.getTags().stream() .sorted(Comparator.comparing(tag -> tag.tagName)) .forEach(tag -> tags.getChildren().add(new Label(tag.tagName))); - doctor.getAppointments().stream() - .sorted(Comparator.comparing(Appointment::getAppointmentTime)) - .forEach(appointment -> { - Label appointmentLabel = new Label("Appointment with Patient: " + appointment.getPatient() + " at " - + appointment.getAppointmentTime().toString()); - appointmentLabel.setWrapText(true); // Enable text wrapping - appointmentLabel.setPrefWidth(250); // Set the maximum width for text wrapping (adjust as needed) - appointments.getChildren().add(appointmentLabel); - }); } } diff --git a/src/main/java/seedu/address/ui/PatientCard.java b/src/main/java/seedu/address/ui/PatientCard.java index 07dc3910eeb..7309c387bcc 100644 --- a/src/main/java/seedu/address/ui/PatientCard.java +++ b/src/main/java/seedu/address/ui/PatientCard.java @@ -7,7 +7,6 @@ import javafx.scene.layout.FlowPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Region; -import seedu.address.model.appointment.Appointment; import seedu.address.model.person.Patient; /** @@ -42,8 +41,6 @@ public class PatientCard extends UiPart { @FXML private FlowPane tags; @FXML - private FlowPane appointments; - @FXML private Label remark; @FXML private Label gender; @@ -73,15 +70,6 @@ public PatientCard(Patient person, int displayedIndex) { person.getTags().stream() .sorted(Comparator.comparing(tag -> tag.tagName)) .forEach(tag -> tags.getChildren().add(new Label(tag.tagName))); - person.getAppointments().stream() - .sorted(Comparator.comparing(Appointment::getAppointmentTime)) - .forEach(appointment -> { - Label appointmentLabel = new Label("Appointment with Doctor: " + appointment.getDoctor() + " at " - + appointment.getAppointmentTime().toString()); - appointmentLabel.setWrapText(true); // Enable text wrapping - appointmentLabel.setPrefWidth(250); // Set the maximum width for text wrapping (adjust as needed) - appointments.getChildren().add(appointmentLabel); - }); condition.setText("Condition: " + person.getCondition().value); bloodType.setText("Blood Type: " + person.getBloodType().value); emergencyContact.setText("Emergency Contact: " + person.getEmergencyContact().value); diff --git a/src/main/resources/view/DoctorListCard.fxml b/src/main/resources/view/DoctorListCard.fxml index b83aab28c2c..8c6484818e0 100644 --- a/src/main/resources/view/DoctorListCard.fxml +++ b/src/main/resources/view/DoctorListCard.fxml @@ -33,7 +33,6 @@