Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/remove-prefixes' into remove-pre…
Browse files Browse the repository at this point in the history
…fixes
  • Loading branch information
DESKTOP-CP7BI1I\Eujin committed Mar 21, 2024
2 parents 06ab44a + ee2aaef commit 980860f
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 14 deletions.
70 changes: 70 additions & 0 deletions docs/diagrams/AddSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":AddCommandParser" as AddCommandParser LOGIC_COLOR
participant "a:AddCommand" as AddCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
end box
'add parameters of add command here'
[-> LogicManager : execute("add")
activate LogicManager
'add parameters of add command here'
LogicManager -> AddressBookParser : parseCommand("add ")
activate AddressBookParser

create AddCommandParser
AddressBookParser -> AddCommandParser
activate AddCommandParser

AddCommandParser --> AddressBookParser
deactivate AddCommandParser
'add parameters of add command here; replace '1''
AddressBookParser -> AddCommandParser : parse("1")
activate AddCommandParser

create AddCommand
AddCommandParser -> AddCommand
activate AddCommand

AddCommand --> AddCommandParser :
deactivate AddCommand

AddCommandParser --> AddressBookParser : a
deactivate AddCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
AddCommandParser -[hidden]-> AddressBookParser
destroy AddCommandParser

AddressBookParser --> LogicManager : a
deactivate AddressBookParser

LogicManager -> AddCommand : execute(m)
activate AddCommand
'add parameters of add command here; replace '1''
AddCommand -> Model : AddPerson(1)
activate Model

Model --> AddCommand
deactivate Model

create CommandResult
AddCommand -> CommandResult
activate CommandResult

CommandResult --> AddCommand
deactivate CommandResult

AddCommand --> LogicManager : r
deactivate AddCommand

[<--LogicManager
deactivate LogicManager
@enduml
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/logic/commands/AddCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public class AddCommand extends Command {
+ PREFIX_IC + "S0123456A "
+ PREFIX_DOB + "1/1/2000 "
+ PREFIX_ADMISSION_DATE + "15/03/2024 "
+ PREFIX_WARD + "3"
+ PREFIX_TAG + "Fall risk ";
+ PREFIX_WARD + "3 "
+ PREFIX_TAG + "FallRisk";

public static final String MESSAGE_SUCCESS = "New patient added: %1$s";
public static final String MESSAGE_DUPLICATE_PERSON = "This patient already exists in the address book";
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Dob.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Represents a patient's date of birth in the address book.
*/
public class Dob {
public static final String MESSAGE_CONSTRAINTS = "Dates of birth takes in a date"
public static final String MESSAGE_CONSTRAINTS = "Dates of birth takes in a date. "
+ "Date of birth should not be later than date of recording";
public static final String VALIDATION_REGEX = "^(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[0-2])/[0-9]{4}$";

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/seedu/address/ui/PersonCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public class PersonCard extends UiPart<Region> {
*/

public final Person person;

@FXML
private HBox cardPane;
@FXML
Expand All @@ -43,6 +42,7 @@ public class PersonCard extends UiPart<Region> {
@FXML
private FlowPane tags;


/**
* Creates a {@code PersonCode} with the given {@code Person} and index to display.
*/
Expand All @@ -51,10 +51,10 @@ public PersonCard(Person person, int displayedIndex) {
this.person = person;
id.setText(displayedIndex + ". ");
name.setText(person.getName().fullName);
dob.setText(person.getDob().value);
ic.setText(person.getIc().value);
admissionDate.setText(person.getAdmissionDate().value);
ward.setText(person.getWard().value);
dob.setText("DOB: " + person.getDob().value);
ic.setText("IC: " + person.getIc().value);
admissionDate.setText("Admission Date: " + person.getAdmissionDate().value);
ward.setText("Ward: " + person.getWard().value);
person.getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<?import javafx.scene.layout.VBox?>

<fx:root type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1"
title="Address App" minWidth="450" minHeight="600" onCloseRequest="#handleExit">
title="Nursing Address Book" minWidth="450" minHeight="600" onCloseRequest="#handleExit">
<icons>
<Image url="@/images/address_book_32.png" />
</icons>
Expand Down
7 changes: 2 additions & 5 deletions src/main/resources/view/PersonListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,10 @@
<Label fx:id="name" text="\$first" styleClass="cell_big_label" />
</HBox>
<FlowPane fx:id="tags" />
<Label fx:id="phone" styleClass="cell_small_label" text="\$phone" />
<Label fx:id="address" styleClass="cell_small_label" text="\$address" />
<Label fx:id="email" styleClass="cell_small_label" text="\$email" />
<Label fx:id="dob" styleClass="cell_small_label" text="\$dob" />
<Label fx:id="ic" styleClass="cell_small_label" text="\$ic" />
<Label fx:id="admissionDate" styleClass="cell_small_label" text="\$admissionDate" />
<Label fx:id="dob" styleClass="cell_small_label" text="\$dob" />
<Label fx:id="ward" styleClass="cell_small_label" text="\$ward" />
<Label fx:id="admissionDate" styleClass="cell_small_label" text="\$admissionDate" />
</VBox>
</GridPane>
</HBox>

0 comments on commit 980860f

Please sign in to comment.