Просмотр исходного кода

Beginn der Arbeit an den Patiententabelle

hapi
Johannes 10 лет назад
Родитель
Сommit
7e780f35f9
12 измененных файлов: 334 добавлений и 77 удалений
  1. +12
    -0
      pom.xml
  2. +1
    -1
      src/main/java/de/uniluebeck/mi/projmi6/Main.java
  3. +11
    -3
      src/main/java/de/uniluebeck/mi/projmi6/controller/DiagnoseController.java
  4. +6
    -0
      src/main/java/de/uniluebeck/mi/projmi6/controller/FallController.java
  5. +64
    -42
      src/main/java/de/uniluebeck/mi/projmi6/controller/MainController.java
  6. +81
    -3
      src/main/java/de/uniluebeck/mi/projmi6/controller/PatientEditorController.java
  7. +130
    -25
      src/main/java/de/uniluebeck/mi/projmi6/controller/PatientTablesController.java
  8. +8
    -0
      src/main/java/de/uniluebeck/mi/projmi6/controller/SettingsController.java
  9. +9
    -0
      src/main/java/de/uniluebeck/mi/projmi6/controller/StationsHistorieController.java
  10. +9
    -0
      src/main/java/de/uniluebeck/mi/projmi6/controller/UntersuchungenController.java
  11. +1
    -1
      src/main/resources/main.fxml
  12. +2
    -2
      src/main/resources/patient_tables.fxml

+ 12
- 0
pom.xml Просмотреть файл

@@ -7,6 +7,18 @@
<groupId>de.uni-luebeck.mi.projmi6</groupId>
<artifactId>projmi6</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>


</project>

+ 1
- 1
src/main/java/de/uniluebeck/mi/projmi6/Main.java Просмотреть файл

@@ -23,7 +23,7 @@ public class Main extends Application {
Parent root = fxmlLoader.load();

primaryStage.setTitle("KIS Gruppe 06");
primaryStage.setScene(new Scene(root, 800, 600));
primaryStage.setScene(new Scene(root, 1000, 800));
primaryStage.show();
}



+ 11
- 3
src/main/java/de/uniluebeck/mi/projmi6/controller/DiagnoseController.java Просмотреть файл

@@ -4,6 +4,8 @@ package de.uniluebeck.mi.projmi6.controller;
* Created by 631806 on 12.11.15.
*/

import de.uniluebeck.mi.projmi6.model.Diagnose;
import de.uniluebeck.mi.projmi6.model.Mitarbeiter;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
@@ -14,8 +16,14 @@ import javafx.scene.control.TextArea;

public class DiagnoseController {

private MainController mainController;

public DiagnoseController(MainController mainController){
this.mainController = mainController;
}

@FXML
private ComboBox<?> diagDiagnoseArzt;
private ComboBox<Mitarbeiter> diagDiagnoseArzt;

@FXML
private Label diagCreator;
@@ -33,13 +41,13 @@ public class DiagnoseController {
private Label diagCreateTime;

@FXML
private ComboBox<?> diagDiagnoseArt;
private ComboBox<Mitarbeiter> diagDiagnoseArt;

@FXML
private Label diagChanger;

@FXML
private ComboBox<?> diagDiagnose;
private ComboBox<Diagnose> diagDiagnose;

@FXML
private Label diagChangeTime;


+ 6
- 0
src/main/java/de/uniluebeck/mi/projmi6/controller/FallController.java Просмотреть файл

@@ -14,6 +14,12 @@ import javafx.scene.control.TextField;

public class FallController {

private MainController mainController;

public FallController (MainController mainController){
this.mainController = mainController;
}

@FXML
private Button btnFallAufnNow;



+ 64
- 42
src/main/java/de/uniluebeck/mi/projmi6/controller/MainController.java Просмотреть файл

@@ -1,5 +1,6 @@
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;
@@ -12,50 +13,63 @@ public class MainController {

private FallController fallController;
private DiagnoseController diagnoseController;
private PatientEditorController patientEditorController;
//private PatientEditorController patientEditorController;
private PatientTablesController patientTablesController;
private SettingsController settingsController;
private UntersuchungenController untersuchungenController;
private StationsHistorieController stationsHistorieController;
private UntersuchungenController untersuchungenController;

private int parallelTaskCount = 0;

@FXML
private ChoiceBox<Mitarbeiter> cmbUserChoose;
@FXML
private ProgressIndicator progressIndicator;
@FXML
private Button btnFallCreate;

private Callback<Class<?>, Object> controllerFactory = clazz -> {
if(clazz.equals(MainController.class)) {
return this;
}else if(clazz.equals(FallController.class)){
return fallController;
}else if(clazz.equals(DiagnoseController.class)){
return diagnoseController;
//}else if(clazz.equals(PatientEditorController.class)) {
// return patientEditorController;
}else if(clazz.equals(PatientTablesController.class)){
return patientTablesController;
}else if(clazz.equals(SettingsController.class)){
return settingsController;
} else if(clazz.equals(UntersuchungenController.class)) {
return untersuchungenController;
}else if(clazz.equals(StationsHistorieController.class)){
return stationsHistorieController;
}else {
System.err.println("Keine Controller-Klasse des Typs "+clazz+" gefunden!!!");
return null;
}

};




public MainController(){
fallController = new FallController();
diagnoseController = new DiagnoseController();
patientEditorController = new PatientEditorController();
patientTablesController = new PatientTablesController();
settingsController = new SettingsController();
untersuchungenController = new UntersuchungenController();
stationsHistorieController = new StationsHistorieController();
fallController = new FallController(this);
diagnoseController = new DiagnoseController(this);
//patientEditorController = new PatientEditorController(this);
patientTablesController = new PatientTablesController(this);
settingsController = new SettingsController(this);
untersuchungenController = new UntersuchungenController(this);
stationsHistorieController = new StationsHistorieController(this);
}


public Callback<Class<?>, Object> getControllerFactory(){
return clazz -> {
if(clazz.equals(MainController.class)) {
return this;
}else if(clazz.equals(FallController.class)){
return fallController;
}else if(clazz.equals(DiagnoseController.class)){
return diagnoseController;
}else if(clazz.equals(PatientEditorController.class)) {
return patientEditorController;
}else if(clazz.equals(PatientTablesController.class)){
return patientTablesController;
}else if(clazz.equals(SettingsController.class)){
return settingsController;
} else if(clazz.equals(UntersuchungenController.class)) {
return untersuchungenController;
}else if(clazz.equals(StationsHistorieController.class)){
return stationsHistorieController;
}else {
System.err.println("Keine Controller-Klasse des Typs "+clazz+" gefunden!!!");
return null;
}

};
return controllerFactory;
}


public FallController getFallController(){
return fallController;
}
@@ -64,9 +78,9 @@ public class MainController {
return diagnoseController;
}

public PatientEditorController getPatientEditorController(){
return patientEditorController;
}
// public PatientEditorController getPatientEditorController(){
// return patientEditorController;
// }

public PatientTablesController getPatientTablesController(){
return patientTablesController;
@@ -80,15 +94,23 @@ public class MainController {
return untersuchungenController;
}

public void increaseParallelTaskCount(){
parallelTaskCount++;
if(parallelTaskCount>0){
progressIndicator.setVisible(true);
}
}

@FXML
private ChoiceBox<?> cmbUserChoose;

@FXML
private ProgressIndicator progressIndicator;
public void decreaseParallelTaskCount(){
parallelTaskCount++;
if(parallelTaskCount<=0){
parallelTaskCount = 0;
progressIndicator.setVisible(false);
}
}


@FXML
private Button btnFallCreate;


@FXML


+ 81
- 3
src/main/java/de/uniluebeck/mi/projmi6/controller/PatientEditorController.java Просмотреть файл

@@ -3,6 +3,8 @@ package de.uniluebeck.mi.projmi6.controller;
/**
* Created by 631806 on 12.11.15.
*/
import de.uniluebeck.mi.projmi6.model.Patient;
import javafx.collections.FXCollections;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
@@ -11,9 +13,85 @@ import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.event.ActionEvent;
import javafx.scene.control.TextField;
import javafx.stage.Stage;

public class PatientEditorController {

// private MainController mainController;

private Patient patient = null;

// public PatientEditorController(MainController mainController){
// this.mainController = mainController;
// }


@FXML
public void initialize(){
patGeschlecht.setItems(FXCollections.observableArrayList(Patient.Geschlecht.values()));
patFamilienstand.setItems(FXCollections.observableArrayList(Patient.Familienstand.values()));

}


public void setPatient(Patient patient){
this.patient = patient;
if(patient==null){
clearFields();
}else {
copyPatientDataIntoFields();
}

}


private void copyPatientDataIntoFields(){
patId.setText(Integer.toString(patient.getPatID()));
patGeburtsname.setText(patient.getGeburtsname());
patNachname.setText(patient.getNachname());
patVorname.setText(patient.getVorname());
patStrasse.setText(patient.getStrasse());
patHausnummer.setText(patient.getHausnummer());
patPlz.setText(patient.getPlz());
patOrt.setText(patient.getOrt());
patGeburtsdatum.setValue(patient.getGeburtsdatum());
patFamilienstand.setValue(patient.getFamilienstand());
patGeschlecht.setValue(patient.getGeschlecht());
patVersicherungsnummer.setText(patient.getVersichertennummer());
// patVersicherung.setValue(patient.getVersicherung()); TODO
patCave.setText(patient.getCave());

patCreator.setText(patient.getErsteller());
patCreateTime.setText(patient.getErstellDatumZeit());
patChanger.setText(patient.getBearbeiter());
patChangeTime.setText(patient.getBearbeitetDatumZeit());
}

private void clearFields(){
patId.setText("<auto>");
patGeburtsname.setText("");
patNachname.setText("");
patVorname.setText("");
patStrasse.setText("");
patHausnummer.setText("");
patPlz.setText("");
patOrt.setText("");
patGeburtsdatum.setValue(null);
patFamilienstand.setValue(null);
patGeschlecht.setValue(null);
patVersicherungsnummer.setText("");
patVersicherung.setValue(null);
patCave.setText("");

patCreator.setText("todo");
patCreateTime.setText("<auto>");
patChanger.setText("todo");
patChangeTime.setText("<auto>");
}




@FXML
private Label patChangeTime;

@@ -45,7 +123,7 @@ public class PatientEditorController {
private TextField patPlz;

@FXML
private ComboBox<?> patFamilienstand;
private ComboBox<Patient.Familienstand> patFamilienstand;

@FXML
private TextField patStrasse;
@@ -57,7 +135,7 @@ public class PatientEditorController {
private TextArea patCave;

@FXML
private ComboBox<?> patGeschlecht;
private ComboBox<Patient.Geschlecht> patGeschlecht;

@FXML
private Label patCreator;
@@ -81,7 +159,7 @@ public class PatientEditorController {

@FXML
void clickedAbort(ActionEvent event) {
((Stage)patVorname.getScene().getWindow()).close(); //Close Window
}

}

+ 130
- 25
src/main/java/de/uniluebeck/mi/projmi6/controller/PatientTablesController.java Просмотреть файл

@@ -1,78 +1,183 @@
package de.uniluebeck.mi.projmi6.controller;

/**
* Created by 631806 on 12.11.15.
* Created by Johannes on 12.11.15.
*/
import de.uniluebeck.mi.projmi6.model.Patient;
import javafx.beans.binding.Bindings;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.ToggleButton;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.stage.Stage;

import java.io.IOException;
import java.rmi.server.ExportException;
import java.time.LocalDate;

/**
* Controller class.
*/
public class PatientTablesController{

private MainController mainController;

public PatientTablesController(MainController mainController){
this.mainController = mainController;
}


@FXML
public void initialize() {
btnPatEdit.disableProperty().bind(tblPatientOverview.getSelectionModel().selectedItemProperty().isNull());
tblPatientOverview.setRowFactory(tableView -> {
TableRow<Patient> tableRow = new TableRow<>();
tableRow.setOnMouseClicked(event -> {
if(event.getClickCount()==2 && (!tableRow.isEmpty())){
Patient patient = tableRow.getItem();
showEditWindow(patient);
}
});
return tableRow;
});

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

Patient patient = new Patient();
patient.setPatID(1337);
patient.setNachname("Mustermann");
patient.setVorname("Max");
patient.setGeburtsdatum(LocalDate.of(1990, 12, 12));
patient.setStrasse("Beckergrube");
patient.setHausnummer("20");
patient.setPlz("23552");
patient.setOrt("Luebeck");
patient.setCave("voellig langweilig");

patientList.add(patient);

tblPatientOverview.setItems(patientList);

initColumns();
}


private void initColumns(){
colPatPatId.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().patIDProperty().asString());
colPatGeburtsname.setCellValueFactory(new PropertyValueFactory<>("geburtsname"));
colPatNachname.setCellValueFactory(new PropertyValueFactory<>("nachname"));
colPatVorname.setCellValueFactory(new PropertyValueFactory<>("vorname"));
colPatGebDatum.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().geburtsdatumProperty());
colPatStrasse.setCellValueFactory(cellDataFeatures -> {
Patient patient = cellDataFeatures.getValue();
return Bindings.concat(patient.strasseProperty(), " ", patient.hausnummerProperty());
});
colPatPlz.setCellValueFactory(new PropertyValueFactory<>("plz"));
colPatOrt.setCellValueFactory(new PropertyValueFactory<>("ort"));
colPatCave.setCellValueFactory(new PropertyValueFactory<>("cave"));
}

@FXML
private void clickedCreatePatient (){
showEditWindow(null);
}


@FXML
private void clickedEditPatient(){
showEditWindow(tblPatientOverview.getSelectionModel().getSelectedItem());
}


private void showEditWindow(Patient patient){
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getClassLoader().getResource("patient_edit.fxml"));

Parent root = null;
try{
root = fxmlLoader.load();
}catch (IOException e){
e.printStackTrace();
}

Stage stage = new Stage();

stage.setTitle(patient==null ? "Neuen Patienten erstellen": "Patient bearbeiten");
stage.setScene(new Scene(root, 600, 600));

PatientEditorController patientEditorController = (PatientEditorController)fxmlLoader.getController();
patientEditorController.setPatient(patient);
stage.show();
}

@FXML
private Button btnPatCreate;

@FXML
private TableView<?> tblPatientOverview;
private Button btnPatEdit;

@FXML
private TableColumn<?, ?> colStatEntlassungsdatum;
private TableView<Patient> tblPatientOverview;

@FXML
private TableColumn<?, ?> colPatOrt;
private TableColumn<Patient, String> colPatPatId;

@FXML
private ComboBox<?> cmbStationenFilter;
private TableColumn<Patient, String> colPatGeburtsname;

@FXML
private TableColumn<?, ?> colStatFullName;
private TableColumn<Patient, String> colPatNachname;

@FXML
private TableColumn<?, ?> colStatAlter;
private TableColumn<Patient, String> colPatVorname;

@FXML
private TableColumn<?, ?> colPatGebDatum;
private TableColumn<Patient, LocalDate> colPatGebDatum;

@FXML
private TableColumn<?, ?> colStatAufnahmedatum;
private TableColumn<Patient, String> colPatStrasse;

@FXML
private Button btnPatEdit;
private TableColumn<Patient, String> colPatPlz;

@FXML
private TableColumn<?, ?> colPatNachname;
private TableColumn<Patient, String> colPatOrt;

@FXML
private TableColumn<?, ?> colPatGeburtsname;
private TableColumn<Patient, String> colPatCave;




@FXML
private TableColumn<?, ?> colPatStrasse;
private ToggleButton btnEntlassenePatientenZeigen;

@FXML
private TableColumn<?, ?> colPatPlz;
private ComboBox<?> cmbStationenFilter;

@FXML
private TableColumn<?, ?> colPatPatId;
private TableView<?> tblStationOverview;

@FXML
private TableColumn<?, ?> colPatVorname;
private TableColumn<?, ?> colStatPatId;

@FXML
private ToggleButton btnEntlassenePatientenZeigen;
private TableColumn<?,?> colStatFullName;

@FXML
private TableColumn<?, ?> colStatGebDatum;

@FXML
private TableColumn<?, ?> colPatCave;
private TableColumn<?, ?> colStatAlter;

@FXML
private TableView<?> tblStationOverview;
private TableColumn<?, ?> colStatAufnahmedatum;

@FXML
private TableColumn<?, ?> colStatPatId;
private TableColumn<?, ?> colStatEntlassungsdatum;

}

+ 8
- 0
src/main/java/de/uniluebeck/mi/projmi6/controller/SettingsController.java Просмотреть файл

@@ -10,6 +10,14 @@ import javafx.scene.control.TextField;

public class SettingsController {

private MainController mainController;

public SettingsController (MainController mainController){
this.mainController = mainController;
}



@FXML
private Button opsServerSave;



+ 9
- 0
src/main/java/de/uniluebeck/mi/projmi6/controller/StationsHistorieController.java Просмотреть файл

@@ -4,4 +4,13 @@ package de.uniluebeck.mi.projmi6.controller;
* Created by 631806 on 12.11.15.
*/
public class StationsHistorieController {
private MainController mainController;


public StationsHistorieController(MainController mainController){
this.mainController = mainController;
}



}

+ 9
- 0
src/main/java/de/uniluebeck/mi/projmi6/controller/UntersuchungenController.java Просмотреть файл

@@ -4,12 +4,21 @@ package de.uniluebeck.mi.projmi6.controller;
* Created by 626947 on 12.11.15.
*/

import de.uniluebeck.mi.projmi6.Main;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.*;

public class UntersuchungenController {


private MainController mainController;


public UntersuchungenController (MainController mainController){
this.mainController = mainController;
}

@FXML
private Button btnUntsCancel;



+ 1
- 1
src/main/resources/main.fxml Просмотреть файл

@@ -77,7 +77,7 @@
<Label text="Mitarbeiter wählen:" />
<ChoiceBox fx:id="cmbUserChoose" prefWidth="150.0" />
<Pane HBox.hgrow="ALWAYS" />
<ProgressIndicator fx:id="progressIndicator" pickOnBounds="false" prefHeight="35.0" prefWidth="35.0" />
<ProgressIndicator fx:id="progressIndicator" visible="false" pickOnBounds="false" prefHeight="35.0" prefWidth="35.0" />
</items>
</ToolBar>
</children>


+ 2
- 2
src/main/resources/patient_tables.fxml Просмотреть файл

@@ -14,8 +14,8 @@
<children>
<ToolBar prefHeight="40.0" prefWidth="200.0">
<items>
<Button fx:id="btnPatCreate" text="Neuen _Patient erstellen" />
<Button fx:id="btnPatEdit" text="Patient _bearbeiten" />
<Button fx:id="btnPatCreate" text="Neuen _Patient erstellen" onAction="#clickedCreatePatient" />
<Button fx:id="btnPatEdit" text="Patient _bearbeiten" onAction="#clickedEditPatient"/>
</items>
</ToolBar>
<TableView fx:id="tblPatientOverview" editable="true" tableMenuButtonVisible="true" VBox.vgrow="ALWAYS">


Загрузка…
Отмена
Сохранить