| @@ -7,6 +7,7 @@ import de.uniluebeck.mi.projmi6.model.Diagnose; | |||
| import de.uniluebeck.mi.projmi6.model.Icd10Code; | |||
| import de.uniluebeck.mi.projmi6.model.Mitarbeiter; | |||
| import de.uniluebeck.mi.projmi6.view.SelectKeyComboBoxListener; | |||
| import javafx.beans.binding.Bindings; | |||
| import javafx.beans.property.ReadOnlyObjectProperty; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| import javafx.collections.FXCollections; | |||
| @@ -206,7 +207,8 @@ public class DiagnoseController { | |||
| * Bind button visibility to application state. | |||
| */ | |||
| private void initButtons() { | |||
| btnDiagCreate.disableProperty().bind(mainController.fallProperty().isNull()); | |||
| btnDiagCreate.disableProperty().bind(mainController.fallProperty().isNull().or(Bindings.createBooleanBinding( | |||
| ()->mainController.getFall()!= null && mainController.getFall().getStorniert(), mainController.fallProperty()))); | |||
| btnDiagEdit.disableProperty().bind(diagnoseList.getSelectionModel().selectedItemProperty().isNull()); | |||
| @@ -295,6 +297,7 @@ public class DiagnoseController { | |||
| diagDiagnoseArt.setValue(diagnose.getDiagArt()); | |||
| diagDiagnose.setValue(diagnose.getIcd10code()); | |||
| diagCreator.setText(Integer.toString(diagnose.getErsteller())); | |||
| diagCreateTime.setText(diagnose.getErstellDatumZeit().toString()); | |||
| diagChanger.setText(Integer.toString(diagnose.getBearbeiter())); | |||
| @@ -6,6 +6,7 @@ import de.uniluebeck.mi.projmi6.db.DBHandler; | |||
| import de.uniluebeck.mi.projmi6.hapi.HL7Sender; | |||
| import de.uniluebeck.mi.projmi6.model.*; | |||
| import de.uniluebeck.mi.projmi6.view.DateTimePicker; | |||
| import javafx.beans.binding.Bindings; | |||
| import javafx.beans.property.ObjectProperty; | |||
| import javafx.beans.property.ReadOnlyObjectProperty; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| @@ -173,6 +174,8 @@ public class FallController { | |||
| state.isEqualTo(State.VIEW).and(fallProperty.isNotNull()) | |||
| ); | |||
| btnFallEnableEdit.visibleProperty().bind(btnFallEnableEdit.managedProperty()); | |||
| btnFallAbort.managedProperty().bind( | |||
| state.isNotEqualTo(State.VIEW) | |||
| ); | |||
| @@ -249,7 +252,9 @@ public class FallController { | |||
| * Toggle controller state to edit | |||
| */ | |||
| private void editFall() { | |||
| this.state.set(State.EDIT); | |||
| if(!fallProperty.get().getStorniert()){ | |||
| this.state.set(State.EDIT); | |||
| } | |||
| } | |||
| /** | |||
| @@ -434,6 +439,10 @@ public class FallController { | |||
| copyHauptdiagnoseToComboBox(fall); | |||
| fallFallart.setValue(fall.getFallArt()); | |||
| btnFallEnableEdit.setDisable(fall.getStorniert()); | |||
| btnFallCancel.setDisable(fall.getStorniert()); | |||
| btnFallSendHl7.setDisable(fall.getStorniert()); | |||
| } | |||
| /** | |||
| @@ -119,7 +119,7 @@ public class StationsHistorieController { | |||
| fields.disableProperty().bind(stateProperty().isEqualTo(State.VIEW)); | |||
| btnStatHistCreate.disableProperty().bind(mainController.fallProperty().isNull()); | |||
| ; | |||
| state.addListener((observable, oldValue, newValue) -> { | |||
| if (newValue == State.CREATE || newValue == State.EDIT) { | |||
| @@ -144,6 +144,9 @@ public class StationsHistorieController { | |||
| // btnStatHistCancel.visibleProperty().bind(state.isEqualTo(State.VIEW).and(tblStationsHistorie.getSelectionModel().selectedItemProperty().isNotNull())); | |||
| // btnStatHistCancel.managedProperty().bind(btnStatHistCancel.visibleProperty()); | |||
| btnStatHistCreate.disableProperty().bind(mainController.fallProperty().isNull().or(Bindings.createBooleanBinding( | |||
| ()->mainController.getFall()!= null && mainController.getFall().getStorniert(), mainController.fallProperty()))); | |||
| btnStatHistSave.visibleProperty().bind(state.isEqualTo(State.VIEW).not()); | |||
| btnStatHistSave.managedProperty().bind(btnStatHistSave.visibleProperty()); | |||
| @@ -338,6 +341,9 @@ public class StationsHistorieController { | |||
| dtTmAufnahme.setDateTime(stationsHistorie.getAufnahmeDatum()); | |||
| dtTmEntlassung.setDateTime(stationsHistorie.getEntlassungsDatum()); | |||
| btnStatHistDelete.setDisable(mainController.getFall().getStorniert()); | |||
| btnStatHistEdit.setDisable(mainController.getFall().getStorniert()); | |||
| statHistCreator.setText(Integer.toString(stationsHistorie.getErsteller())); | |||
| if (stationsHistorie.getErstellDatumZeit() != null) { | |||
| statHistCreateTime.setText(stationsHistorie.getErstellDatumZeit().toString()); | |||
| @@ -11,6 +11,7 @@ import de.uniluebeck.mi.projmi6.model.OpsCode; | |||
| import de.uniluebeck.mi.projmi6.model.Untersuchung; | |||
| import de.uniluebeck.mi.projmi6.view.DateTimePicker; | |||
| import de.uniluebeck.mi.projmi6.view.SelectKeyComboBoxListener; | |||
| import javafx.beans.binding.Bindings; | |||
| import javafx.beans.property.ReadOnlyObjectProperty; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| import javafx.collections.ObservableList; | |||
| @@ -121,7 +122,8 @@ public class UntersuchungenController { | |||
| * Binds the buttons visibility to the controllers current state. | |||
| */ | |||
| private void initButtons() { | |||
| btnUntsCreate.disableProperty().bind(mainController.fallProperty().isNull()); | |||
| btnUntsCreate.disableProperty().bind(mainController.fallProperty().isNull().or(Bindings.createBooleanBinding( | |||
| ()->mainController.getFall()!= null && mainController.getFall().getStorniert(), mainController.fallProperty()))); | |||
| btnUntsCancel.managedProperty().bind(state.isEqualTo(State.VIEW) | |||
| .and(untsList.getSelectionModel().selectedItemProperty().isNotNull())); | |||
| @@ -132,6 +134,8 @@ public class UntersuchungenController { | |||
| btnUntsAbort.managedProperty().bind(btnUntsSave.managedProperty()); | |||
| btnUntsAbort.visibleProperty().bind(btnUntsSave.managedProperty()); | |||
| } | |||
| @@ -312,6 +316,9 @@ public class UntersuchungenController { | |||
| untsArzt.setValue(untersuchung.getDurchfuehrenderArzt()); | |||
| dtTmUntersuchungszeitpunkt.setDateTime(untersuchung.getUntersuchungsdatum()); | |||
| btnUntsCancel.setDisable(untersuchung.getStorniert()||mainController.getFall().getStorniert()); | |||
| untsCreator.setText(Integer.toString(untersuchung.getErsteller())); | |||
| untsCreateTime.setText(untersuchung.getErstellDatumZeit().toString()); | |||
| untsChanger.setText(Integer.toString(untersuchung.getBearbeiter())); | |||