|
|
|
@@ -3,10 +3,12 @@ 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.Fall; |
|
|
|
import de.uniluebeck.mi.projmi6.model.FallArt; |
|
|
|
import de.uniluebeck.mi.projmi6.model.Kasse; |
|
|
|
import de.uniluebeck.mi.projmi6.view.DateTimePicker; |
|
|
|
import javafx.beans.property.SimpleObjectProperty; |
|
|
|
import javafx.collections.FXCollections; |
|
|
|
import javafx.event.ActionEvent; |
|
|
|
import javafx.fxml.FXML; |
|
|
|
@@ -42,13 +44,17 @@ public class FallController { |
|
|
|
|
|
|
|
@FXML |
|
|
|
private TextField fallEinweisenderArzt; |
|
|
|
|
|
|
|
@FXML |
|
|
|
private CheckBox fallSelbsteinweisung; |
|
|
|
|
|
|
|
|
|
|
|
@FXML |
|
|
|
private Label fallCreator; |
|
|
|
private ComboBox<Diagnose> fallHauptdiagnose; |
|
|
|
|
|
|
|
|
|
|
|
@FXML |
|
|
|
private Label fallCreator; |
|
|
|
@FXML |
|
|
|
private Label fallEditor; |
|
|
|
@FXML |
|
|
|
private Label fallCreateTime; |
|
|
|
@@ -68,36 +74,73 @@ public class FallController { |
|
|
|
private GridPane fallFields; |
|
|
|
|
|
|
|
|
|
|
|
private SimpleObjectProperty<Fall> fallProperty = new SimpleObjectProperty<>(); |
|
|
|
|
|
|
|
public Fall getFallProperty() { |
|
|
|
return fallProperty.get(); |
|
|
|
} |
|
|
|
|
|
|
|
public SimpleObjectProperty<Fall> fallPropertyProperty() { |
|
|
|
return fallProperty; |
|
|
|
} |
|
|
|
|
|
|
|
public void setFallProperty(Fall fallProperty) { |
|
|
|
this.fallProperty.set(fallProperty); |
|
|
|
} |
|
|
|
|
|
|
|
public enum State { |
|
|
|
CREATE, EDIT, VIEW |
|
|
|
} |
|
|
|
|
|
|
|
SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW); |
|
|
|
|
|
|
|
|
|
|
|
@FXML |
|
|
|
public void initialize(){ |
|
|
|
fallEinweisenderArzt.disableProperty().bind(fallSelbsteinweisung.selectedProperty()); |
|
|
|
fallFallart.setItems(FXCollections.observableArrayList(FallArt.values())); |
|
|
|
fallKasse.setItems(mainController.getKassen()); |
|
|
|
} |
|
|
|
|
|
|
|
@FXML |
|
|
|
void clickedFallAufnNow(ActionEvent event) { |
|
|
|
btnFallEnableEdit.visibleProperty().bind( |
|
|
|
state.isEqualTo(State.VIEW).and(fallProperty.isNotNull()) |
|
|
|
); |
|
|
|
btnFallAbort.visibleProperty().bind( |
|
|
|
state.isNotEqualTo(State.VIEW) |
|
|
|
); |
|
|
|
btnFallSave.visibleProperty().bind( |
|
|
|
state.isEqualTo(State.VIEW) |
|
|
|
); |
|
|
|
|
|
|
|
btnFallCancel.visibleProperty().bind( |
|
|
|
state.isEqualTo(State.VIEW).and(fallProperty.isNotNull()) |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
fallFields.disableProperty().bind(state.isEqualTo(State.VIEW)); |
|
|
|
|
|
|
|
fallProperty.addListener(((observable, oldValue, newValue) -> { |
|
|
|
if(state.get() == State.VIEW){ |
|
|
|
copyFallDataIntoField(fallProperty.get()); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
@FXML |
|
|
|
void clickedFallEntlNow(ActionEvent event) { |
|
|
|
|
|
|
|
|
|
|
|
public void editFall(){ |
|
|
|
this.state.set(State.EDIT); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@FXML |
|
|
|
void clickedFallEnableEdit(ActionEvent event) { |
|
|
|
|
|
|
|
editFall(); |
|
|
|
} |
|
|
|
|
|
|
|
@FXML |
|
|
|
void clickedFallCancel(ActionEvent event) { |
|
|
|
|
|
|
|
this.state.set(State.VIEW); |
|
|
|
copyFallDataIntoField(fallProperty.get()); |
|
|
|
} |
|
|
|
|
|
|
|
@FXML |
|
|
|
@@ -112,20 +155,10 @@ public class FallController { |
|
|
|
|
|
|
|
public void createNewFall() { |
|
|
|
clearFields(); |
|
|
|
|
|
|
|
setEditable(true); |
|
|
|
|
|
|
|
|
|
|
|
btnFallSave.setVisible(true); |
|
|
|
btnFallAbort.setVisible(true); |
|
|
|
btnFallCancel.setVisible(false); |
|
|
|
btnFallEnableEdit.setVisible(false); |
|
|
|
this.state.set(State.CREATE); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void setEditable(boolean editable){ |
|
|
|
fallFields.setDisable(!editable); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void clearFields(){ |
|
|
|
@@ -145,13 +178,56 @@ public class FallController { |
|
|
|
fallVersichertennummer.setText(""); |
|
|
|
fallKasse.setValue(null); |
|
|
|
|
|
|
|
fallHauptdiagnose.setValue(null); |
|
|
|
fallHauptdiagnose.setItems(null); |
|
|
|
|
|
|
|
fallFallart.setValue(null); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void copyFieldDataIntoFall(Fall fall){ |
|
|
|
if(fall==null){ |
|
|
|
clearFields(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
fall.setAufnahmeDatum(dtTmAufnahme.getDateTime()); |
|
|
|
fall.setEntlassungsDatum(dtTmEntlassung.getDateTime()); |
|
|
|
if(fallSelbsteinweisung.isSelected()) { |
|
|
|
fall.setSelbsteinweisung(true); |
|
|
|
fall.setEinweisenderArzt(null); |
|
|
|
}else{ |
|
|
|
// fall.setEinweisenderArzt(fallEinweisenderArzt.getText()); TODO |
|
|
|
fall.setSelbsteinweisung(false); |
|
|
|
} |
|
|
|
fall.setVersichertenNummer(fallVersichertennummer.getText()); |
|
|
|
fall.setKasse(fallKasse.getValue()); |
|
|
|
fall.setFallArt(fallFallart.getValue()); |
|
|
|
|
|
|
|
//fall.setVorstellDatum(); //TODO |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void copyFallDataIntoField(Fall fall){ |
|
|
|
dtTmAufnahme.setDateTime(fall.getAufnahmeDatum()); |
|
|
|
dtTmEntlassung.setDateTime(fall.getEntlassungsDatum()); |
|
|
|
|
|
|
|
//fallPatID.setText(fall.getPatient().getVorname()+" "+fall.getPatient().getNachname()); //TODO |
|
|
|
|
|
|
|
fallCreateTime.setText(fall.getErstellDatumZeit().toString()); |
|
|
|
fallCreator.setText(Integer.toString(fall.getErsteller())); |
|
|
|
fallEditTime.setText(fall.getBearbeitetDatumZeit().toString()); |
|
|
|
fallEditor.setText(Integer.toString(fall.getBearbeiter())); |
|
|
|
|
|
|
|
// fallEinweisenderArzt.setText(fall.getEinweisenderArzt()); |
|
|
|
fallSelbsteinweisung.setSelected(fall.getSelbsteinweisung()); |
|
|
|
|
|
|
|
fallVersichertennummer.setText(fall.getVersichertenNummer()); |
|
|
|
fallKasse.setValue(fall.getKasse()); |
|
|
|
|
|
|
|
//fallHauptdiagnose.setValue(fall.getHauptDiagnose()); TODO |
|
|
|
// fallHauptdiagnose.setItems(fall.getD); TODO |
|
|
|
|
|
|
|
//fallFallart.setValue(fall.getFallArt()); |
|
|
|
} |
|
|
|
} |