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