-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDoctorPageController.java
More file actions
67 lines (56 loc) · 1.93 KB
/
DoctorPageController.java
File metadata and controls
67 lines (56 loc) · 1.93 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class DoctorPageController extends Controller {
private Doctor currentDoctor;
private Patient currentPatient;
@FXML
private Button PatientListButton, editPhysicalButton, goToPatientInfo;
@FXML
private Text selectedPatient;
@FXML
void handlePatientListButton(ActionEvent event) throws IOException {
super.goToPage("FXML/PatientList.fxml", PatientListButton);
}
@FXML
void handlePatientPhysicalButton(ActionEvent event) throws IOException {
if (currentPatient != null) {
super.goToPage("FXML/PatientPhysical.fxml", editPhysicalButton);
}
}
@FXML
void handlePatientInfoButton(ActionEvent event) throws IOException {
if (currentPatient != null) {
super.goToPage("FXML/PatientInformation.fxml", goToPatientInfo);
}
}
@Override
public void initData() {
currentDoctor = (Doctor) super.currentUser;
currentPatient = (Patient) super.selectedAccount;
// set current patients and doctors
if(super.selectedAccount!=null){
currentDoctor.setCurrentPatient(currentPatient);
currentPatient.assignDoctor(currentDoctor);
}
// update selectedPatient text
if (currentPatient != null) {
selectedPatient.setText("Selected Patient: " + currentPatient.getPatientFullName());
} else {
selectedPatient.setText("Selected Patient: NONE");
}
}
@Override
public void initialize(URL location, ResourceBundle resources) {
}
}