-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPatientPhysicalController.java
More file actions
52 lines (43 loc) · 1.56 KB
/
PatientPhysicalController.java
File metadata and controls
52 lines (43 loc) · 1.56 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
import java.io.IOException;
import java.net.URL;
import java.time.format.DateTimeFormatter;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.DatePicker;
import javafx.scene.control.TextArea;
public class PatientPhysicalController extends Controller {
@FXML
private Button backPatientPhysical, submitMedPrescription;
@FXML
private TextArea patientSummary, prescribedMedication;
@FXML
private DatePicker patiPhysicalDate;
private Doctor doctor;
private Patient patient;
private String patientSummaryString, medicationString, dateString;
public void handleBackButton(ActionEvent event) throws IOException {
super.backButton(super.prevPage, backPatientPhysical);
}
public void handleSubmitButton(ActionEvent event) throws IOException {
// grab text from textareas and date
patientSummaryString = patientSummary.getText();
medicationString = prescribedMedication.getText();
dateString = patiPhysicalDate.getValue().format(DateTimeFormatter.ofPattern("MMM d yyyy"));
// call examinePatient() to write summary and add it to the patient's patient
// history array
doctor.examinePatient(patientSummaryString, medicationString, dateString);
super.saveData();
super.backButton(prevPage, submitMedPrescription);
}
@Override
public void initData() {
doctor = (Doctor) super.currentUser;
patient = (Patient) super.selectedAccount;
doctor.setCurrentPatient(patient);
}
@Override
public void initialize(URL location, ResourceBundle resources) {
}
}