-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSummaryController.java
More file actions
53 lines (40 loc) · 1.21 KB
/
SummaryController.java
File metadata and controls
53 lines (40 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
public class SummaryController extends Controller {
@FXML
private Button backButton;
@FXML
private TextArea summaryEntry;
private Patient patient;
private ArrayList<String> summaries;
private StringBuilder stringOfSummaries = new StringBuilder("");
@FXML
void handleBackButton(ActionEvent event) throws IOException {
super.backButton(super.prevPage, backButton);
}
@Override
public void initData() {
// initialize summaries here later
if(super.currentUser instanceof Patient){
patient = (Patient) super.currentUser;
} else {
patient = (Patient) super.selectedAccount;
}
summaries = patient.getPatientHistoryArray();
// use string builder to make a string from the array
for (int i = 0; i < summaries.size(); i++) {
stringOfSummaries.append(summaries.get(i) + "\n");
}
// update the text to show summary
summaryEntry.setText(stringOfSummaries.toString());
}
@Override
public void initialize(URL location, ResourceBundle resources) {
}
}