| @@ -113,17 +113,17 @@ public class FallController { | |||
| fallFallart.setItems(FXCollections.observableArrayList(FallArt.values())); | |||
| fallKasse.setItems(mainController.getStammdaten().getKassen()); | |||
| btnFallEnableEdit.visibleProperty().bind( | |||
| btnFallEnableEdit.managedProperty().bind( | |||
| state.isEqualTo(State.VIEW).and(fallProperty.isNotNull()) | |||
| ); | |||
| btnFallAbort.visibleProperty().bind( | |||
| btnFallAbort.managedProperty().bind( | |||
| state.isNotEqualTo(State.VIEW) | |||
| ); | |||
| btnFallSave.visibleProperty().bind( | |||
| btnFallSave.managedProperty().bind( | |||
| state.isNotEqualTo(State.VIEW) | |||
| ); | |||
| btnFallCancel.visibleProperty().bind( | |||
| btnFallCancel.managedProperty().bind( | |||
| state.isEqualTo(State.VIEW).and(fallProperty.isNotNull()) | |||
| ); | |||
| @@ -159,8 +159,7 @@ public class FallController { | |||
| @FXML | |||
| void clickedFallCancel(ActionEvent event) { | |||
| this.state.set(State.VIEW); | |||
| copyFallDataIntoField(fallProperty.get()); | |||
| //Fall Stornieren... | |||
| } | |||
| @FXML | |||
| @@ -215,15 +215,18 @@ public class MainController { | |||
| fallController.fallPropertyProperty().bind(lvFall.getSelectionModel().selectedItemProperty()); | |||
| lvFall.getSelectionModel().selectedItemProperty().addListener(onCaseChanged); | |||
| lvFall.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) ->{ | |||
| refreshCaseData(newValue); | |||
| }); | |||
| } | |||
| private Task<Void> loadCaseData = null; | |||
| private ChangeListener<Fall> onCaseChanged = (observable, oldValue, newValue) -> { | |||
| private void refreshCaseData(Fall fall){ | |||
| if (loadCaseData != null && loadCaseData.isRunning()) { | |||
| loadCaseData.cancel(); | |||
| } | |||
| @@ -233,14 +236,14 @@ public class MainController { | |||
| tabFallStationsHistorie.setDisable(true); | |||
| tabFallUntersuchungen.setDisable(true); | |||
| if (newValue == null) { | |||
| if (fall == null) { | |||
| tabPaneFall.setDisable(true); | |||
| System.out.println("TODO: Clear tables cuz fall = null!"); | |||
| //fallController.c | |||
| return; | |||
| } | |||
| if (newValue == null) { // If no patient is selected | |||
| if (fall == null) { // If no patient is selected | |||
| //lvFallPlaceholder.setText("Kein Patient ausgew\u00e4hlt!"); | |||
| return; | |||
| } | |||
| @@ -253,9 +256,9 @@ public class MainController { | |||
| @Override | |||
| protected Void call() throws Exception { | |||
| untersuchungList = DBHandler.getUntersuchungByFall(newValue); | |||
| diagnoseList = DBHandler.getDiagnosenByFall(newValue); | |||
| stationsHistorieList = DBHandler.getStationsHistorieByFall(newValue); | |||
| untersuchungList = DBHandler.getUntersuchungByFall(fall); | |||
| diagnoseList = DBHandler.getDiagnosenByFall(fall); | |||
| stationsHistorieList = DBHandler.getStationsHistorieByFall(fall); | |||
| return null; | |||
| } | |||
| @@ -297,9 +300,13 @@ public class MainController { | |||
| thread.setDaemon(true); | |||
| thread.start(); | |||
| increaseParallelTaskCount(); | |||
| }; | |||
| } | |||
| public void refreshCaseData(){ | |||
| refreshCaseData(lvFall.getSelectionModel().getSelectedItem()); | |||
| } | |||
| @FXML | |||
| private void clickedCreateFall() { | |||
| // tabFallDiagnose.setDisable(true); | |||
| @@ -351,6 +358,8 @@ public enum TabName { | |||
| tabFallDiagnose.setDisable(false); | |||
| tabFallUntersuchungen.setDisable(false); | |||
| tabFallStationsHistorie.setDisable(false); | |||
| tabFallOverview.setDisable(false); | |||
| patientTablesController.getPatientOverviewTabPane().setDisable(false); | |||
| lvFall.setDisable(false); | |||
| btnFallCreate.setDisable(false); | |||
| @@ -16,6 +16,7 @@ import javafx.scene.control.*; | |||
| import javafx.scene.control.cell.PropertyValueFactory; | |||
| import javafx.scene.layout.GridPane; | |||
| import java.sql.SQLException; | |||
| import java.time.LocalDate; | |||
| import java.util.List; | |||
| import java.util.stream.Collectors; | |||
| @@ -104,7 +105,11 @@ public class StationsHistorieController { | |||
| fields.disableProperty().bind(stateProperty().isEqualTo(State.VIEW)); | |||
| state.addListener((observable, oldValue, newValue) -> { | |||
| if(newValue == State.CREATE || newValue == State.EDIT){ | |||
| mainController.lockForEdit(MainController.TabName.STATIONSHISTORIE); | |||
| }else{ | |||
| mainController.unlockFromEdit(); | |||
| } | |||
| }); | |||
| @@ -162,7 +167,16 @@ public class StationsHistorieController { | |||
| @FXML | |||
| private void clickedSave(){ | |||
| //TODO | |||
| if(getState()==State.CREATE){ | |||
| StationsHistorie stationsHistorie = new StationsHistorie(); | |||
| copyFieldDataIntoStationsHistorie(stationsHistorie); | |||
| try { | |||
| DBHandler.setStationsHistorie(stationsHistorie,false); | |||
| } catch (SQLException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| mainController.refreshCaseData(); | |||
| } | |||
| } | |||
| @FXML | |||
| @@ -14,30 +14,16 @@ | |||
| <children> | |||
| <Label text="Patient:"/> | |||
| <Label fx:id="fallPatID" text="John Doe (PatID = XXX)" GridPane.columnIndex="1"/> | |||
| <Label text="Aufnahmedatum:" GridPane.rowIndex="1"/> | |||
| <!-- <HBox prefHeight="100.0" prefWidth="200.0" spacing="5.0" GridPane.columnIndex="1" GridPane.rowIndex="1"> | |||
| <children> | |||
| <DatePicker fx:id="fallAufnDate"/> | |||
| <TextField fx:id="fallAufnTime" prefColumnCount="5" promptText="HH:MM"/> | |||
| <Button fx:id="btnFallAufnNow" mnemonicParsing="false" onAction="#clickedFallAufnNow" | |||
| text="Jetzt"/> | |||
| </children> | |||
| <GridPane.margin> | |||
| <Insets/> | |||
| </GridPane.margin> | |||
| </HBox>--> | |||
| <DateTimePicker GridPane.rowIndex="1" GridPane.columnIndex="1" fx:id="dtTmAufnahme" /> | |||
| <Label text="Entlassungsdatum:" GridPane.rowIndex="2"/> | |||
| <!--<HBox prefHeight="100.0" prefWidth="200.0" spacing="5.0" GridPane.columnIndex="1" GridPane.rowIndex="2"> | |||
| <children> | |||
| <DatePicker fx:id="fallEntlDate"/> | |||
| <TextField fx:id="fallEntlTime" prefColumnCount="5" promptText="HH:MM"/> | |||
| <Button fx:id="btnFallEntlNow" mnemonicParsing="false" onAction="#clickedFallEntlNow" | |||
| text="Jetzt"/> | |||
| </children> | |||
| </HBox>--> | |||
| <DateTimePicker GridPane.rowIndex="2" GridPane.columnIndex="1" fx:id="dtTmEntlassung" /> | |||
| <Label text="Versichertennummer:" GridPane.rowIndex="3"/> | |||
| <TextField fx:id="fallVersichertennummer" GridPane.columnIndex="1" GridPane.rowIndex="3"/> | |||
| <Label text="Einweisender Arzt:" GridPane.rowIndex="4"/> | |||
| <HBox alignment="CENTER_LEFT" spacing="5.0" GridPane.columnIndex="1" GridPane.rowIndex="4"> | |||
| <children> | |||
| @@ -46,11 +32,13 @@ | |||
| <CheckBox fx:id="fallSelbsteinweisung" mnemonicParsing="false" text="Selbsteinweisung"/> | |||
| </children> | |||
| </HBox> | |||
| <Label text="Fallart:" GridPane.rowIndex="5"/> | |||
| <ComboBox fx:id="fallFallart" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="5"/> | |||
| <Label text="Kasse:" GridPane.rowIndex="6"/> | |||
| <ComboBox fx:id="fallKasse" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="6"/> | |||
| <TextField fx:id="fallVersichertennummer" GridPane.columnIndex="1" GridPane.rowIndex="3"/> | |||
| <ComboBox fx:id="fallKasse" prefWidth="250.0" GridPane.columnIndex="1" GridPane.rowIndex="6"/> | |||
| <Label text="Hauptdiagnose:" GridPane.rowIndex="7"/> | |||
| <ComboBox fx:id="fallHauptdiagnose" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="7"/> | |||
| </children> | |||