Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kohkaijie committed Nov 2, 2023
2 parents 8b0faac + 7e6ac84 commit 2fb5d81
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 105 deletions.
50 changes: 38 additions & 12 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,43 @@ Examples:

* `new-appt pic/T0123456H dic/S9851586G time/2023-10-30T13:00:00`

### Finding an Appointment : `find-appt`
### Deleting an Appointment : `delete-appt`

Deletes an existing appointment.

Format: `delete-appt INDEX`

<div markdown="block" class="alert alert-info">
**:information_source: Take Note:**<br>

- Index is according to the list view in the application.
- Use `list` command to find index of desired appointment.

</div>

Examples:

* `delete-appt 1`

### Finding a Appointment : `find-appt`

Finds all appointments that involve a specific patient/doctor.

Format: `find-appt IC`
Format: `find-appt NRIC`

<div markdown="block" class="alert alert-info">
**:information_source: Take Note:**<br>

- All fields are Required.
- IC must contain the valid IC of a Patient or Doctor in the Database.
- NRIC must contain the valid NRIC of a Patient or Doctor in the Database.
- Either Doctor NRIC or Patient NRIC can be used in the search
- It is recommended to use `list` to restore the view of all data after a `find` command.

</div>

Examples:

* `find-appt T0123456H`
* `find-appt T0001222Q`

### Listing all persons : `list`

Expand Down Expand Up @@ -207,15 +227,21 @@ Finds persons that match the query. Supports gender, NRIC and name.

Format: `find KEYWORD [MORE_KEYWORDS]`

* The search is case-insensitive. e.g `hans` will match `Hans`
* The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans`
* Only the name is searched.
* Only full words will be matched e.g. `Han` will not match `Hans`
* Persons matching at least one keyword will be returned (i.e. `OR` search).
* When searching names, the search is case-insensitive. e.g `hans` will match `Hans`
* When searching names, the order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans`
* When searching names, only full words will be matched e.g. `Han` will not match `Hans`
* When searching names, Persons matching at least one keyword will be returned (i.e. `OR` search).
e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang`
* When searching by NRIC, input the NRIC as the keyword.
* When searching by gender, input either `M` or `F` as the keyword.
* When searching by name, input the names as per above.
* Other supported attributes like NRIC, Gender and Blood Type will only handle one query `KEYWORD`, anything afterward is discarded.
* Below we have supported attributes and their example `KEYWORD`.
* It is recommended to use `list` to restore the view of all data after a `find` command

| Attribute | Example keywords |
|-----------|-----------------|
| NRIC | T1125957G |
| Gender | M |
| Blood Type | Blood Type A+ |
| Name | Travis Kelce

Examples:

Expand Down
10 changes: 7 additions & 3 deletions src/main/java/seedu/address/ui/DoctorCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ public DoctorCard(Doctor doctor, int displayedIndex) {
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
doctor.getAppointments().stream()
.sorted(Comparator.comparing(Appointment::getAppointmentTime))
.forEach(appointment -> appointments.getChildren()
.add(new Label("Appointment with Patient: " + appointment.getPatient() + " at "
+ appointment.getAppointmentTime().format(Appointment.FORMATTER))));
.forEach(appointment -> {
Label appointmentLabel = new Label("Appointment with Patient: " + appointment.getPatient() + " at "
+ appointment.getAppointmentTime().format(Appointment.FORMATTER));
appointmentLabel.setWrapText(true); // Enable text wrapping
appointmentLabel.setPrefWidth(250); // Set the maximum width for text wrapping (adjust as needed)
appointments.getChildren().add(appointmentLabel);
});
}
}
11 changes: 7 additions & 4 deletions src/main/java/seedu/address/ui/PatientCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ public PatientCard(Patient person, int displayedIndex) {
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
person.getAppointments().stream()
.sorted(Comparator.comparing(Appointment::getAppointmentTime))
.forEach(appointment -> appointments.getChildren()
.add(new Label("Appointment with Doctor: " + appointment.getDoctor() + " at "
+ appointment.getAppointmentTime().format(Appointment.FORMATTER))));

.forEach(appointment -> {
Label appointmentLabel = new Label("Appointment with Doctor: " + appointment.getDoctor() + " at "
+ appointment.getAppointmentTime().format(Appointment.FORMATTER));
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);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/view/AppointmentListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Insets top="5" right="5" bottom="5" left="15"/>
</padding>
<HBox spacing="5" alignment="CENTER_LEFT">
<Label fx:id="id" styleClass="cell_big_label">
<Label fx:id="id" styleClass="cell_big_label" style="-fx-font-weight: bold;">
<minWidth>
<!-- Ensures that the label text is never truncated -->
<Region fx:constant="USE_PREF_SIZE"/>
Expand Down
Loading

0 comments on commit 2fb5d81

Please sign in to comment.