| @@ -129,7 +129,7 @@ public class Main extends Application { | |||
| loadingMessage.close(); | |||
| primaryStage.setTitle("KIS Gruppe 06"); | |||
| primaryStage.setScene(new Scene(root, 1000, 800)); | |||
| primaryStage.setScene(new Scene(root, 1200, 800)); | |||
| primaryStage.show(); | |||
| }); | |||
| @@ -271,7 +271,7 @@ public class DiagnoseController { | |||
| * Clear the fields in case no diagnosis is selcted, or | |||
| * creating a new one is started. | |||
| */ | |||
| private void clearFields() { | |||
| public void clearFields() { | |||
| diagDiagnoseArzt.setValue(mainController.getCurrentMitarbeiter()); | |||
| diagDiagnose.setValue(null); | |||
| diagFreitext.setText(""); | |||
| @@ -21,6 +21,10 @@ import javafx.scene.layout.GridPane; | |||
| import java.io.IOException; | |||
| import java.sql.SQLException; | |||
| /** | |||
| * The controller that controls the detailed case data view. | |||
| * @author Johannes | |||
| */ | |||
| public class FallController { | |||
| /** | |||
| @@ -300,7 +304,7 @@ public class FallController { | |||
| /** | |||
| * Clears the TextFields. | |||
| */ | |||
| private void clearFields() { | |||
| public void clearFields() { | |||
| if (state.get() == State.CREATE) { | |||
| dtTmAufnahme.setToCurrentDateTime(); | |||
| dtTmEntlassung.setToCurrentDateTime(); | |||
| @@ -14,6 +14,13 @@ import javafx.util.Callback; | |||
| import java.util.List; | |||
| /** | |||
| * The applications main window controller. Has several sub controllers and handles the list of cases to a single | |||
| * patient as well as the spinning progress indicator. | |||
| * | |||
| * @author Johannes | |||
| */ | |||
| public class MainController { | |||
| /** | |||
| @@ -368,13 +375,20 @@ public class MainController { | |||
| if (fall == null) { | |||
| tabPaneFall.setDisable(true); | |||
| System.out.println("TODO: Clear tables cuz fall = null!"); | |||
| fallController.clearFields(); | |||
| stationsHistorieController.clearFields(); | |||
| diagnoseController.clearFields(); | |||
| untersuchungenController.clearFields(); | |||
| stationsHistorieController.setStationsHistorie(null); | |||
| diagnoseController.setDiagnosen(null); | |||
| untersuchungenController.setUntersuchungen(null); | |||
| //fallController.c | |||
| return; | |||
| } | |||
| if (fall == null) { // If no patient is selected | |||
| //lvFallPlaceholder.setText("Kein Patient ausgew\u00e4hlt!"); | |||
| lvFallPlaceholder.setText("Kein Patient ausgew\u00e4hlt!"); | |||
| return; | |||
| } | |||
| @@ -451,17 +465,24 @@ public class MainController { | |||
| /** | |||
| * | |||
| * @return | |||
| * Getter for the case that is currently selected in the list | |||
| */ | |||
| public Fall getFall() { | |||
| return lvFall.getSelectionModel().getSelectedItem(); | |||
| } | |||
| /** | |||
| * Property for the case selected in the list. | |||
| */ | |||
| public ReadOnlyObjectProperty<Fall> fallProperty() { | |||
| return lvFall.getSelectionModel().selectedItemProperty(); | |||
| } | |||
| /** | |||
| * Prevents the user from changing the patient/case and tab while editing case data. | |||
| * @param exclude The case data tab that should be excluded from disabling. | |||
| */ | |||
| public void lockForEdit(TabName exclude) { | |||
| tabFallDiagnose.setDisable(true); | |||
| tabFallUntersuchungen.setDisable(true); | |||
| @@ -491,6 +512,9 @@ public class MainController { | |||
| } | |||
| /** | |||
| * Unlocks the GUI from locking by {@link #lockForEdit(TabName)} | |||
| */ | |||
| public void unlockFromEdit() { | |||
| tabFallDiagnose.setDisable(false); | |||
| tabFallUntersuchungen.setDisable(false); | |||
| @@ -503,14 +527,23 @@ public class MainController { | |||
| } | |||
| /** | |||
| * The user / hospital employee that is currently "logged in" by choosing his name from the dropdown menu. | |||
| */ | |||
| public Mitarbeiter getCurrentMitarbeiter() { | |||
| return cmbUserChoose == null ? null : cmbUserChoose.getValue(); | |||
| } | |||
| /** | |||
| * Property of the currently logged in user. | |||
| */ | |||
| public ReadOnlyObjectProperty<Mitarbeiter> currentMitarbeiterProperty() { | |||
| return cmbUserChoose.valueProperty(); | |||
| } | |||
| /** | |||
| * TabName defintions for the {@link #lockForEdit(TabName)}-method | |||
| */ | |||
| public enum TabName { | |||
| OVERVIEW, DIAGNOSE, UNTERSUCHUNG, STATIONSHISTORIE | |||
| } | |||
| @@ -1,8 +1,5 @@ | |||
| package de.uniluebeck.mi.projmi6.controller; | |||
| /** | |||
| * Created by Johannes on 21/11/2015. | |||
| */ | |||
| import de.uniluebeck.mi.projmi6.model.HL7Message; | |||
| import javafx.beans.property.SimpleListProperty; | |||
| @@ -12,7 +9,13 @@ import javafx.scene.control.Button; | |||
| import javafx.scene.control.ListView; | |||
| import javafx.stage.Modality; | |||
| import javafx.stage.Stage; | |||
| /** | |||
| * The Controller that manages the list of unseen HL7 messages. | |||
| * At the moment, the list is opened in its own window. | |||
| * | |||
| * Created by Johannes on 21/11/2015. | |||
| * @author Johannes | |||
| */ | |||
| public class MessageListController { | |||
| private final SimpleListProperty<HL7Message> messages; | |||
| @@ -24,26 +27,40 @@ public class MessageListController { | |||
| @FXML | |||
| private Button btnRemove; | |||
| /** | |||
| * Contstructor. | |||
| * @param messages The list of messages that will be shown in this window. Elements might become deleted. | |||
| * @param mainController The main controller. Necessary to switch the patient and case. | |||
| */ | |||
| public MessageListController(SimpleListProperty<HL7Message> messages, MainController mainController) { | |||
| this.messages = messages; | |||
| this.mainController = mainController; | |||
| } | |||
| /** | |||
| * FXMLLoaders initialize()-method | |||
| */ | |||
| @FXML | |||
| private void initialize() { | |||
| lvMessages.setItems(messages); | |||
| //Disable buttons until a message in the list is selected | |||
| btnShow.disableProperty().bind(lvMessages.getSelectionModel().selectedItemProperty().isNull()); | |||
| btnRemove.disableProperty().bind(lvMessages.getSelectionModel().selectedItemProperty().isNull()); | |||
| messages.sizeProperty().addListener((observable, oldValue, newValue) -> { | |||
| //If no messages are left in the window, close the window. | |||
| if (messages.getSize() <= 0) { | |||
| ((Stage) lvMessages.getScene().getWindow()).close(); | |||
| } | |||
| }); | |||
| } | |||
| /** | |||
| * EventHandler for {@link #btnRemove} | |||
| */ | |||
| @FXML | |||
| void clickedRemove() { | |||
| private void clickedRemove() { | |||
| HL7Message message = lvMessages.getSelectionModel().getSelectedItem(); | |||
| if (message == null) { | |||
| return; | |||
| @@ -51,8 +68,13 @@ public class MessageListController { | |||
| messages.remove(message); | |||
| } | |||
| /** | |||
| * EventHandler for {@link #btnShow}. | |||
| * Opens patient and case regarding the HL7 message, or shows a error text for the message. | |||
| * | |||
| */ | |||
| @FXML | |||
| void clickedShow() { | |||
| private void clickedShow() { | |||
| HL7Message message = lvMessages.getSelectionModel().getSelectedItem(); | |||
| if (message == null) { | |||
| return; | |||
| @@ -60,6 +82,7 @@ public class MessageListController { | |||
| messages.remove(message); | |||
| if (message.isFailed()) { | |||
| //Show error messge. | |||
| Alert alert = new Alert(Alert.AlertType.ERROR); | |||
| alert.setTitle("Nachricht konnte nicht verarbeitet werden"); | |||
| alert.setHeaderText("Die Nachricht konnte nicht verarbeitet werden"); | |||
| @@ -69,6 +92,7 @@ public class MessageListController { | |||
| alert.showAndWait(); | |||
| } else { | |||
| //Select patient in the main window. | |||
| mainController.selectPatientAndFallId(message.getPatient(), message.getFallId()); | |||
| ((Stage) lvMessages.getScene().getWindow()).close(); | |||
| } | |||
| @@ -207,7 +207,7 @@ public class PatientEditorController { | |||
| } | |||
| /** | |||
| * | |||
| * EventHandler for {@link #btnPatSave} | |||
| */ | |||
| @FXML | |||
| private void clickedSave() { | |||
| @@ -236,6 +236,10 @@ public class PatientEditorController { | |||
| } | |||
| } | |||
| /** | |||
| * EventHandler for {@link #btnPatAbort} | |||
| */ | |||
| @FXML | |||
| private void clickedAbort() { | |||
| ((Stage) patVorname.getScene().getWindow()).close(); //Close Window | |||
| @@ -34,71 +34,56 @@ import java.util.List; | |||
| */ | |||
| public class PatientTablesController { | |||
| private final MainController mainController; | |||
| /** | |||
| * The placeholder labels in case the TableViews are empty | |||
| */ | |||
| @FXML | |||
| Button btnStatRefresh; | |||
| private MainController mainController; | |||
| @FXML | |||
| private Label lblTablePatientEmpty; | |||
| @FXML | |||
| private Label lblTableStationEmpty; | |||
| @FXML | |||
| private Button btnPatCreate; | |||
| private Label lblTablePatientEmpty, lblTableStationEmpty; | |||
| @FXML | |||
| private Button btnPatEdit; | |||
| private Button btnPatCreate, btnPatEdit, btnPatRefresh; | |||
| @FXML | |||
| private TableView<Patient> tblPatientOverview; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatPatId; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatGeburtsname; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatNachname; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatVorname; | |||
| private TableColumn<Patient, String> colPatPatId, colPatGeburtsname, colPatNachname, colPatVorname, colPatStrasse, | |||
| colPatPlz, colPatOrt, colPatCave; | |||
| @FXML | |||
| private TableColumn<Patient, LocalDate> colPatGebDatum; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatStrasse; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatPlz; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatOrt; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatCave; | |||
| @FXML | |||
| private ToggleButton btnEntlassenePatientenZeigen; | |||
| @FXML | |||
| private Button btnStatRefresh; | |||
| @FXML | |||
| private ComboBox<Station> cmbStationenFilter; | |||
| @FXML | |||
| private TableView<StationsUebersichtsItem> tblStationOverview; | |||
| @FXML | |||
| private TableColumn<StationsUebersichtsItem, Integer> colStatPatId; | |||
| private TableColumn<StationsUebersichtsItem, Integer> colStatPatId, colStatAlter; | |||
| @FXML | |||
| private TableColumn<StationsUebersichtsItem, String> colStatFullName; | |||
| @FXML | |||
| private TableColumn<StationsUebersichtsItem, LocalDate> colStatGebDatum; | |||
| @FXML | |||
| private TableColumn<StationsUebersichtsItem, Integer> colStatAlter; | |||
| @FXML | |||
| private TableColumn<StationsUebersichtsItem, LocalDate> colStatAufnahmedatum; | |||
| @FXML | |||
| private TableColumn<StationsUebersichtsItem, LocalDate> colStatEntlassungsdatum; | |||
| @FXML | |||
| private Tab stationOverviewTab; | |||
| @FXML | |||
| private Tab patientOverviewTab; | |||
| private TableColumn<StationsUebersichtsItem, LocalDate> colStatGebDatum, colStatAufnahmedatum, colStatEntlassungsdatum; | |||
| @FXML | |||
| private TabPane patientOverviewTabPane; | |||
| @FXML | |||
| private Tab stationOverviewTab, patientOverviewTab; | |||
| private ObservableList<StationsUebersichtsItem> stationsUebersicht = FXCollections.observableArrayList(); | |||
| private FilteredList<StationsUebersichtsItem> stationsUebersichtsItemFilteredList = new FilteredList<StationsUebersichtsItem>(stationsUebersicht, | |||
| item -> item.getStationEntlassung() == null || item.getStationEntlassung().isAfter(LocalDate.now())); | |||
| private Task loadStationsHistorieTask = null; | |||
| private Task loadPatientTask = null; | |||
| @FXML | |||
| private Button btnPatRefresh; | |||
| private ObjectBinding<Patient> patientObjectBinding = null; | |||
| /** | |||
| * Constructor. | |||
| * @param mainController The controller that creates this instance | |||
| */ | |||
| public PatientTablesController(MainController mainController) { | |||
| this.mainController = mainController; | |||
| } | |||
| @@ -107,8 +92,11 @@ public class PatientTablesController { | |||
| return patientOverviewTabPane; | |||
| } | |||
| /** | |||
| * FXMLLoaders initialize()-method. | |||
| */ | |||
| @FXML | |||
| public void initialize() { | |||
| private void initialize() { | |||
| btnPatEdit.disableProperty().bind(tblPatientOverview.getSelectionModel().selectedItemProperty().isNull()); | |||
| tblPatientOverview.setRowFactory(tableView -> { | |||
| TableRow<Patient> tableRow = new TableRow<>(); | |||
| @@ -149,6 +137,9 @@ public class PatientTablesController { | |||
| updatePatientsFromDb(); | |||
| } | |||
| /** | |||
| * Set up cell value factories for the patients table. | |||
| */ | |||
| private void initColumnsPatient() { | |||
| colPatPatId.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().patIDProperty().asString()); | |||
| colPatGeburtsname.setCellValueFactory(new PropertyValueFactory<>("geburtsname")); | |||
| @@ -164,6 +155,9 @@ public class PatientTablesController { | |||
| colPatCave.setCellValueFactory(new PropertyValueFactory<>("cave")); | |||
| } | |||
| /** | |||
| * Set up cell value factories for the hospital ward overview. | |||
| */ | |||
| private void initColumnsStation() { | |||
| colStatPatId.setCellValueFactory(new PropertyValueFactory<StationsUebersichtsItem, Integer>("patId")); | |||
| colStatFullName.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().patNameProperty()); | |||
| @@ -172,10 +166,12 @@ public class PatientTablesController { | |||
| colStatAufnahmedatum.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().stationAufnahmeProperty()); | |||
| colStatEntlassungsdatum.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().stationEntlassungProperty()); | |||
| //Reload data if the user selects another ward. | |||
| cmbStationenFilter.valueProperty().addListener((observableValue, oldValue, newValue) -> { | |||
| updateStationsHistorieFromDb(); | |||
| }); | |||
| //Init filter | |||
| tblStationOverview.itemsProperty().bind(Bindings.createObjectBinding(() -> { | |||
| if (btnEntlassenePatientenZeigen.isSelected()) { | |||
| return stationsUebersicht; | |||
| @@ -185,16 +181,27 @@ public class PatientTablesController { | |||
| }, btnEntlassenePatientenZeigen.selectedProperty())); | |||
| } | |||
| /** | |||
| * EventHandler for {@link #btnPatCreate} | |||
| */ | |||
| @FXML | |||
| private void clickedCreatePatient() { | |||
| showEditWindow(null); | |||
| } | |||
| /** | |||
| * EventHandler for {@link #btnPatEdit} | |||
| */ | |||
| @FXML | |||
| private void clickedEditPatient() { | |||
| showEditWindow(tblPatientOverview.getSelectionModel().getSelectedItem()); | |||
| } | |||
| /** | |||
| * Opens a window for editing the given patient. | |||
| * @param patient The patient that should be opened for editing. | |||
| */ | |||
| private void showEditWindow(Patient patient) { | |||
| FXMLLoader fxmlLoader = new FXMLLoader(); | |||
| fxmlLoader.setLocation(getClass().getClassLoader().getResource("patient_edit.fxml")); | |||
| @@ -219,14 +226,20 @@ public class PatientTablesController { | |||
| stage.initModality(Modality.WINDOW_MODAL); | |||
| stage.initOwner(btnPatEdit.getScene().getWindow()); | |||
| patientEditorController.setPatient(patient); | |||
| stage.show(); | |||
| stage.showAndWait(); | |||
| } | |||
| /** | |||
| * Highlight the given patient in the list, if patient was changed outside the controller. | |||
| */ | |||
| public void selectPatient(Patient patient) { | |||
| patientOverviewTabPane.getSelectionModel().select(0); // Select first tab | |||
| tblPatientOverview.getSelectionModel().select(patient); | |||
| } | |||
| /** | |||
| * Start the db request for loading every patient in the MySQL database. | |||
| */ | |||
| public void updatePatientsFromDb() { | |||
| if (this.loadPatientTask != null && this.loadPatientTask.isRunning()) { | |||
| System.out.println("Patienten werden bereits geladen."); | |||
| @@ -405,7 +405,7 @@ public class StationsHistorieController { | |||
| /** | |||
| * Clears TextFields in the view | |||
| */ | |||
| private void clearFields() { | |||
| public void clearFields() { | |||
| statHistCreateTime.setText(""); | |||
| statHistCreator.setText(""); | |||
| statHistEditTime.setText(""); | |||
| @@ -279,14 +279,14 @@ public class UntersuchungenController { | |||
| /** | |||
| * Clears the TextFields. | |||
| */ | |||
| private void clearFields() { | |||
| public void clearFields() { | |||
| untsCreateTime.setText(""); | |||
| untsCreator.setText(""); | |||
| untsChangeTime.setText(""); | |||
| untsChanger.setText(""); | |||
| untsOpsCode.setValue(null); | |||
| untsArzt.setValue(mainController.getCurrentMitarbeiter()); | |||
| untsArzt.setValue(null); | |||
| dtTmUntersuchungszeitpunkt.setDateTime(null); | |||
| } | |||
| @@ -85,8 +85,8 @@ public class DateTimePicker extends HBox { | |||
| HBox timePicker = new HBox(hourText, colon, minuteText); | |||
| timePicker.maxHeightProperty().bind(datePicker.heightProperty()); | |||
| timePicker.getStyleClass().add("time-picker"); | |||
| timePicker.setMinWidth(55); | |||
| timePicker.setMaxWidth(70); | |||
| timePicker.setMinWidth(65); | |||
| timePicker.setMaxWidth(80); | |||
| timePicker.getStyleClass().add("button"); | |||
| //Set Now-Button action | |||
| @@ -95,6 +95,9 @@ public class DateTimePicker extends HBox { | |||
| btnNow.setMinWidth(50); | |||
| btnNow.getStyleClass().add("now-button"); | |||
| btnNow.managedProperty().bind(this.disabledProperty().not()); | |||
| //Add the subcomponents to the view. | |||
| this.getChildren().addAll(datePicker, timePicker, btnNow); | |||
| @@ -37,7 +37,7 @@ | |||
| <Label text="Diagnoseart:" GridPane.columnIndex="0" GridPane.rowIndex="1"/> | |||
| <Label text="DiagnoseArzt:" GridPane.columnIndex="0" GridPane.rowIndex="2"/> | |||
| <Label text="Freitext: (optional)" GridPane.columnIndex="0" GridPane.rowIndex="3"/> | |||
| <ComboBox fx:id="diagDiagnose" maxWidth="1.7976931348623157E308" promptText="ICD-10" | |||
| <ComboBox fx:id="diagDiagnose" maxWidth="1.7976931348623157E308" promptText="" | |||
| GridPane.columnIndex="1" GridPane.rowIndex="0"/> | |||
| <ComboBox fx:id="diagDiagnoseArt" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1" | |||
| GridPane.rowIndex="1"/> | |||
| @@ -68,12 +68,13 @@ | |||
| <Label styleClass="ersteller-label" text="Ersteller: "/> | |||
| <Label styleClass="ersteller-label" text="Erstelldatum:" GridPane.rowIndex="1"/> | |||
| <Label styleClass="ersteller-label" text="Letzte Änderung:" GridPane.rowIndex="3"/> | |||
| <Label styleClass="ersteller-value" fx:id="diagCreator" text="lorem" GridPane.columnIndex="1"/> | |||
| <Label styleClass="ersteller-value" fx:id="diagCreateTime" text="ipsum" GridPane.columnIndex="1" | |||
| <Label styleClass="ersteller-value" fx:id="diagCreator" text="" GridPane.columnIndex="1"/> | |||
| <Label styleClass="ersteller-value" fx:id="diagCreateTime" text="" GridPane.columnIndex="1" | |||
| GridPane.rowIndex="1"/> | |||
| <Label styleClass="ersteller-value" fx:id="diagChanger" text="dolor" GridPane.columnIndex="1" | |||
| <Label styleClass="ersteller-value" fx:id="diagChanger" text="" GridPane.columnIndex="1" | |||
| GridPane.rowIndex="2"/> | |||
| <Label styleClass="ersteller-value" fx:id="diagChangeTime" text="amet" GridPane.columnIndex="1" | |||
| <Label styleClass="ersteller-value" fx:id="diagChangeTime" text=" | |||
| " GridPane.columnIndex="1" | |||
| GridPane.rowIndex="3"/> | |||
| </children> | |||
| <columnConstraints> | |||