| @@ -5,6 +5,7 @@ import javafx.application.Application; | |||
| import javafx.fxml.FXMLLoader; | |||
| import javafx.scene.Parent; | |||
| import javafx.scene.Scene; | |||
| import javafx.scene.image.Image; | |||
| import javafx.stage.Stage; | |||
| public class Main extends Application { | |||
| @@ -19,7 +20,7 @@ public class Main extends Application { | |||
| MainController mainController = new MainController(); | |||
| fxmlLoader.setControllerFactory(mainController.getControllerFactory()); | |||
| primaryStage.getIcons().add(new Image("icon.png")); | |||
| Parent root = fxmlLoader.load(); | |||
| primaryStage.setTitle("KIS Gruppe 06"); | |||
| @@ -21,6 +21,11 @@ public class FallController { | |||
| } | |||
| @FXML | |||
| public void initialize(){ | |||
| fallEinweisenderArzt.disableProperty().bind(fallSelbsteinweisung.selectedProperty()); | |||
| } | |||
| @FXML | |||
| private Button btnFallAufnNow; | |||
| @FXML | |||
| @@ -2,9 +2,7 @@ package de.uniluebeck.mi.projmi6.controller; | |||
| import de.uniluebeck.mi.projmi6.model.Mitarbeiter; | |||
| import javafx.fxml.FXML; | |||
| import javafx.scene.control.Button; | |||
| import javafx.scene.control.ChoiceBox; | |||
| import javafx.scene.control.ProgressIndicator; | |||
| import javafx.scene.control.*; | |||
| import javafx.util.Callback; | |||
| import java.util.Set; | |||
| @@ -27,6 +25,8 @@ public class MainController { | |||
| private ProgressIndicator progressIndicator; | |||
| @FXML | |||
| private Button btnFallCreate; | |||
| @FXML | |||
| private SplitPane fallOverview; | |||
| private Callback<Class<?>, Object> controllerFactory = clazz -> { | |||
| if(clazz.equals(MainController.class)) { | |||
| @@ -66,6 +66,8 @@ public class MainController { | |||
| } | |||
| public Callback<Class<?>, Object> getControllerFactory(){ | |||
| return controllerFactory; | |||
| } | |||
| @@ -114,8 +116,8 @@ public class MainController { | |||
| @FXML | |||
| private void init(){ | |||
| private void initialize(){ | |||
| fallOverview.disableProperty().bind(patientTablesController.selectedPatientProperty().isNull()); | |||
| } | |||
| @@ -5,6 +5,10 @@ package de.uniluebeck.mi.projmi6.controller; | |||
| */ | |||
| import de.uniluebeck.mi.projmi6.model.Patient; | |||
| import javafx.beans.binding.Bindings; | |||
| import javafx.beans.binding.ObjectBinding; | |||
| import javafx.beans.property.ObjectProperty; | |||
| import javafx.beans.property.ReadOnlyObjectProperty; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| import javafx.collections.FXCollections; | |||
| import javafx.collections.ObservableList; | |||
| import javafx.fxml.FXML; | |||
| @@ -13,6 +17,8 @@ import javafx.scene.Parent; | |||
| import javafx.scene.Scene; | |||
| import javafx.scene.control.*; | |||
| import javafx.scene.control.cell.PropertyValueFactory; | |||
| import javafx.scene.image.Image; | |||
| import javafx.stage.Modality; | |||
| import javafx.stage.Stage; | |||
| import java.io.IOException; | |||
| @@ -26,6 +32,85 @@ public class PatientTablesController{ | |||
| private MainController mainController; | |||
| @FXML | |||
| private Label lblTablePatientEmpty; | |||
| @FXML | |||
| private Label lblTableStationEmpty; | |||
| @FXML | |||
| private Button btnPatCreate; | |||
| @FXML | |||
| private Button btnPatEdit; | |||
| @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; | |||
| @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 ComboBox<?> cmbStationenFilter; | |||
| @FXML | |||
| private TableView<?> tblStationOverview; | |||
| @FXML | |||
| private TableColumn<?, ?> colStatPatId; | |||
| @FXML | |||
| private TableColumn<?,?> colStatFullName; | |||
| @FXML | |||
| private TableColumn<?, ?> colStatGebDatum; | |||
| @FXML | |||
| private TableColumn<?, ?> colStatAlter; | |||
| @FXML | |||
| private TableColumn<?, ?> colStatAufnahmedatum; | |||
| @FXML | |||
| private TableColumn<?, ?> colStatEntlassungsdatum; | |||
| @FXML | |||
| private Tab stationOverviewTab, patientOverviewTab; | |||
| @FXML | |||
| private TabPane patientOverviewTabPane; | |||
| public PatientTablesController(MainController mainController){ | |||
| this.mainController = mainController; | |||
| } | |||
| @@ -44,6 +129,9 @@ public class PatientTablesController{ | |||
| }); | |||
| return tableRow; | |||
| }); | |||
| lblTablePatientEmpty.setText("Liste ist leer."); | |||
| lblTableStationEmpty.setText("Daten werden geladen..."); | |||
| ObservableList<Patient> patientList = FXCollections.<Patient>observableArrayList(); | |||
| @@ -65,7 +153,6 @@ public class PatientTablesController{ | |||
| initColumns(); | |||
| } | |||
| private void initColumns(){ | |||
| colPatPatId.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().patIDProperty().asString()); | |||
| colPatGeburtsname.setCellValueFactory(new PropertyValueFactory<>("geburtsname")); | |||
| @@ -81,6 +168,7 @@ public class PatientTablesController{ | |||
| colPatCave.setCellValueFactory(new PropertyValueFactory<>("cave")); | |||
| } | |||
| @FXML | |||
| private void clickedCreatePatient (){ | |||
| showEditWindow(null); | |||
| @@ -92,7 +180,6 @@ public class PatientTablesController{ | |||
| showEditWindow(tblPatientOverview.getSelectionModel().getSelectedItem()); | |||
| } | |||
| private void showEditWindow(Patient patient){ | |||
| FXMLLoader fxmlLoader = new FXMLLoader(); | |||
| fxmlLoader.setLocation(getClass().getClassLoader().getResource("patient_edit.fxml")); | |||
| @@ -109,75 +196,29 @@ public class PatientTablesController{ | |||
| stage.setTitle(patient==null ? "Neuen Patienten erstellen": "Patient bearbeiten"); | |||
| stage.setScene(new Scene(root, 600, 600)); | |||
| stage.getIcons().add(new Image("icon.png")); | |||
| stage.initModality(Modality.WINDOW_MODAL); | |||
| stage.initOwner(btnPatEdit.getScene().getWindow()); | |||
| PatientEditorController patientEditorController = (PatientEditorController)fxmlLoader.getController(); | |||
| patientEditorController.setPatient(patient); | |||
| stage.show(); | |||
| } | |||
| @FXML | |||
| private Button btnPatCreate; | |||
| @FXML | |||
| private Button btnPatEdit; | |||
| @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; | |||
| @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 ComboBox<?> cmbStationenFilter; | |||
| @FXML | |||
| private TableView<?> tblStationOverview; | |||
| @FXML | |||
| private TableColumn<?, ?> colStatPatId; | |||
| @FXML | |||
| private TableColumn<?,?> colStatFullName; | |||
| @FXML | |||
| private TableColumn<?, ?> colStatGebDatum; | |||
| @FXML | |||
| private TableColumn<?, ?> colStatAlter; | |||
| public ObjectBinding<Patient> selectedPatientProperty(){ | |||
| @FXML | |||
| private TableColumn<?, ?> colStatAufnahmedatum; | |||
| return Bindings.<Patient>createObjectBinding(() ->{ | |||
| return patientOverviewTabPane.getSelectionModel().getSelectedItem().equals(patientOverviewTab) | |||
| ? tblPatientOverview.getSelectionModel().getSelectedItem() | |||
| : (Patient)tblStationOverview.getSelectionModel().getSelectedItem(); //TODO | |||
| }, tblPatientOverview.getSelectionModel().selectedItemProperty(), | |||
| tblStationOverview.getSelectionModel().selectedItemProperty(), | |||
| patientOverviewTabPane.getSelectionModel().selectedItemProperty()); | |||
| } | |||
| @FXML | |||
| private TableColumn<?, ?> colStatEntlassungsdatum; | |||
| public Patient getSelectedPatient(){ | |||
| return selectedPatientProperty().get(); | |||
| } | |||
| } | |||
| @@ -1,16 +1,47 @@ | |||
| package de.uniluebeck.mi.projmi6.controller; | |||
| import javafx.fxml.FXML; | |||
| import javafx.scene.control.Button; | |||
| import javafx.scene.control.Label; | |||
| import javafx.scene.control.TableColumn; | |||
| import javafx.scene.control.TableView; | |||
| /** | |||
| * Created by 631806 on 12.11.15. | |||
| */ | |||
| public class StationsHistorieController { | |||
| private MainController mainController; | |||
| @FXML | |||
| private TableView<?>tblStationsHistorie; | |||
| @FXML | |||
| private Button btnStatHistCancel, btnStatHistSave; | |||
| @FXML | |||
| private Label statHistCreator, statHistCreatTime, statHistEditor, statHistEditTime; | |||
| @FXML | |||
| private TableColumn<?,?> colStatHistAbteilung, colStatHistStation, colStatHistAufnahmeDatum, colStatHistEntlassungsDatum; | |||
| public StationsHistorieController(MainController mainController){ | |||
| this.mainController = mainController; | |||
| } | |||
| @FXML | |||
| private void clickedCancel(){ | |||
| } | |||
| @FXML | |||
| private void clickedSave(){ | |||
| } | |||
| @FXML | |||
| private void clickedCreateAufenthalt(){ | |||
| } | |||
| } | |||
| @@ -66,10 +66,10 @@ | |||
| <Label fx:id="diagChanger" text="dolor" GridPane.columnIndex="1" GridPane.rowIndex="2" /> | |||
| <Label fx:id="diagChangeTime" text="amet" GridPane.columnIndex="1" GridPane.rowIndex="3" /> | |||
| </children> | |||
| <columnConstraints> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" /> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" /> | |||
| </columnConstraints> | |||
| <columnConstraints> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="50.0" /> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="50.0" /> | |||
| </columnConstraints> | |||
| <rowConstraints> | |||
| <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |||
| <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |||
| @@ -24,8 +24,7 @@ | |||
| <Insets/> | |||
| </GridPane.margin> | |||
| </HBox> | |||
| <Label text="Entlassungsdatum:" GridPane.rowIndex="2"/> | |||
| <HBox prefHeight="100.0" prefWidth="200.0" spacing="5.0" GridPane.columnIndex="1" 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"/> | |||
| @@ -17,7 +17,7 @@ | |||
| <SplitPane dividerPositions="0.5" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" orientation="VERTICAL" VBox.vgrow="ALWAYS"> | |||
| <items> | |||
| <fx:include source="patient_tables.fxml" /> | |||
| <SplitPane dividerPositions="0.2981007431874484" prefHeight="160.0" prefWidth="200.0"> | |||
| <SplitPane dividerPositions="0.2981007431874484" prefHeight="160.0" prefWidth="200.0" fx:id="fallOverview"> | |||
| <items> | |||
| <VBox prefHeight="200.0" prefWidth="100.0"> | |||
| <children> | |||
| @@ -6,9 +6,9 @@ | |||
| <?import javafx.scene.control.*?> | |||
| <?import javafx.scene.layout.*?> | |||
| <TabPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.uniluebeck.mi.projmi6.controller.PatientTablesController"> | |||
| <TabPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.uniluebeck.mi.projmi6.controller.PatientTablesController" fx:id="patientOverviewTabPane"> | |||
| <tabs> | |||
| <Tab closable="false" text="Patientenübersicht"> | |||
| <Tab closable="false" text="Patientenübersicht" fx:id="patientOverviewTab"> | |||
| <content> | |||
| <VBox prefHeight="200.0" prefWidth="100.0"> | |||
| <children> | |||
| @@ -19,6 +19,9 @@ | |||
| </items> | |||
| </ToolBar> | |||
| <TableView fx:id="tblPatientOverview" editable="true" tableMenuButtonVisible="true" VBox.vgrow="ALWAYS"> | |||
| <placeholder> | |||
| <Label fx:id="lblTablePatientEmpty" /> | |||
| </placeholder> | |||
| <columns> | |||
| <TableColumn fx:id="colPatPatId" editable="false" prefWidth="75.0" sortable="false" text="PatID" /> | |||
| <TableColumn prefWidth="75.0" text="Name"> | |||
| @@ -46,7 +49,7 @@ | |||
| </VBox> | |||
| </content> | |||
| </Tab> | |||
| <Tab closable="false" text="Stationsübersicht"> | |||
| <Tab closable="false" text="Stationsübersicht" fx:id="stationOverviewTab"> | |||
| <content> | |||
| <VBox prefHeight="200.0" prefWidth="100.0"> | |||
| <children> | |||
| @@ -60,6 +63,9 @@ | |||
| <SplitPane prefHeight="160.0" prefWidth="200.0" VBox.vgrow="ALWAYS"> | |||
| <items> | |||
| <TableView fx:id="tblStationOverview" prefHeight="200.0" prefWidth="200.0" tableMenuButtonVisible="true"> | |||
| <placeholder> | |||
| <Label fx:id="lblTableStationEmpty" /> | |||
| </placeholder> | |||
| <columns> | |||
| <TableColumn fx:id="colStatPatId" prefWidth="75.0" text="PatID" /> | |||
| <TableColumn fx:id="colStatFullName" prefWidth="135.0" text="Nachname, Vorname" /> | |||
| @@ -14,15 +14,15 @@ | |||
| <children> | |||
| <ToolBar prefHeight="40.0" prefWidth="200.0"> | |||
| <items> | |||
| <Button mnemonicParsing="false" text="Neuen Aufenthalt erstellen"/> | |||
| <Button mnemonicParsing="false" text="Neuen Aufenthalt erstellen" onAction="#clickedCreateAufenthalt"/> | |||
| </items> | |||
| </ToolBar> | |||
| <TableView prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS"> | |||
| <TableView prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS" fx:id="tblStationsHistorie"> | |||
| <columns> | |||
| <TableColumn prefWidth="75.0" text="Abteilung"/> | |||
| <TableColumn prefWidth="75.0" text="Station"/> | |||
| <TableColumn prefWidth="75.0" text="Aufnahme"/> | |||
| <TableColumn prefWidth="75.0" text="Entlassung"/> | |||
| <TableColumn prefWidth="75.0" text="Abteilung" fx:id="colStatHistAbteilung"/> | |||
| <TableColumn prefWidth="75.0" text="Station" fx:id="colStatHistStation"/> | |||
| <TableColumn prefWidth="75.0" text="Aufnahme" fx:id="colStatHistAufnahmeDatum"/> | |||
| <TableColumn prefWidth="75.0" text="Entlassung" fx:id="colStatHistEntlassungsDatum"/> | |||
| </columns> | |||
| </TableView> | |||
| </children> | |||
| @@ -56,7 +56,7 @@ | |||
| GridPane.rowIndex="3"> | |||
| <children> | |||
| <DatePicker/> | |||
| <TextField alignment="CENTER" prefColumnCount="10" promptText="HH:MM"/> | |||
| <TextField prefColumnCount="10" promptText="HH:MM"/> | |||
| <Button mnemonicParsing="false" text="Jetzt"/> | |||
| </children> | |||
| </HBox> | |||
| @@ -66,20 +66,20 @@ | |||
| </GridPane> | |||
| <HBox alignment="CENTER_RIGHT"> | |||
| <children> | |||
| <Button mnemonicParsing="false" text="Speichern"/> | |||
| <Button disable="true" mnemonicParsing="false" text="Eintrag entfernen"/> | |||
| <Button mnemonicParsing="false" text="Speichern" onAction="#clickedSave" fx:id="btnStatHistSave"/> | |||
| <Button disable="true" mnemonicParsing="false" text="Eintrag entfernen" fx:id="btnStatHistCancel" onAction="#clickedCancel"/> | |||
| </children> | |||
| </HBox> | |||
| <GridPane> | |||
| <children> | |||
| <Label styleClass="ersteller-label" text="Letzter Bearbeiter:"/> | |||
| <Label styleClass="ersteller-label" text="Ersteller: " GridPane.rowIndex="1"/> | |||
| <Label styleClass="ersteller-label" text="Erstelldatum:" GridPane.rowIndex="2"/> | |||
| <Label styleClass="ersteller-label" text="Ersteller: " GridPane.rowIndex="0"/> | |||
| <Label styleClass="ersteller-label" text="Erstelldatum:" GridPane.rowIndex="1"/> | |||
| <Label styleClass="ersteller-label" text="Letzter Bearbeiter:" GridPane.rowIndex="2"/> | |||
| <Label styleClass="ersteller-label" text="Letzte Änderung:" GridPane.rowIndex="3"/> | |||
| <Label GridPane.columnIndex="1"/> | |||
| <Label GridPane.columnIndex="1" GridPane.rowIndex="1"/> | |||
| <Label GridPane.columnIndex="1" GridPane.rowIndex="2"/> | |||
| <Label GridPane.columnIndex="1" GridPane.rowIndex="3"/> | |||
| <Label GridPane.columnIndex="1" GridPane.rowIndex="0" fx:id="statHistCreator" text="a"/> | |||
| <Label GridPane.columnIndex="1" GridPane.rowIndex="1" fx:id="statHistCreateTime" text="b"/> | |||
| <Label GridPane.columnIndex="1" GridPane.rowIndex="2" fx:id="statHistEditor" text="c"/> | |||
| <Label GridPane.columnIndex="1" GridPane.rowIndex="3" fx:id="statHistEditTime" text="d"/> | |||
| </children> | |||
| <columnConstraints> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="50.0"/> | |||