|
|
|
@@ -146,7 +146,7 @@ public class PatientTablesController { |
|
|
|
return tableRow; |
|
|
|
}); |
|
|
|
lblTablePatientEmpty.setText("Liste ist leer."); |
|
|
|
lblTableStationEmpty.setText("Daten werden geladen..."); |
|
|
|
lblTableStationEmpty.setText(""); |
|
|
|
|
|
|
|
cmbStationenFilter.itemsProperty().bind(mainController.getStammdaten().stationenProperty()); |
|
|
|
|
|
|
|
@@ -198,13 +198,7 @@ public class PatientTablesController { |
|
|
|
|
|
|
|
|
|
|
|
cmbStationenFilter.valueProperty().addListener((observableValue, oldValue, newValue) -> { |
|
|
|
try { |
|
|
|
List uebersichtsItems = DBHandler.getStationsUebersichtsItems(newValue.getStation()); |
|
|
|
stationsUebersicht.setAll(uebersichtsItems); |
|
|
|
System.out.println(uebersichtsItems); |
|
|
|
} catch (SQLException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
updateStationsHistorieFromDb(); |
|
|
|
}); |
|
|
|
tblStationOverview.itemsProperty().bind(Bindings.createObjectBinding(() -> { |
|
|
|
if (btnEntlassenePatientenZeigen.isSelected()) { |
|
|
|
@@ -304,6 +298,77 @@ public class PatientTablesController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@FXML |
|
|
|
Button btnStatRefresh; |
|
|
|
|
|
|
|
@FXML |
|
|
|
private void clickedRefreshStation(){ |
|
|
|
updateStationsHistorieFromDb(); |
|
|
|
} |
|
|
|
|
|
|
|
private Task loadStationsHistorieTask = null; |
|
|
|
|
|
|
|
public void updateStationsHistorieFromDb() { |
|
|
|
if (this.loadStationsHistorieTask != null && this.loadStationsHistorieTask.isRunning()) { |
|
|
|
loadStationsHistorieTask.cancel(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
btnStatRefresh.setDisable(true); |
|
|
|
|
|
|
|
stationsUebersicht.clear(); |
|
|
|
|
|
|
|
mainController.increaseParallelTaskCount(); |
|
|
|
|
|
|
|
lblTableStationEmpty.setText("Liste wird geladen..."); |
|
|
|
|
|
|
|
Task<List<StationsUebersichtsItem>> loadStatHist = new Task<List<StationsUebersichtsItem>>() { |
|
|
|
|
|
|
|
@Override |
|
|
|
protected List<StationsUebersichtsItem> call() throws Exception { |
|
|
|
return FXCollections.<StationsUebersichtsItem>observableArrayList( |
|
|
|
DBHandler.getStationsUebersichtsItems(cmbStationenFilter.getValue().getStation())); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void succeeded() { |
|
|
|
super.succeeded(); |
|
|
|
if(!isCancelled()) { |
|
|
|
lblTableStationEmpty.setText("Liste ist leer."); |
|
|
|
stationsUebersicht.setAll(this.getValue()); |
|
|
|
btnStatRefresh.setDisable(false); |
|
|
|
mainController.decreaseParallelTaskCount(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void cancelled() { |
|
|
|
super.cancelled(); |
|
|
|
btnStatRefresh.setDisable(false); |
|
|
|
mainController.decreaseParallelTaskCount(); |
|
|
|
System.out.println("Cancelled"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void failed() { |
|
|
|
super.failed(); |
|
|
|
if(!isCancelled()){ |
|
|
|
lblTablePatientEmpty.setText("Laden fehlgeschlagen!"); |
|
|
|
getException().printStackTrace(); |
|
|
|
} |
|
|
|
mainController.decreaseParallelTaskCount(); |
|
|
|
btnStatRefresh.setDisable(false); |
|
|
|
} |
|
|
|
}; |
|
|
|
this.loadStationsHistorieTask = loadStatHist; |
|
|
|
|
|
|
|
Thread thread = new Thread(loadStationsHistorieTask); |
|
|
|
thread.setDaemon(true); |
|
|
|
thread.start(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Task loadPatientTask = null; |
|
|
|
|
|
|
|
@FXML |
|
|
|
|