Compare commits
No commits in common. "ff5f5bed40ee4a7f03baf2135684f4166994ad1e" and "700aba10b71c9b3bd86dbd795946081e71445f84" have entirely different histories.
ff5f5bed40
...
700aba10b7
14 changed files with 113 additions and 438 deletions
Binary file not shown.
|
@ -58,6 +58,7 @@ public class TreatmentFixture implements Fixture<Treatment> {
|
||||||
Nurse armin = nursesByName.get("Armin");
|
Nurse armin = nursesByName.get("Armin");
|
||||||
|
|
||||||
treatments.add(new Treatment(
|
treatments.add(new Treatment(
|
||||||
|
1,
|
||||||
seppl,
|
seppl,
|
||||||
ole,
|
ole,
|
||||||
convertStringToLocalDate("2023-06-03"),
|
convertStringToLocalDate("2023-06-03"),
|
||||||
|
@ -69,6 +70,7 @@ public class TreatmentFixture implements Fixture<Treatment> {
|
||||||
+ "Patient beruhigt sich erst, als alle Wertsachen im Zimmer gefunden worden sind."
|
+ "Patient beruhigt sich erst, als alle Wertsachen im Zimmer gefunden worden sind."
|
||||||
));
|
));
|
||||||
treatments.add(new Treatment(
|
treatments.add(new Treatment(
|
||||||
|
2,
|
||||||
seppl,
|
seppl,
|
||||||
armin,
|
armin,
|
||||||
convertStringToLocalDate("2023-06-05"),
|
convertStringToLocalDate("2023-06-05"),
|
||||||
|
@ -80,6 +82,7 @@ public class TreatmentFixture implements Fixture<Treatment> {
|
||||||
+ "Patient wird in seinen Raum zurückbegleitet und erhält Beruhigungsmittel."
|
+ "Patient wird in seinen Raum zurückbegleitet und erhält Beruhigungsmittel."
|
||||||
));
|
));
|
||||||
treatments.add(new Treatment(
|
treatments.add(new Treatment(
|
||||||
|
3,
|
||||||
martina,
|
martina,
|
||||||
ole,
|
ole,
|
||||||
convertStringToLocalDate("2023-06-04"),
|
convertStringToLocalDate("2023-06-04"),
|
||||||
|
@ -89,80 +92,80 @@ public class TreatmentFixture implements Fixture<Treatment> {
|
||||||
"Patient mit Waschlappen gewaschen und frisch angezogen. Patient gewendet."
|
"Patient mit Waschlappen gewaschen und frisch angezogen. Patient gewendet."
|
||||||
));
|
));
|
||||||
treatments.add(new Treatment(
|
treatments.add(new Treatment(
|
||||||
|
4,
|
||||||
seppl,
|
seppl,
|
||||||
armin,
|
armin,
|
||||||
convertStringToLocalDate("2023-06-06"),
|
convertStringToLocalDate("2023-06-06"),
|
||||||
convertStringToLocalTime("15:10"),
|
convertStringToLocalTime("15:10"),
|
||||||
convertStringToLocalTime("16:00"),
|
convertStringToLocalTime("16:00"),
|
||||||
"Spaziergang",
|
"Spaziergang",
|
||||||
"Spaziergang im Park, Patient döst im Rollstuhl ein"
|
"Spaziergang im Park, Patient döst im Rollstuhl ein")
|
||||||
|
);
|
||||||
));
|
|
||||||
treatments.add(new Treatment(
|
treatments.add(new Treatment(
|
||||||
|
8,
|
||||||
seppl,
|
seppl,
|
||||||
ole,
|
ole,
|
||||||
convertStringToLocalDate("2023-06-08"),
|
convertStringToLocalDate("2023-06-08"),
|
||||||
convertStringToLocalTime("15:00"),
|
convertStringToLocalTime("15:00"),
|
||||||
convertStringToLocalTime("16:00"),
|
convertStringToLocalTime("16:00"),
|
||||||
"Spaziergang",
|
"Spaziergang",
|
||||||
"Parkspaziergang; Patient ist heute lebhafter und hat klare Momente; erzählt von seiner Tochter"
|
"Parkspaziergang; Patient ist heute lebhafter und hat klare Momente; erzählt von seiner Tochter")
|
||||||
));
|
);
|
||||||
treatments.add(new Treatment(
|
treatments.add(new Treatment(
|
||||||
|
9,
|
||||||
martina,
|
martina,
|
||||||
armin,
|
armin,
|
||||||
convertStringToLocalDate("2023-06-07"),
|
convertStringToLocalDate("2023-06-07"),
|
||||||
convertStringToLocalTime("11:00"),
|
convertStringToLocalTime("11:00"),
|
||||||
convertStringToLocalTime("11:30"),
|
convertStringToLocalTime("11:30"),
|
||||||
"Waschen",
|
"Waschen",
|
||||||
"Waschen per Dusche auf einem Stuhl; Patientin gewendet;"
|
"Waschen per Dusche auf einem Stuhl; Patientin gewendet;")
|
||||||
));
|
);
|
||||||
treatments.add(new Treatment(
|
treatments.add(new Treatment(
|
||||||
|
12,
|
||||||
hans,
|
hans,
|
||||||
armin,
|
armin,
|
||||||
convertStringToLocalDate("2023-06-08"),
|
convertStringToLocalDate("2023-06-08"),
|
||||||
convertStringToLocalTime("15:00"),
|
convertStringToLocalTime("15:00"),
|
||||||
convertStringToLocalTime("15:30"),
|
convertStringToLocalTime("15:30"),
|
||||||
"Physiotherapie",
|
"Physiotherapie",
|
||||||
"Übungen zur Stabilisation und Mobilisierung der Rückenmuskulatur"
|
"Übungen zur Stabilisation und Mobilisierung der Rückenmuskulatur")
|
||||||
));
|
);
|
||||||
treatments.add(new Treatment(
|
treatments.add(new Treatment(
|
||||||
|
14,
|
||||||
ahmet,
|
ahmet,
|
||||||
ole,
|
ole,
|
||||||
convertStringToLocalDate("2023-08-24"),
|
convertStringToLocalDate("2023-08-24"),
|
||||||
convertStringToLocalTime("09:30"),
|
convertStringToLocalTime("09:30"),
|
||||||
convertStringToLocalTime("10:15"),
|
convertStringToLocalTime("10:15"),
|
||||||
"KG",
|
"KG",
|
||||||
"Lympfdrainage"
|
"Lympfdrainage"));
|
||||||
));
|
|
||||||
treatments.add(new Treatment(
|
treatments.add(new Treatment(
|
||||||
|
16,
|
||||||
elisabeth,
|
elisabeth,
|
||||||
armin,
|
armin,
|
||||||
convertStringToLocalDate("2023-08-31"),
|
convertStringToLocalDate("2023-08-31"),
|
||||||
convertStringToLocalTime("13:30"),
|
convertStringToLocalTime("13:30"),
|
||||||
convertStringToLocalTime("13:45"),
|
convertStringToLocalTime("13:45"),
|
||||||
"Toilettengang",
|
"Toilettengang",
|
||||||
"Hilfe beim Toilettengang; Patientin klagt über Schmerzen beim Stuhlgang. Gabe von Iberogast"
|
"Hilfe beim Toilettengang; Patientin klagt über Schmerzen beim Stuhlgang. Gabe von Iberogast")
|
||||||
));
|
);
|
||||||
Treatment lockedTreatment = new Treatment(
|
treatments.add(new Treatment(
|
||||||
|
17,
|
||||||
elisabeth,
|
elisabeth,
|
||||||
ole,
|
ole,
|
||||||
convertStringToLocalDate("2023-09-01"),
|
convertStringToLocalDate("2023-09-01"),
|
||||||
convertStringToLocalTime("16:00"),
|
convertStringToLocalTime("16:00"),
|
||||||
convertStringToLocalTime("17:00"),
|
convertStringToLocalTime("17:00"),
|
||||||
"KG",
|
"KG",
|
||||||
"Massage der Extremitäten zur Verbesserung der Durchblutung"
|
"Massage der Extremitäten zur Verbesserung der Durchblutung")
|
||||||
);
|
);
|
||||||
lockedTreatment.setLocked(true);
|
|
||||||
treatments.add(lockedTreatment);
|
|
||||||
|
|
||||||
TreatmentDao dao = DaoFactory.getInstance().createTreatmentDao();
|
TreatmentDao dao = DaoFactory.getInstance().createTreatmentDao();
|
||||||
Map<String, Treatment> treatmentsById = new HashMap<>();
|
Map<String, Treatment> treatmentsById = new HashMap<>();
|
||||||
for (Treatment treatment : treatments) {
|
for (Treatment treatment : treatments) {
|
||||||
dao.create(treatment);
|
dao.create(treatment);
|
||||||
}
|
|
||||||
for (Treatment treatment : dao.readAll()) {
|
|
||||||
treatmentsById.put(String.valueOf(treatment.getId()), treatment);
|
treatmentsById.put(String.valueOf(treatment.getId()), treatment);
|
||||||
|
|
||||||
}
|
}
|
||||||
return treatmentsById;
|
return treatmentsById;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,9 +9,6 @@ import javafx.scene.control.Tab;
|
||||||
import javafx.scene.control.TabPane;
|
import javafx.scene.control.TabPane;
|
||||||
import javafx.scene.layout.AnchorPane;
|
import javafx.scene.layout.AnchorPane;
|
||||||
import javafx.scene.layout.BorderPane;
|
import javafx.scene.layout.BorderPane;
|
||||||
import de.hitec.nhplus.treatment.Treatment;
|
|
||||||
import de.hitec.nhplus.medication.Medication;
|
|
||||||
import de.hitec.nhplus.patient.Patient;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
@ -32,18 +29,10 @@ public class MainWindowController {
|
||||||
@FXML
|
@FXML
|
||||||
private Tab patientTab;
|
private Tab patientTab;
|
||||||
@FXML
|
@FXML
|
||||||
private AnchorPane activeTreatmentPage;
|
private AnchorPane treatmentPage;
|
||||||
@FXML
|
@FXML
|
||||||
private Tab treatmentTab;
|
private Tab treatmentTab;
|
||||||
@FXML
|
@FXML
|
||||||
private TabPane treatmentTabPane;
|
|
||||||
@FXML
|
|
||||||
private Tab activeTreatmentTab;
|
|
||||||
@FXML
|
|
||||||
private AnchorPane lockedTreatmentPage;
|
|
||||||
@FXML
|
|
||||||
private Tab lockedTreatmentTab;
|
|
||||||
@FXML
|
|
||||||
private Tab nurseTab;
|
private Tab nurseTab;
|
||||||
@FXML
|
@FXML
|
||||||
private TabPane nurseTabPane;
|
private TabPane nurseTabPane;
|
||||||
|
@ -69,25 +58,19 @@ public class MainWindowController {
|
||||||
mainTabPane.getSelectionModel().select(patientTab);
|
mainTabPane.getSelectionModel().select(patientTab);
|
||||||
|
|
||||||
patientTab.setOnSelectionChanged(event -> loadPatientPage());
|
patientTab.setOnSelectionChanged(event -> loadPatientPage());
|
||||||
|
treatmentTab.setOnSelectionChanged(event -> loadTreatmentsPage());
|
||||||
|
nurseTab.setOnSelectionChanged(event -> loadNursePage());
|
||||||
medicationTab.setOnSelectionChanged(event -> loadMedicationPage());
|
medicationTab.setOnSelectionChanged(event -> loadMedicationPage());
|
||||||
|
|
||||||
|
|
||||||
nurseTab.setOnSelectionChanged(event -> loadNursePage());
|
|
||||||
nurseTabPane.getSelectionModel().select(activeNurseTab);
|
nurseTabPane.getSelectionModel().select(activeNurseTab);
|
||||||
|
|
||||||
activeNurseTab.setOnSelectionChanged(event -> loadActiveNursePage());
|
activeNurseTab.setOnSelectionChanged(event -> loadActiveNursePage());
|
||||||
lockedNurseTab.setOnSelectionChanged(event -> loadLockedNursePage());
|
lockedNurseTab.setOnSelectionChanged(event -> loadLockedNursePage());
|
||||||
|
|
||||||
treatmentTab.setOnSelectionChanged(event -> loadTreatmentPage());
|
|
||||||
treatmentTabPane.getSelectionModel().select(activeTreatmentTab);
|
|
||||||
|
|
||||||
activeTreatmentTab.setOnSelectionChanged(event -> loadActiveTreatmentPage());
|
|
||||||
lockedTreatmentTab.setOnSelectionChanged(event -> loadLockedTreatmentPage());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the {@link Patient} page into its tab.
|
* Loads the patient page into its tab.
|
||||||
*/
|
*/
|
||||||
private void loadPatientPage() {
|
private void loadPatientPage() {
|
||||||
try {
|
try {
|
||||||
|
@ -105,46 +88,14 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the {@link Treatment } tab.
|
* Loads the {@link } page into its tab.
|
||||||
*/
|
*/
|
||||||
private void loadTreatmentPage() {
|
private void loadTreatmentsPage() {
|
||||||
SelectionModel<Tab> selectionModel = treatmentTabPane.getSelectionModel();
|
|
||||||
Tab selectedTab = selectionModel.getSelectedItem();
|
|
||||||
if (selectedTab == activeTreatmentTab) {
|
|
||||||
loadActiveTreatmentPage();
|
|
||||||
}
|
|
||||||
if (selectedTab == lockedTreatmentTab) {
|
|
||||||
loadLockedTreatmentPage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Loads the active {@link Treatment} page into its tab.
|
|
||||||
*/
|
|
||||||
private void loadActiveTreatmentPage() {
|
|
||||||
try {
|
|
||||||
BorderPane activeTreatmentPane = FXMLLoader.load(
|
|
||||||
Objects.requireNonNull(Main.class.getResource("/de/hitec/nhplus/treatment/AllTreatmentView.fxml"))
|
|
||||||
);
|
|
||||||
activeTreatmentPage.getChildren().setAll(activeTreatmentPane);
|
|
||||||
AnchorPane.setTopAnchor(activeTreatmentPane, 0d);
|
|
||||||
AnchorPane.setBottomAnchor(activeTreatmentPane, 0d);
|
|
||||||
AnchorPane.setLeftAnchor(activeTreatmentPane, 0d);
|
|
||||||
AnchorPane.setRightAnchor(activeTreatmentPane, 0d);
|
|
||||||
} catch (IOException exception) {
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Loads the locked {@link Treatment} page into its tab.
|
|
||||||
*/
|
|
||||||
private void loadLockedTreatmentPage() {
|
|
||||||
try {
|
try {
|
||||||
BorderPane treatmentsPane = FXMLLoader.load(
|
BorderPane treatmentsPane = FXMLLoader.load(
|
||||||
Objects.requireNonNull(Main.class.getResource("/de/hitec/nhplus/treatment/LockedTreatmentView.fxml"))
|
Objects.requireNonNull(Main.class.getResource("/de/hitec/nhplus/treatment/AllTreatmentView.fxml"))
|
||||||
);
|
);
|
||||||
lockedTreatmentPage.getChildren().setAll(treatmentsPane);
|
treatmentPage.getChildren().setAll(treatmentsPane);
|
||||||
AnchorPane.setTopAnchor(treatmentsPane, 0d);
|
AnchorPane.setTopAnchor(treatmentsPane, 0d);
|
||||||
AnchorPane.setBottomAnchor(treatmentsPane, 0d);
|
AnchorPane.setBottomAnchor(treatmentsPane, 0d);
|
||||||
AnchorPane.setLeftAnchor(treatmentsPane, 0d);
|
AnchorPane.setLeftAnchor(treatmentsPane, 0d);
|
||||||
|
@ -155,15 +106,15 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the {@link Nurse} page into its tab.
|
* Loads the nurse page into its tab.
|
||||||
*/
|
*/
|
||||||
private void loadNursePage() {
|
private void loadNursePage() {
|
||||||
SelectionModel<Tab> selectionModel = nurseTabPane.getSelectionModel();
|
SelectionModel<Tab> selectionModel = nurseTabPane.getSelectionModel();
|
||||||
Tab selectedTab = selectionModel.getSelectedItem();
|
Tab selectedTab = selectionModel.getSelectedItem();
|
||||||
if (selectedTab == activeNurseTab) {
|
if(selectedTab == activeNurseTab){
|
||||||
loadActiveNursePage();
|
loadActiveNursePage();
|
||||||
}
|
}
|
||||||
if (selectedTab == lockedNurseTab) {
|
if(selectedTab == lockedNurseTab){
|
||||||
loadLockedNursePage();
|
loadLockedNursePage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -205,7 +156,7 @@ public class MainWindowController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the {@link Medication} page into its tab.
|
* Loads the medication page into its tab.
|
||||||
*/
|
*/
|
||||||
private void loadMedicationPage() {
|
private void loadMedicationPage() {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -22,8 +22,6 @@ import java.sql.SQLException;
|
||||||
*
|
*
|
||||||
* @author Dominik Säume
|
* @author Dominik Säume
|
||||||
* @author Ole Kück
|
* @author Ole Kück
|
||||||
* @author Armin Ribic
|
|
||||||
* @author Dorian Nemec
|
|
||||||
*/
|
*/
|
||||||
public class AllNurseController {
|
public class AllNurseController {
|
||||||
@FXML
|
@FXML
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class NurseDao extends DaoImp<Nurse> {
|
||||||
* Read all database entries of active {@link Nurse}s into a {@link List} of model instances.
|
* Read all database entries of active {@link Nurse}s into a {@link List} of model instances.
|
||||||
*/
|
*/
|
||||||
public List<Nurse> readAllActive() throws SQLException {
|
public List<Nurse> readAllActive() throws SQLException {
|
||||||
final String SQL = "SELECT * FROM nurse WHERE isLocked = false";
|
final String SQL = "SELECT * FROM nurse WHERE isLocked=false";
|
||||||
return getListFromResultSet(this.connection.prepareStatement(SQL).executeQuery());
|
return getListFromResultSet(this.connection.prepareStatement(SQL).executeQuery());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ public class NurseDao extends DaoImp<Nurse> {
|
||||||
* Read all database entries of locked {@link Nurse}s into a {@link List} of model instances.
|
* Read all database entries of locked {@link Nurse}s into a {@link List} of model instances.
|
||||||
*/
|
*/
|
||||||
public List<Nurse> readAllLocked() throws SQLException {
|
public List<Nurse> readAllLocked() throws SQLException {
|
||||||
final String SQL = "SELECT * FROM nurse WHERE isLocked = true";
|
final String SQL = "SELECT * FROM nurse WHERE isLocked=true";
|
||||||
return getListFromResultSet(this.connection.prepareStatement(SQL).executeQuery());
|
return getListFromResultSet(this.connection.prepareStatement(SQL).executeQuery());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ import javafx.stage.Stage;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,8 +27,6 @@ import java.util.ArrayList;
|
||||||
*
|
*
|
||||||
* @author Bernd Heidemann
|
* @author Bernd Heidemann
|
||||||
* @author Dominik Säume
|
* @author Dominik Säume
|
||||||
* @author Armin Ribic
|
|
||||||
* @author Dorian Nemec
|
|
||||||
*/
|
*/
|
||||||
public class AllTreatmentController {
|
public class AllTreatmentController {
|
||||||
|
|
||||||
|
@ -64,7 +61,7 @@ public class AllTreatmentController {
|
||||||
public ComboBox<String> comboBoxNurseSelection;
|
public ComboBox<String> comboBoxNurseSelection;
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private Button buttonLock;
|
private Button buttonDelete;
|
||||||
|
|
||||||
private final ObservableList<Treatment> treatments = FXCollections.observableArrayList();
|
private final ObservableList<Treatment> treatments = FXCollections.observableArrayList();
|
||||||
private TreatmentDao dao;
|
private TreatmentDao dao;
|
||||||
|
@ -103,16 +100,15 @@ public class AllTreatmentController {
|
||||||
this.columnDescription.setCellValueFactory(new PropertyValueFactory<>("description"));
|
this.columnDescription.setCellValueFactory(new PropertyValueFactory<>("description"));
|
||||||
this.tableView.setItems(this.treatments);
|
this.tableView.setItems(this.treatments);
|
||||||
|
|
||||||
this.buttonLock.setDisable(true);
|
this.buttonDelete.setDisable(true);
|
||||||
this.tableView
|
this.tableView
|
||||||
.getSelectionModel()
|
.getSelectionModel()
|
||||||
.selectedItemProperty()
|
.selectedItemProperty()
|
||||||
.addListener((observableValue, oldTreatment, newTreatment) ->
|
.addListener((observableValue, oldTreatment, newTreatment) ->
|
||||||
AllTreatmentController.this.buttonLock.setDisable(newTreatment == null)
|
AllTreatmentController.this.buttonDelete.setDisable(newTreatment == null)
|
||||||
);
|
);
|
||||||
|
|
||||||
this.createComboBoxData();
|
this.createComboBoxData();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -121,7 +117,7 @@ public class AllTreatmentController {
|
||||||
public void readAllAndShowInTableView() {
|
public void readAllAndShowInTableView() {
|
||||||
this.dao = DaoFactory.getInstance().createTreatmentDao();
|
this.dao = DaoFactory.getInstance().createTreatmentDao();
|
||||||
try {
|
try {
|
||||||
this.treatments.setAll(dao.readAllActive());
|
this.treatments.setAll(dao.readAll());
|
||||||
} catch (SQLException exception) {
|
} catch (SQLException exception) {
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -140,7 +136,7 @@ public class AllTreatmentController {
|
||||||
this.patientSelection.add(patient.getSurName());
|
this.patientSelection.add(patient.getSurName());
|
||||||
}
|
}
|
||||||
|
|
||||||
nurseList = (ArrayList<Nurse>) nurseDao.readAllActive();
|
nurseList = (ArrayList<Nurse>) nurseDao.readAll();
|
||||||
for (Nurse nurse : nurseList) {
|
for (Nurse nurse : nurseList) {
|
||||||
this.nurseSelection.add(nurse.getSurName());
|
this.nurseSelection.add(nurse.getSurName());
|
||||||
}
|
}
|
||||||
|
@ -262,6 +258,18 @@ public class AllTreatmentController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public void handleDelete() {
|
||||||
|
int index = this.tableView.getSelectionModel().getSelectedIndex();
|
||||||
|
Treatment t = this.treatments.remove(index);
|
||||||
|
TreatmentDao dao = DaoFactory.getInstance().createTreatmentDao();
|
||||||
|
try {
|
||||||
|
dao.delete(t.getId());
|
||||||
|
} catch (SQLException exception) {
|
||||||
|
exception.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void handleNewTreatment() {
|
public void handleNewTreatment() {
|
||||||
String selectedPatient = this.comboBoxPatientSelection.getSelectionModel().getSelectedItem();
|
String selectedPatient = this.comboBoxPatientSelection.getSelectionModel().getSelectedItem();
|
||||||
|
@ -308,22 +316,4 @@ public class AllTreatmentController {
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
|
||||||
public void handleLock(){
|
|
||||||
Treatment selectedItem = this.tableView.getSelectionModel().getSelectedItem();
|
|
||||||
if (selectedItem == null){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
selectedItem.setLocked(true);
|
|
||||||
this.dao.update(selectedItem);
|
|
||||||
}catch (SQLException exception){
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
readAllAndShowInTableView();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,124 +0,0 @@
|
||||||
package de.hitec.nhplus.treatment;
|
|
||||||
|
|
||||||
import de.hitec.nhplus.datastorage.DaoFactory;
|
|
||||||
import de.hitec.nhplus.nurse.Nurse;
|
|
||||||
import de.hitec.nhplus.patient.Patient;
|
|
||||||
import de.hitec.nhplus.treatment.database.TreatmentDao;
|
|
||||||
import de.hitec.nhplus.utils.DateConverter;
|
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
|
||||||
import javafx.collections.FXCollections;
|
|
||||||
import javafx.collections.ObservableList;
|
|
||||||
import javafx.fxml.FXML;
|
|
||||||
import javafx.scene.control.Button;
|
|
||||||
import javafx.scene.control.TableColumn;
|
|
||||||
import javafx.scene.control.TableView;
|
|
||||||
import javafx.scene.control.cell.PropertyValueFactory;
|
|
||||||
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Controller for all locked treatments.
|
|
||||||
*
|
|
||||||
* @author Armin Ribic
|
|
||||||
* @author Dorian Nemec
|
|
||||||
*/
|
|
||||||
public class LockedTreatmentController {
|
|
||||||
|
|
||||||
@FXML
|
|
||||||
public Button buttonUnlock;
|
|
||||||
@FXML
|
|
||||||
public TableView<Treatment> tableView;
|
|
||||||
@FXML
|
|
||||||
public TableColumn<Treatment, Long> columnId;
|
|
||||||
@FXML
|
|
||||||
private TableColumn<Treatment, String> columnPatient;
|
|
||||||
@FXML
|
|
||||||
private TableColumn<Treatment, String> columnNurse;
|
|
||||||
@FXML
|
|
||||||
private TableColumn<Treatment, String> columnDeleteDate;
|
|
||||||
|
|
||||||
private final ObservableList<Treatment> treatments = FXCollections.observableArrayList();
|
|
||||||
private TreatmentDao treatmentDao;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method allows initializing a {@link LockedTreatmentController} object
|
|
||||||
* that is called after the binding of all the fields.
|
|
||||||
*/
|
|
||||||
public void initialize() {
|
|
||||||
this.readAllAndShowInTableView();
|
|
||||||
|
|
||||||
this.columnId.setCellValueFactory(new PropertyValueFactory<>("id"));
|
|
||||||
|
|
||||||
this.columnPatient.setCellValueFactory(
|
|
||||||
cellData -> {
|
|
||||||
Patient patient = cellData.getValue().getPatient();
|
|
||||||
return new SimpleStringProperty(patient.getSurName() + ", " + patient.getFirstName());
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
this.columnNurse.setCellValueFactory(
|
|
||||||
cellData -> {
|
|
||||||
Nurse nurse = cellData.getValue().getNurse();
|
|
||||||
return new SimpleStringProperty(nurse.getSurName() + ", " + nurse.getFirstName());
|
|
||||||
}
|
|
||||||
);
|
|
||||||
this.columnDeleteDate.setCellValueFactory(cellData -> new SimpleStringProperty(
|
|
||||||
DateConverter.convertLocalDateToString(cellData.getValue().calculateDeleteDate())));
|
|
||||||
|
|
||||||
|
|
||||||
this.tableView.setItems(this.treatments);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reads all locked {@link Treatment} data and shows it in the table.
|
|
||||||
*/
|
|
||||||
private void readAllAndShowInTableView() {
|
|
||||||
this.treatments.clear();
|
|
||||||
|
|
||||||
this.treatmentDao = DaoFactory.getInstance().createTreatmentDao();
|
|
||||||
try {
|
|
||||||
this.treatments.addAll(this.treatmentDao.readAllLocked());
|
|
||||||
deleteOldTreatments();
|
|
||||||
} catch (SQLException exception) {
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Deletes all {@link Treatment}s which are older than allowed.
|
|
||||||
*/
|
|
||||||
private void deleteOldTreatments() {
|
|
||||||
LocalDate today = LocalDate.now();
|
|
||||||
|
|
||||||
for (Treatment treatment : treatments) {
|
|
||||||
LocalDate deleteDate = treatment.calculateDeleteDate();
|
|
||||||
if (today.isEqual(deleteDate) || today.isAfter(deleteDate)) {
|
|
||||||
try {
|
|
||||||
treatmentDao.delete(treatment.getId());
|
|
||||||
} catch (SQLException exception) {
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@FXML
|
|
||||||
private void unlockTreatment() {
|
|
||||||
Treatment selectedItem = this.tableView.getSelectionModel().getSelectedItem();
|
|
||||||
if (selectedItem == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
selectedItem.setLocked(false);
|
|
||||||
this.treatmentDao.update(selectedItem);
|
|
||||||
} catch (SQLException exception) {
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
readAllAndShowInTableView();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -3,7 +3,6 @@ package de.hitec.nhplus.treatment;
|
||||||
import de.hitec.nhplus.nurse.Nurse;
|
import de.hitec.nhplus.nurse.Nurse;
|
||||||
import de.hitec.nhplus.patient.Patient;
|
import de.hitec.nhplus.patient.Patient;
|
||||||
import de.hitec.nhplus.utils.DateConverter;
|
import de.hitec.nhplus.utils.DateConverter;
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
|
@ -17,8 +16,6 @@ import java.util.StringJoiner;
|
||||||
*
|
*
|
||||||
* @author Bernd Heidemann
|
* @author Bernd Heidemann
|
||||||
* @author Dominik Säume
|
* @author Dominik Säume
|
||||||
* @author Armin Ribic
|
|
||||||
* @author Dorian Nemec
|
|
||||||
*/
|
*/
|
||||||
public class Treatment {
|
public class Treatment {
|
||||||
private SimpleIntegerProperty id;
|
private SimpleIntegerProperty id;
|
||||||
|
@ -29,8 +26,6 @@ public class Treatment {
|
||||||
private final SimpleObjectProperty<LocalTime> end;
|
private final SimpleObjectProperty<LocalTime> end;
|
||||||
private final SimpleStringProperty description;
|
private final SimpleStringProperty description;
|
||||||
private final SimpleStringProperty remarks;
|
private final SimpleStringProperty remarks;
|
||||||
private final SimpleBooleanProperty locked;
|
|
||||||
private final static int BLOCKED_YEARS = 10;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This constructor allows instantiating a {@link Treatment} object,
|
* This constructor allows instantiating a {@link Treatment} object,
|
||||||
|
@ -55,7 +50,6 @@ public class Treatment {
|
||||||
this.end = new SimpleObjectProperty<>(end);
|
this.end = new SimpleObjectProperty<>(end);
|
||||||
this.description = new SimpleStringProperty(description);
|
this.description = new SimpleStringProperty(description);
|
||||||
this.remarks = new SimpleStringProperty(remarks);
|
this.remarks = new SimpleStringProperty(remarks);
|
||||||
this.locked = new SimpleBooleanProperty(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,8 +63,7 @@ public class Treatment {
|
||||||
LocalTime begin,
|
LocalTime begin,
|
||||||
LocalTime end,
|
LocalTime end,
|
||||||
String description,
|
String description,
|
||||||
String remarks,
|
String remarks
|
||||||
Boolean isLocked
|
|
||||||
) {
|
) {
|
||||||
this.id = new SimpleIntegerProperty(id);
|
this.id = new SimpleIntegerProperty(id);
|
||||||
this.patient = new SimpleObjectProperty<>(patient);
|
this.patient = new SimpleObjectProperty<>(patient);
|
||||||
|
@ -80,26 +73,6 @@ public class Treatment {
|
||||||
this.end = new SimpleObjectProperty<>(end);
|
this.end = new SimpleObjectProperty<>(end);
|
||||||
this.description = new SimpleStringProperty(description);
|
this.description = new SimpleStringProperty(description);
|
||||||
this.remarks = new SimpleStringProperty(remarks);
|
this.remarks = new SimpleStringProperty(remarks);
|
||||||
this.locked = new SimpleBooleanProperty(isLocked);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculates delete date of treatment.
|
|
||||||
*/
|
|
||||||
public LocalDate calculateDeleteDate() {
|
|
||||||
return DateConverter.convertStringToLocalDate(getDate()).plusYears(BLOCKED_YEARS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isLocked() {
|
|
||||||
return locked.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public SimpleBooleanProperty lockedProperty() {
|
|
||||||
return locked;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLocked(boolean locked) {
|
|
||||||
this.locked.set(locked);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
|
@ -193,8 +166,6 @@ public class Treatment {
|
||||||
.add("End: " + this.getEnd())
|
.add("End: " + this.getEnd())
|
||||||
.add("Description: " + this.getDescription())
|
.add("Description: " + this.getDescription())
|
||||||
.add("Remarks: " + this.getRemarks())
|
.add("Remarks: " + this.getRemarks())
|
||||||
.add("isLocked: " + this.isLocked())
|
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -21,8 +20,6 @@ import java.util.List;
|
||||||
*
|
*
|
||||||
* @author Bernd Heidemannn
|
* @author Bernd Heidemannn
|
||||||
* @author Dominik Säume
|
* @author Dominik Säume
|
||||||
* @author Armin Ribic
|
|
||||||
* @author Dorian Nemec
|
|
||||||
*/
|
*/
|
||||||
public class TreatmentDao extends DaoImp<Treatment> {
|
public class TreatmentDao extends DaoImp<Treatment> {
|
||||||
|
|
||||||
|
@ -30,22 +27,60 @@ public class TreatmentDao extends DaoImp<Treatment> {
|
||||||
super(connection);
|
super(connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Read all database entries of active {@link Treatment}s into a {@link List} of model instances.
|
protected PreparedStatement getCreateStatement(Treatment treatment) throws SQLException {
|
||||||
*/
|
final String SQL = """
|
||||||
public List<Treatment> readAllActive() throws SQLException {
|
INSERT INTO treatment
|
||||||
final String SQL = "SELECT * FROM treatment WHERE isLocked = false";
|
(patientId, nurseId, date, begin, end, description, remark)
|
||||||
return getListFromResultSet(this.connection.prepareStatement(SQL).executeQuery());
|
VALUES (?, ?, ?, ?, ?, ?, ?)
|
||||||
|
""";
|
||||||
|
PreparedStatement statement = this.connection.prepareStatement(SQL);
|
||||||
|
statement.setInt(1, treatment.getPatient().getId());
|
||||||
|
statement.setInt(2, treatment.getNurse().getId());
|
||||||
|
statement.setString(3, treatment.getDate());
|
||||||
|
statement.setString(4, treatment.getBegin());
|
||||||
|
statement.setString(5, treatment.getEnd());
|
||||||
|
statement.setString(6, treatment.getDescription());
|
||||||
|
statement.setString(7, treatment.getRemarks());
|
||||||
|
return statement;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Read all database entries of locked {@link Treatment}s into a {@link Treatment} of model instances.
|
protected PreparedStatement getReadByIDStatement(int id) throws SQLException {
|
||||||
*/
|
final String SQL = "SELECT * FROM treatment WHERE id = ?";
|
||||||
public List<Treatment> readAllLocked() throws SQLException {
|
PreparedStatement statement = this.connection.prepareStatement(SQL);
|
||||||
final String SQL = "SELECT * FROM treatment WHERE isLocked = true";
|
statement.setInt(1, id);
|
||||||
return getListFromResultSet(this.connection.prepareStatement(SQL).executeQuery());
|
return statement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Treatment getInstanceFromResultSet(ResultSet result) throws SQLException {
|
||||||
|
return new Treatment(
|
||||||
|
result.getInt(1),
|
||||||
|
DaoFactory.getInstance().createPatientDAO().read(result.getInt(2)),
|
||||||
|
DaoFactory.getInstance().createNurseDAO().read(result.getInt(3)),
|
||||||
|
DateConverter.convertStringToLocalDate(result.getString(4)),
|
||||||
|
DateConverter.convertStringToLocalTime(result.getString(5)),
|
||||||
|
DateConverter.convertStringToLocalTime(result.getString(6)),
|
||||||
|
result.getString(7),
|
||||||
|
result.getString(8)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PreparedStatement getReadAllStatement() throws SQLException {
|
||||||
|
final String SQL = "SELECT * FROM treatment";
|
||||||
|
return this.connection.prepareStatement(SQL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<Treatment> getListFromResultSet(ResultSet result) throws SQLException {
|
||||||
|
ArrayList<Treatment> list = new ArrayList<>();
|
||||||
|
while (result.next()) {
|
||||||
|
list.add(getInstanceFromResultSet(result));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a list of {@link Treatment}s associated with a specific
|
* Retrieves a list of {@link Treatment}s associated with a specific
|
||||||
|
@ -77,63 +112,6 @@ public class TreatmentDao extends DaoImp<Treatment> {
|
||||||
return getListFromResultSet(result);
|
return getListFromResultSet(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected PreparedStatement getCreateStatement(Treatment treatment) throws SQLException {
|
|
||||||
final String SQL = """
|
|
||||||
INSERT INTO treatment
|
|
||||||
(patientId, nurseId, date, begin, end, description, remark, isLocked)
|
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
||||||
""";
|
|
||||||
PreparedStatement statement = this.connection.prepareStatement(SQL);
|
|
||||||
statement.setInt(1, treatment.getPatient().getId());
|
|
||||||
statement.setInt(2, treatment.getNurse().getId());
|
|
||||||
statement.setString(3, treatment.getDate());
|
|
||||||
statement.setString(4, treatment.getBegin());
|
|
||||||
statement.setString(5, treatment.getEnd());
|
|
||||||
statement.setString(6, treatment.getDescription());
|
|
||||||
statement.setString(7, treatment.getRemarks());
|
|
||||||
statement.setBoolean(8, treatment.isLocked());
|
|
||||||
return statement;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected PreparedStatement getReadByIDStatement(int id) throws SQLException {
|
|
||||||
final String SQL = "SELECT * FROM treatment WHERE id = ?";
|
|
||||||
PreparedStatement statement = this.connection.prepareStatement(SQL);
|
|
||||||
statement.setInt(1, id);
|
|
||||||
return statement;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Treatment getInstanceFromResultSet(ResultSet result) throws SQLException {
|
|
||||||
return new Treatment(
|
|
||||||
result.getInt(1),
|
|
||||||
DaoFactory.getInstance().createPatientDAO().read(result.getInt(2)),
|
|
||||||
DaoFactory.getInstance().createNurseDAO().read(result.getInt(3)),
|
|
||||||
DateConverter.convertStringToLocalDate(result.getString(4)),
|
|
||||||
DateConverter.convertStringToLocalTime(result.getString(5)),
|
|
||||||
DateConverter.convertStringToLocalTime(result.getString(6)),
|
|
||||||
result.getString(7),
|
|
||||||
result.getString(8),
|
|
||||||
result.getBoolean(9)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected PreparedStatement getReadAllStatement() throws SQLException {
|
|
||||||
final String SQL = "SELECT * FROM treatment";
|
|
||||||
return this.connection.prepareStatement(SQL);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected List<Treatment> getListFromResultSet(ResultSet result) throws SQLException {
|
|
||||||
ArrayList<Treatment> list = new ArrayList<>();
|
|
||||||
while (result.next()) {
|
|
||||||
list.add(getInstanceFromResultSet(result));
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PreparedStatement getUpdateStatement(Treatment treatment) throws SQLException {
|
protected PreparedStatement getUpdateStatement(Treatment treatment) throws SQLException {
|
||||||
final String SQL = """
|
final String SQL = """
|
||||||
|
@ -142,8 +120,7 @@ public class TreatmentDao extends DaoImp<Treatment> {
|
||||||
begin = ?,
|
begin = ?,
|
||||||
end = ?,
|
end = ?,
|
||||||
description = ?,
|
description = ?,
|
||||||
remark = ?,
|
remark = ?
|
||||||
isLocked = ?
|
|
||||||
WHERE id = ?
|
WHERE id = ?
|
||||||
""";
|
""";
|
||||||
PreparedStatement statement = this.connection.prepareStatement(SQL);
|
PreparedStatement statement = this.connection.prepareStatement(SQL);
|
||||||
|
@ -152,8 +129,7 @@ public class TreatmentDao extends DaoImp<Treatment> {
|
||||||
statement.setString(3, treatment.getEnd());
|
statement.setString(3, treatment.getEnd());
|
||||||
statement.setString(4, treatment.getDescription());
|
statement.setString(4, treatment.getDescription());
|
||||||
statement.setString(5, treatment.getRemarks());
|
statement.setString(5, treatment.getRemarks());
|
||||||
statement.setBoolean(6, treatment.isLocked());
|
statement.setInt(6, treatment.getId());
|
||||||
statement.setInt(7, treatment.getId());
|
|
||||||
return statement;
|
return statement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,5 +141,4 @@ public class TreatmentDao extends DaoImp<Treatment> {
|
||||||
statement.setInt(1, id);
|
statement.setInt(1, id);
|
||||||
return statement;
|
return statement;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,14 +13,7 @@
|
||||||
<AnchorPane fx:id="patientPage"/>
|
<AnchorPane fx:id="patientPage"/>
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab fx:id="treatmentTab" text="Behandlungen">
|
<Tab fx:id="treatmentTab" text="Behandlungen">
|
||||||
<TabPane fx:id="treatmentTabPane" tabClosingPolicy="UNAVAILABLE">
|
<AnchorPane fx:id="treatmentPage"/>
|
||||||
<Tab fx:id="activeTreatmentTab" text="Behandlungen">
|
|
||||||
<AnchorPane fx:id="activeTreatmentPage"/>
|
|
||||||
</Tab>
|
|
||||||
<Tab fx:id="lockedTreatmentTab" text="Gesperrte Behandlungen">
|
|
||||||
<AnchorPane fx:id="lockedTreatmentPage" />
|
|
||||||
</Tab>
|
|
||||||
</TabPane>
|
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab fx:id="nurseTab" text="Pfleger">
|
<Tab fx:id="nurseTab" text="Pfleger">
|
||||||
<TabPane fx:id="nurseTabPane" tabClosingPolicy="UNAVAILABLE">
|
<TabPane fx:id="nurseTabPane" tabClosingPolicy="UNAVAILABLE">
|
||||||
|
|
|
@ -12,11 +12,7 @@
|
||||||
<Insets top="8" left="8" right="8" bottom="8"/>
|
<Insets top="8" left="8" right="8" bottom="8"/>
|
||||||
</padding>
|
</padding>
|
||||||
<center>
|
<center>
|
||||||
<TableView
|
<TableView fx:id="tableView" layoutX="31.0" layoutY="40" onMouseClicked="#handleMouseClick" >
|
||||||
fx:id="tableView"
|
|
||||||
layoutX="31.0"
|
|
||||||
layoutY="40"
|
|
||||||
onMouseClicked="#handleMouseClick" >
|
|
||||||
<columns>
|
<columns>
|
||||||
<TableColumn
|
<TableColumn
|
||||||
fx:id="columnId"
|
fx:id="columnId"
|
||||||
|
|
|
@ -88,11 +88,11 @@
|
||||||
</center>
|
</center>
|
||||||
<right>
|
<right>
|
||||||
<Button
|
<Button
|
||||||
fx:id="buttonLock"
|
fx:id="buttonDelete"
|
||||||
mnemonicParsing="false"
|
mnemonicParsing="false"
|
||||||
onAction="#handleLock"
|
onAction="#handleDelete"
|
||||||
prefWidth="200.0"
|
prefWidth="200.0"
|
||||||
text="Sperren"
|
text="Löschen"
|
||||||
GridPane.columnIndex="2"
|
GridPane.columnIndex="2"
|
||||||
/>
|
/>
|
||||||
</right>
|
</right>
|
||||||
|
|
|
@ -1,77 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<?import javafx.geometry.*?>
|
|
||||||
<?import javafx.scene.control.*?>
|
|
||||||
<?import javafx.scene.layout.*?>
|
|
||||||
|
|
||||||
<BorderPane prefHeight="400.0"
|
|
||||||
prefWidth="600.0"
|
|
||||||
xmlns="http://javafx.com/javafx/17.0.2-ea"
|
|
||||||
xmlns:fx="http://javafx.com/fxml/1"
|
|
||||||
fx:controller="de.hitec.nhplus.treatment.LockedTreatmentController">
|
|
||||||
<padding>
|
|
||||||
<Insets bottom="8" left="8" right="8" top="8" />
|
|
||||||
</padding>
|
|
||||||
<center>
|
|
||||||
<TableView
|
|
||||||
fx:id="tableView"
|
|
||||||
layoutX="31.0"
|
|
||||||
layoutY="40">
|
|
||||||
<columns>
|
|
||||||
<TableColumn
|
|
||||||
fx:id="columnId"
|
|
||||||
minWidth="40.0"
|
|
||||||
prefWidth="102.0"
|
|
||||||
text="ID"
|
|
||||||
/>
|
|
||||||
<TableColumn
|
|
||||||
fx:id="columnPatient"
|
|
||||||
minWidth="40.0"
|
|
||||||
prefWidth="102.0"
|
|
||||||
text="Patient"
|
|
||||||
/>
|
|
||||||
<TableColumn
|
|
||||||
fx:id="columnNurse"
|
|
||||||
minWidth="40.0"
|
|
||||||
prefWidth="102.0"
|
|
||||||
text="Pflegekraft"
|
|
||||||
/>
|
|
||||||
<TableColumn
|
|
||||||
fx:id="columnDeleteDate"
|
|
||||||
minWidth="40.0"
|
|
||||||
prefWidth="102.0"
|
|
||||||
text="Löschung am"
|
|
||||||
/>
|
|
||||||
</columns>
|
|
||||||
<columnResizePolicy>
|
|
||||||
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/>
|
|
||||||
</columnResizePolicy>
|
|
||||||
</TableView>
|
|
||||||
</center>
|
|
||||||
<bottom>
|
|
||||||
<BorderPane>
|
|
||||||
<BorderPane.margin>
|
|
||||||
<Insets top="8.0"/>
|
|
||||||
</BorderPane.margin>
|
|
||||||
<center>
|
|
||||||
<HBox spacing="8.0">
|
|
||||||
<padding>
|
|
||||||
<Insets right="8.0"/>
|
|
||||||
</padding>
|
|
||||||
</HBox>
|
|
||||||
</center>
|
|
||||||
<right>
|
|
||||||
<HBox>
|
|
||||||
<spacing>8.0</spacing>
|
|
||||||
<Button
|
|
||||||
fx:id="buttonUnlock"
|
|
||||||
mnemonicParsing="false"
|
|
||||||
onAction="#unlockTreatment"
|
|
||||||
prefWidth="90.0"
|
|
||||||
text="Entsperren"
|
|
||||||
/>
|
|
||||||
</HBox>
|
|
||||||
</right>
|
|
||||||
</BorderPane>
|
|
||||||
</bottom>
|
|
||||||
</BorderPane>
|
|
|
@ -8,7 +8,6 @@ CREATE TABLE treatment
|
||||||
end TEXT NOT NULL,
|
end TEXT NOT NULL,
|
||||||
description TEXT NOT NULL,
|
description TEXT NOT NULL,
|
||||||
remark TEXT NOT NULL,
|
remark TEXT NOT NULL,
|
||||||
isLocked BOOLEAN NOT NULL DEFAULT false,
|
|
||||||
FOREIGN KEY (patientId) REFERENCES patient (id) ON DELETE CASCADE,
|
FOREIGN KEY (patientId) REFERENCES patient (id) ON DELETE CASCADE,
|
||||||
FOREIGN KEY (nurseId) REFERENCES nurse (id) ON DELETE SET NULL
|
FOREIGN KEY (nurseId) REFERENCES nurse (id) ON DELETE SET NULL
|
||||||
)
|
)
|
Loading…
Reference in a new issue