Browse Source

Variablenname Stationshistorie; Icon; Binding an Patiententabelle Basics

hapi
Johannes 10 years ago
parent
commit
56ee690dca
11 changed files with 181 additions and 96 deletions
  1. +2
    -1
      src/main/java/de/uniluebeck/mi/projmi6/Main.java
  2. +5
    -0
      src/main/java/de/uniluebeck/mi/projmi6/controller/FallController.java
  3. +7
    -5
      src/main/java/de/uniluebeck/mi/projmi6/controller/MainController.java
  4. +105
    -64
      src/main/java/de/uniluebeck/mi/projmi6/controller/PatientTablesController.java
  5. +31
    -0
      src/main/java/de/uniluebeck/mi/projmi6/controller/StationsHistorieController.java
  6. +4
    -4
      src/main/resources/diagnose.fxml
  7. +1
    -2
      src/main/resources/fall.fxml
  8. BIN
      src/main/resources/icon.png
  9. +1
    -1
      src/main/resources/main.fxml
  10. +9
    -3
      src/main/resources/patient_tables.fxml
  11. +16
    -16
      src/main/resources/stationshistorie.fxml

+ 2
- 1
src/main/java/de/uniluebeck/mi/projmi6/Main.java View File

@@ -5,6 +5,7 @@ import javafx.application.Application;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.scene.Parent; import javafx.scene.Parent;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage; import javafx.stage.Stage;


public class Main extends Application { public class Main extends Application {
@@ -19,7 +20,7 @@ public class Main extends Application {
MainController mainController = new MainController(); MainController mainController = new MainController();
fxmlLoader.setControllerFactory(mainController.getControllerFactory()); fxmlLoader.setControllerFactory(mainController.getControllerFactory());


primaryStage.getIcons().add(new Image("icon.png"));
Parent root = fxmlLoader.load(); Parent root = fxmlLoader.load();


primaryStage.setTitle("KIS Gruppe 06"); primaryStage.setTitle("KIS Gruppe 06");


+ 5
- 0
src/main/java/de/uniluebeck/mi/projmi6/controller/FallController.java View File

@@ -21,6 +21,11 @@ public class FallController {
} }


@FXML @FXML
public void initialize(){
fallEinweisenderArzt.disableProperty().bind(fallSelbsteinweisung.selectedProperty());
}

@FXML
private Button btnFallAufnNow; private Button btnFallAufnNow;


@FXML @FXML


+ 7
- 5
src/main/java/de/uniluebeck/mi/projmi6/controller/MainController.java View File

@@ -2,9 +2,7 @@ package de.uniluebeck.mi.projmi6.controller;


import de.uniluebeck.mi.projmi6.model.Mitarbeiter; import de.uniluebeck.mi.projmi6.model.Mitarbeiter;
import javafx.fxml.FXML; 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 javafx.util.Callback;


import java.util.Set; import java.util.Set;
@@ -27,6 +25,8 @@ public class MainController {
private ProgressIndicator progressIndicator; private ProgressIndicator progressIndicator;
@FXML @FXML
private Button btnFallCreate; private Button btnFallCreate;
@FXML
private SplitPane fallOverview;


private Callback<Class<?>, Object> controllerFactory = clazz -> { private Callback<Class<?>, Object> controllerFactory = clazz -> {
if(clazz.equals(MainController.class)) { if(clazz.equals(MainController.class)) {
@@ -66,6 +66,8 @@ public class MainController {
} }






public Callback<Class<?>, Object> getControllerFactory(){ public Callback<Class<?>, Object> getControllerFactory(){
return controllerFactory; return controllerFactory;
} }
@@ -114,8 +116,8 @@ public class MainController {




@FXML @FXML
private void init(){
private void initialize(){
fallOverview.disableProperty().bind(patientTablesController.selectedPatientProperty().isNull());


} }




+ 105
- 64
src/main/java/de/uniluebeck/mi/projmi6/controller/PatientTablesController.java View File

@@ -5,6 +5,10 @@ package de.uniluebeck.mi.projmi6.controller;
*/ */
import de.uniluebeck.mi.projmi6.model.Patient; import de.uniluebeck.mi.projmi6.model.Patient;
import javafx.beans.binding.Bindings; 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.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
import javafx.fxml.FXML; import javafx.fxml.FXML;
@@ -13,6 +17,8 @@ import javafx.scene.Parent;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.control.*; import javafx.scene.control.*;
import javafx.scene.control.cell.PropertyValueFactory; import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.image.Image;
import javafx.stage.Modality;
import javafx.stage.Stage; import javafx.stage.Stage;


import java.io.IOException; import java.io.IOException;
@@ -26,6 +32,85 @@ public class PatientTablesController{


private MainController mainController; 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){ public PatientTablesController(MainController mainController){
this.mainController = mainController; this.mainController = mainController;
} }
@@ -44,6 +129,9 @@ public class PatientTablesController{
}); });
return tableRow; return tableRow;
}); });
lblTablePatientEmpty.setText("Liste ist leer.");
lblTableStationEmpty.setText("Daten werden geladen...");



ObservableList<Patient> patientList = FXCollections.<Patient>observableArrayList(); ObservableList<Patient> patientList = FXCollections.<Patient>observableArrayList();


@@ -65,7 +153,6 @@ public class PatientTablesController{
initColumns(); initColumns();
} }



private void initColumns(){ private void initColumns(){
colPatPatId.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().patIDProperty().asString()); colPatPatId.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().patIDProperty().asString());
colPatGeburtsname.setCellValueFactory(new PropertyValueFactory<>("geburtsname")); colPatGeburtsname.setCellValueFactory(new PropertyValueFactory<>("geburtsname"));
@@ -81,6 +168,7 @@ public class PatientTablesController{
colPatCave.setCellValueFactory(new PropertyValueFactory<>("cave")); colPatCave.setCellValueFactory(new PropertyValueFactory<>("cave"));
} }



@FXML @FXML
private void clickedCreatePatient (){ private void clickedCreatePatient (){
showEditWindow(null); showEditWindow(null);
@@ -92,7 +180,6 @@ public class PatientTablesController{
showEditWindow(tblPatientOverview.getSelectionModel().getSelectedItem()); showEditWindow(tblPatientOverview.getSelectionModel().getSelectedItem());
} }



private void showEditWindow(Patient patient){ private void showEditWindow(Patient patient){
FXMLLoader fxmlLoader = new FXMLLoader(); FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getClassLoader().getResource("patient_edit.fxml")); 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.setTitle(patient==null ? "Neuen Patienten erstellen": "Patient bearbeiten");
stage.setScene(new Scene(root, 600, 600)); 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 patientEditorController = (PatientEditorController)fxmlLoader.getController();
patientEditorController.setPatient(patient); patientEditorController.setPatient(patient);
stage.show(); 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();
}


} }

+ 31
- 0
src/main/java/de/uniluebeck/mi/projmi6/controller/StationsHistorieController.java View File

@@ -1,16 +1,47 @@
package de.uniluebeck.mi.projmi6.controller; 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. * Created by 631806 on 12.11.15.
*/ */
public class StationsHistorieController { public class StationsHistorieController {
private MainController mainController; 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){ public StationsHistorieController(MainController mainController){
this.mainController = mainController; this.mainController = mainController;
} }


@FXML
private void clickedCancel(){

}

@FXML
private void clickedSave(){

}

@FXML
private void clickedCreateAufenthalt(){

}




} }

+ 4
- 4
src/main/resources/diagnose.fxml View File

@@ -66,10 +66,10 @@
<Label fx:id="diagChanger" text="dolor" GridPane.columnIndex="1" GridPane.rowIndex="2" /> <Label fx:id="diagChanger" text="dolor" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label fx:id="diagChangeTime" text="amet" GridPane.columnIndex="1" GridPane.rowIndex="3" /> <Label fx:id="diagChangeTime" text="amet" GridPane.columnIndex="1" GridPane.rowIndex="3" />
</children> </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>
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> <RowConstraints minHeight="10.0" vgrow="SOMETIMES" />


+ 1
- 2
src/main/resources/fall.fxml View File

@@ -24,8 +24,7 @@
<Insets/> <Insets/>
</GridPane.margin> </GridPane.margin>
</HBox> </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> <children>
<DatePicker fx:id="fallEntlDate"/> <DatePicker fx:id="fallEntlDate"/>
<TextField fx:id="fallEntlTime" prefColumnCount="5" promptText="HH:MM"/> <TextField fx:id="fallEntlTime" prefColumnCount="5" promptText="HH:MM"/>


BIN
src/main/resources/icon.png View File

Before After
Width: 200  |  Height: 240  |  Size: 27 KiB

+ 1
- 1
src/main/resources/main.fxml View File

@@ -17,7 +17,7 @@
<SplitPane dividerPositions="0.5" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" orientation="VERTICAL" VBox.vgrow="ALWAYS"> <SplitPane dividerPositions="0.5" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" orientation="VERTICAL" VBox.vgrow="ALWAYS">
<items> <items>
<fx:include source="patient_tables.fxml" /> <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> <items>
<VBox prefHeight="200.0" prefWidth="100.0"> <VBox prefHeight="200.0" prefWidth="100.0">
<children> <children>


+ 9
- 3
src/main/resources/patient_tables.fxml View File

@@ -6,9 +6,9 @@
<?import javafx.scene.control.*?> <?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?> <?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> <tabs>
<Tab closable="false" text="Patientenübersicht">
<Tab closable="false" text="Patientenübersicht" fx:id="patientOverviewTab">
<content> <content>
<VBox prefHeight="200.0" prefWidth="100.0"> <VBox prefHeight="200.0" prefWidth="100.0">
<children> <children>
@@ -19,6 +19,9 @@
</items> </items>
</ToolBar> </ToolBar>
<TableView fx:id="tblPatientOverview" editable="true" tableMenuButtonVisible="true" VBox.vgrow="ALWAYS"> <TableView fx:id="tblPatientOverview" editable="true" tableMenuButtonVisible="true" VBox.vgrow="ALWAYS">
<placeholder>
<Label fx:id="lblTablePatientEmpty" />
</placeholder>
<columns> <columns>
<TableColumn fx:id="colPatPatId" editable="false" prefWidth="75.0" sortable="false" text="PatID" /> <TableColumn fx:id="colPatPatId" editable="false" prefWidth="75.0" sortable="false" text="PatID" />
<TableColumn prefWidth="75.0" text="Name"> <TableColumn prefWidth="75.0" text="Name">
@@ -46,7 +49,7 @@
</VBox> </VBox>
</content> </content>
</Tab> </Tab>
<Tab closable="false" text="Stationsübersicht">
<Tab closable="false" text="Stationsübersicht" fx:id="stationOverviewTab">
<content> <content>
<VBox prefHeight="200.0" prefWidth="100.0"> <VBox prefHeight="200.0" prefWidth="100.0">
<children> <children>
@@ -60,6 +63,9 @@
<SplitPane prefHeight="160.0" prefWidth="200.0" VBox.vgrow="ALWAYS"> <SplitPane prefHeight="160.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
<items> <items>
<TableView fx:id="tblStationOverview" prefHeight="200.0" prefWidth="200.0" tableMenuButtonVisible="true"> <TableView fx:id="tblStationOverview" prefHeight="200.0" prefWidth="200.0" tableMenuButtonVisible="true">
<placeholder>
<Label fx:id="lblTableStationEmpty" />
</placeholder>
<columns> <columns>
<TableColumn fx:id="colStatPatId" prefWidth="75.0" text="PatID" /> <TableColumn fx:id="colStatPatId" prefWidth="75.0" text="PatID" />
<TableColumn fx:id="colStatFullName" prefWidth="135.0" text="Nachname, Vorname" /> <TableColumn fx:id="colStatFullName" prefWidth="135.0" text="Nachname, Vorname" />


+ 16
- 16
src/main/resources/stationshistorie.fxml View File

@@ -14,15 +14,15 @@
<children> <children>
<ToolBar prefHeight="40.0" prefWidth="200.0"> <ToolBar prefHeight="40.0" prefWidth="200.0">
<items> <items>
<Button mnemonicParsing="false" text="Neuen Aufenthalt erstellen"/>
<Button mnemonicParsing="false" text="Neuen Aufenthalt erstellen" onAction="#clickedCreateAufenthalt"/>
</items> </items>
</ToolBar> </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> <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> </columns>
</TableView> </TableView>
</children> </children>
@@ -56,7 +56,7 @@
GridPane.rowIndex="3"> GridPane.rowIndex="3">
<children> <children>
<DatePicker/> <DatePicker/>
<TextField alignment="CENTER" prefColumnCount="10" promptText="HH:MM"/>
<TextField prefColumnCount="10" promptText="HH:MM"/>
<Button mnemonicParsing="false" text="Jetzt"/> <Button mnemonicParsing="false" text="Jetzt"/>
</children> </children>
</HBox> </HBox>
@@ -66,20 +66,20 @@
</GridPane> </GridPane>
<HBox alignment="CENTER_RIGHT"> <HBox alignment="CENTER_RIGHT">
<children> <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> </children>
</HBox> </HBox>
<GridPane> <GridPane>
<children> <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 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> </children>
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="50.0"/> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="50.0"/>


Loading…
Cancel
Save