瀏覽代碼

MessageIcon Basics

FallController überarbeitet
Patientenliste in den Stammdaten - Achtung kann auch null sein!
testBranch
Johannes 10 年之前
父節點
當前提交
86b1954166
共有 4 個檔案被更改,包括 124 行新增30 行删除
  1. +70
    -27
      src/main/java/de/uniluebeck/mi/projmi6/controller/FallController.java
  2. +4
    -3
      src/main/java/de/uniluebeck/mi/projmi6/controller/PatientTablesController.java
  3. +16
    -0
      src/main/java/de/uniluebeck/mi/projmi6/model/Stammdaten.java
  4. +34
    -0
      src/main/java/de/uniluebeck/mi/projmi6/view/MessageIcon.java

+ 70
- 27
src/main/java/de/uniluebeck/mi/projmi6/controller/FallController.java 查看文件

@@ -14,33 +14,48 @@ import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.*;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;


import java.sql.SQLException; import java.sql.SQLException;


public class FallController { public class FallController {


SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW);
@FXML
Button btnFallSendHl7;
private MainController mainController; private MainController mainController;

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

@FXML @FXML
private DateTimePicker dtTmAufnahme, dtTmEntlassung; private DateTimePicker dtTmAufnahme, dtTmEntlassung;

@FXML @FXML
private Label fallPatID; private Label fallPatID;

@FXML @FXML
private ComboBox<FallArt> fallFallart; private ComboBox<FallArt> fallFallart;

@FXML @FXML
private ComboBox<Kasse> fallKasse; private ComboBox<Kasse> fallKasse;

@FXML @FXML
private TextField fallVersichertennummer; private TextField fallVersichertennummer;

@FXML @FXML
private TextField fallEinweisenderArzt; private TextField fallEinweisenderArzt;
@FXML @FXML
private CheckBox fallSelbsteinweisung; private CheckBox fallSelbsteinweisung;


@FXML @FXML
private ComboBox<Diagnose> fallHauptdiagnose; private ComboBox<Diagnose> fallHauptdiagnose;


@FXML @FXML
private Label fallCreator; private Label fallCreator;
@FXML @FXML
@@ -51,30 +66,34 @@ public class FallController {
private Label fallEditTime; private Label fallEditTime;
@FXML @FXML
private Button btnFallSave; private Button btnFallSave;

@FXML @FXML
private Button btnFallAbort; private Button btnFallAbort;
@FXML @FXML
private Button btnFallCancel; private Button btnFallCancel;
@FXML @FXML
private Button btnFallEnableEdit; private Button btnFallEnableEdit;

@FXML @FXML
private GridPane fallFields; private GridPane fallFields;
private SimpleObjectProperty<Fall> fallProperty = new SimpleObjectProperty<>();


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

private SimpleObjectProperty<Fall> fallProperty = new SimpleObjectProperty<>();


public Fall getFall() { public Fall getFall() {
return fallProperty.get(); return fallProperty.get();
} }


public SimpleObjectProperty<Fall> fallPropertyProperty() {
return fallProperty;
}

public void setFall(Fall fall) { public void setFall(Fall fall) {
this.fallProperty.set(fall); this.fallProperty.set(fall);
} }


public SimpleObjectProperty<Fall> fallPropertyProperty() {
return fallProperty;
public enum State {
CREATE, EDIT, VIEW
} }


public State getState() { public State getState() {
@@ -85,6 +104,12 @@ public class FallController {
return state; return state;
} }




SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW);



public ObjectProperty<ObservableList<Diagnose>> diagnosenProperty(){ public ObjectProperty<ObservableList<Diagnose>> diagnosenProperty(){
return fallHauptdiagnose.itemsProperty(); return fallHauptdiagnose.itemsProperty();
} }
@@ -115,6 +140,10 @@ public class FallController {
} }
})); }));


fallHauptdiagnose.itemsProperty().addListener((observable1, oldValue1, newValue1) -> {
copyHauptdiagnoseToComboBox(fallProperty.get());
});



state.addListener((observable, oldValue, newValue) -> { state.addListener((observable, oldValue, newValue) -> {
if(newValue==State.EDIT || newValue == State.CREATE){ if(newValue==State.EDIT || newValue == State.CREATE){
@@ -155,6 +184,9 @@ public class FallController {
} }


@FXML @FXML
Button btnFallSendHl7;

@FXML
private void clickedSendHl7(){ private void clickedSendHl7(){
/* Natascha */ /* Natascha */
//TODO send funny message //TODO send funny message
@@ -166,6 +198,7 @@ public class FallController {
this.state.set(State.EDIT); this.state.set(State.EDIT);
} }



@FXML @FXML
void clickedFallEnableEdit(ActionEvent event) { void clickedFallEnableEdit(ActionEvent event) {
editFall(); editFall();
@@ -173,11 +206,11 @@ public class FallController {


@FXML @FXML
void clickedFallCancel(ActionEvent event) { void clickedFallCancel(ActionEvent event) {
if (fallProperty.get() != null) {
if(fallProperty.get()!=null){
fallProperty.get().setStorniert(true); fallProperty.get().setStorniert(true);
try { try {
DBHandler.setFall(fallProperty.get(), mainController.getCurrentMitarbeiter().getMitarbID(), true); DBHandler.setFall(fallProperty.get(), mainController.getCurrentMitarbeiter().getMitarbID(), true);
} catch (Exception e) {
}catch (Exception e){
e.printStackTrace(); e.printStackTrace();
} }
mainController.refreshCasesFromDb(mainController.getPatientTablesController().getSelectedPatient()); mainController.refreshCasesFromDb(mainController.getPatientTablesController().getSelectedPatient());
@@ -230,6 +263,9 @@ public class FallController {
fallVersichertennummer.setText(patient.getVersichertennummer()); fallVersichertennummer.setText(patient.getVersichertennummer());
} }





private void clearFields(){ private void clearFields(){
if(state.get() == State.CREATE) { if(state.get() == State.CREATE) {
dtTmAufnahme.setToCurrentDateTime(); dtTmAufnahme.setToCurrentDateTime();
@@ -258,6 +294,7 @@ public class FallController {
fallFallart.setValue(null); fallFallart.setValue(null);
} }



private void copyFieldDataIntoFall(Fall fall){ private void copyFieldDataIntoFall(Fall fall){
fall.setPatient(mainController.getPatientTablesController().getSelectedPatient()); fall.setPatient(mainController.getPatientTablesController().getSelectedPatient());
fall.setAufnahmeDatum(dtTmAufnahme.getDateTime()); fall.setAufnahmeDatum(dtTmAufnahme.getDateTime());
@@ -282,6 +319,7 @@ public class FallController {
//fall.setVorstellDatum(); //TODO //fall.setVorstellDatum(); //TODO
} }



private void copyFallDataIntoField(Fall fall){ private void copyFallDataIntoField(Fall fall){
if(fall==null){ if(fall==null){
System.out.println("copyFallDataIntoFiled - Fall ist null"); System.out.println("copyFallDataIntoFiled - Fall ist null");
@@ -305,24 +343,29 @@ public class FallController {
fallVersichertennummer.setText(fall.getVersichertenNummer()); fallVersichertennummer.setText(fall.getVersichertenNummer());
fallKasse.setValue(fall.getKasse()); fallKasse.setValue(fall.getKasse());


if (fallHauptdiagnose.getItems() != null) {
for (Diagnose diagnose : fallHauptdiagnose.getItems()) {
if (diagnose.getDiagID() == fall.getHauptdiagnoseId()) {
fallHauptdiagnose.setValue(diagnose);
return;
}
}
}


//fallHauptdiagnose.setValue(fall.getHauptDiagnose()); TODO
// fallHauptdiagnose.setItems(fall.getD); TODO


copyHauptdiagnoseToComboBox(fall);
fallFallart.setValue(fall.getFallArt()); fallFallart.setValue(fall.getFallArt());
} }



public enum State {
CREATE, EDIT, VIEW
private void copyHauptdiagnoseToComboBox(Fall fall){
if (fallHauptdiagnose.getItems() == null
|| fall == null) {
fallHauptdiagnose.setValue(null);
return;
}
System.out.println("Suche Diagnose...");

for (Diagnose diagnose : fallHauptdiagnose.getItems()) {
System.out.println(diagnose.getDiagID()+"="+fall.getHauptdiagnoseId());
if (diagnose.getDiagID() == fall.getHauptdiagnoseId()) {
fallHauptdiagnose.getSelectionModel().select(diagnose);
System.out.println("Diagnose wiedergefunden!!");
return;
}
}
} }



} }

+ 4
- 3
src/main/java/de/uniluebeck/mi/projmi6/controller/PatientTablesController.java 查看文件

@@ -120,6 +120,8 @@ public class PatientTablesController {
}); });
return tableRow; return tableRow;
}); });

tblPatientOverview.itemsProperty().bind(mainController.getStammdaten().patientenProperty());
lblTablePatientEmpty.setText("Liste ist leer."); lblTablePatientEmpty.setText("Liste ist leer.");
tblStationOverview.disableProperty().bind(cmbStationenFilter.valueProperty().isNull()); tblStationOverview.disableProperty().bind(cmbStationenFilter.valueProperty().isNull());


@@ -229,7 +231,7 @@ public class PatientTablesController {


btnPatRefresh.setDisable(true); btnPatRefresh.setDisable(true);


tblPatientOverview.setItems(null);
mainController.getStammdaten().setPatienten(null);


mainController.increaseParallelTaskCount(); mainController.increaseParallelTaskCount();


@@ -247,7 +249,7 @@ public class PatientTablesController {
super.succeeded(); super.succeeded();
btnPatRefresh.setDisable(false); btnPatRefresh.setDisable(false);
lblTablePatientEmpty.setText("Liste ist leer."); lblTablePatientEmpty.setText("Liste ist leer.");
tblPatientOverview.setItems(FXCollections.observableArrayList(this.getValue()));
mainController.getStammdaten().setPatienten(FXCollections.observableArrayList(this.getValue()));
mainController.decreaseParallelTaskCount(); mainController.decreaseParallelTaskCount();
} }


@@ -257,7 +259,6 @@ public class PatientTablesController {
btnPatRefresh.setDisable(false); btnPatRefresh.setDisable(false);
lblTablePatientEmpty.setText("Laden fehlgeschlagen!"); lblTablePatientEmpty.setText("Laden fehlgeschlagen!");
mainController.decreaseParallelTaskCount(); mainController.decreaseParallelTaskCount();
tblPatientOverview.setItems(null);
if (getException() != null) { if (getException() != null) {
getException().printStackTrace(); getException().printStackTrace();
} }


+ 16
- 0
src/main/java/de/uniluebeck/mi/projmi6/model/Stammdaten.java 查看文件

@@ -14,6 +14,22 @@ public class Stammdaten {
private SimpleObjectProperty<ObservableList<Kasse>> kassen = new SimpleObjectProperty<>(); private SimpleObjectProperty<ObservableList<Kasse>> kassen = new SimpleObjectProperty<>();
private SimpleObjectProperty<ObservableList<Station>> stationen = new SimpleObjectProperty<>(); private SimpleObjectProperty<ObservableList<Station>> stationen = new SimpleObjectProperty<>();


public ObservableList<Patient> getPatienten() {
return patienten.get();
}

public SimpleObjectProperty<ObservableList<Patient>> patientenProperty() {
return patienten;
}

public void setPatienten(ObservableList<Patient> patienten) {
this.patienten.set(patienten);
}

private SimpleObjectProperty<ObservableList<Patient>> patienten = new SimpleObjectProperty<>();



public ObservableList<OpsCode> getOpsCodes() { public ObservableList<OpsCode> getOpsCodes() {
return opsCodes.get(); return opsCodes.get();
} }


+ 34
- 0
src/main/java/de/uniluebeck/mi/projmi6/view/MessageIcon.java 查看文件

@@ -0,0 +1,34 @@
package de.uniluebeck.mi.projmi6.view;

import javafx.beans.property.SimpleIntegerProperty;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.StackPane;

/**
* Created by Johannes on 21/11/2015.
*/
public class MessageIcon extends Button {

private ImageView imageView;

private Label messageCountLabel;

private final SimpleIntegerProperty messageCount = new SimpleIntegerProperty(this, "messageCount", 0);

public MessageIcon(){
imageView = new ImageView(new Image(""));
messageCountLabel = new Label();


StackPane graphic = new StackPane(imageView, messageCountLabel);
this.setGraphic(graphic);
}





}

Loading…
取消
儲存