|
|
|
@@ -14,33 +14,48 @@ import javafx.collections.FXCollections; |
|
|
|
import javafx.collections.ObservableList; |
|
|
|
import javafx.event.ActionEvent; |
|
|
|
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 java.sql.SQLException; |
|
|
|
|
|
|
|
public class FallController { |
|
|
|
|
|
|
|
SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW); |
|
|
|
@FXML |
|
|
|
Button btnFallSendHl7; |
|
|
|
private MainController mainController; |
|
|
|
|
|
|
|
public FallController (MainController mainController){ |
|
|
|
this.mainController = mainController; |
|
|
|
} |
|
|
|
|
|
|
|
@FXML |
|
|
|
private DateTimePicker dtTmAufnahme, dtTmEntlassung; |
|
|
|
|
|
|
|
@FXML |
|
|
|
private Label fallPatID; |
|
|
|
|
|
|
|
@FXML |
|
|
|
private ComboBox<FallArt> fallFallart; |
|
|
|
|
|
|
|
@FXML |
|
|
|
private ComboBox<Kasse> fallKasse; |
|
|
|
|
|
|
|
@FXML |
|
|
|
private TextField fallVersichertennummer; |
|
|
|
|
|
|
|
@FXML |
|
|
|
private TextField fallEinweisenderArzt; |
|
|
|
@FXML |
|
|
|
private CheckBox fallSelbsteinweisung; |
|
|
|
|
|
|
|
|
|
|
|
@FXML |
|
|
|
private ComboBox<Diagnose> fallHauptdiagnose; |
|
|
|
|
|
|
|
|
|
|
|
@FXML |
|
|
|
private Label fallCreator; |
|
|
|
@FXML |
|
|
|
@@ -51,30 +66,34 @@ public class FallController { |
|
|
|
private Label fallEditTime; |
|
|
|
@FXML |
|
|
|
private Button btnFallSave; |
|
|
|
|
|
|
|
@FXML |
|
|
|
private Button btnFallAbort; |
|
|
|
@FXML |
|
|
|
private Button btnFallCancel; |
|
|
|
@FXML |
|
|
|
private Button btnFallEnableEdit; |
|
|
|
|
|
|
|
@FXML |
|
|
|
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() { |
|
|
|
return fallProperty.get(); |
|
|
|
} |
|
|
|
|
|
|
|
public SimpleObjectProperty<Fall> fallPropertyProperty() { |
|
|
|
return fallProperty; |
|
|
|
} |
|
|
|
|
|
|
|
public void setFall(Fall fall) { |
|
|
|
this.fallProperty.set(fall); |
|
|
|
} |
|
|
|
|
|
|
|
public SimpleObjectProperty<Fall> fallPropertyProperty() { |
|
|
|
return fallProperty; |
|
|
|
public enum State { |
|
|
|
CREATE, EDIT, VIEW |
|
|
|
} |
|
|
|
|
|
|
|
public State getState() { |
|
|
|
@@ -85,6 +104,12 @@ public class FallController { |
|
|
|
return state; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ObjectProperty<ObservableList<Diagnose>> diagnosenProperty(){ |
|
|
|
return fallHauptdiagnose.itemsProperty(); |
|
|
|
} |
|
|
|
@@ -115,6 +140,10 @@ public class FallController { |
|
|
|
} |
|
|
|
})); |
|
|
|
|
|
|
|
fallHauptdiagnose.itemsProperty().addListener((observable1, oldValue1, newValue1) -> { |
|
|
|
copyHauptdiagnoseToComboBox(fallProperty.get()); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
state.addListener((observable, oldValue, newValue) -> { |
|
|
|
if(newValue==State.EDIT || newValue == State.CREATE){ |
|
|
|
@@ -155,6 +184,9 @@ public class FallController { |
|
|
|
} |
|
|
|
|
|
|
|
@FXML |
|
|
|
Button btnFallSendHl7; |
|
|
|
|
|
|
|
@FXML |
|
|
|
private void clickedSendHl7(){ |
|
|
|
/* Natascha */ |
|
|
|
//TODO send funny message |
|
|
|
@@ -166,6 +198,7 @@ public class FallController { |
|
|
|
this.state.set(State.EDIT); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@FXML |
|
|
|
void clickedFallEnableEdit(ActionEvent event) { |
|
|
|
editFall(); |
|
|
|
@@ -173,11 +206,11 @@ public class FallController { |
|
|
|
|
|
|
|
@FXML |
|
|
|
void clickedFallCancel(ActionEvent event) { |
|
|
|
if (fallProperty.get() != null) { |
|
|
|
if(fallProperty.get()!=null){ |
|
|
|
fallProperty.get().setStorniert(true); |
|
|
|
try { |
|
|
|
DBHandler.setFall(fallProperty.get(), mainController.getCurrentMitarbeiter().getMitarbID(), true); |
|
|
|
} catch (Exception e) { |
|
|
|
}catch (Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
mainController.refreshCasesFromDb(mainController.getPatientTablesController().getSelectedPatient()); |
|
|
|
@@ -230,6 +263,9 @@ public class FallController { |
|
|
|
fallVersichertennummer.setText(patient.getVersichertennummer()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void clearFields(){ |
|
|
|
if(state.get() == State.CREATE) { |
|
|
|
dtTmAufnahme.setToCurrentDateTime(); |
|
|
|
@@ -258,6 +294,7 @@ public class FallController { |
|
|
|
fallFallart.setValue(null); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void copyFieldDataIntoFall(Fall fall){ |
|
|
|
fall.setPatient(mainController.getPatientTablesController().getSelectedPatient()); |
|
|
|
fall.setAufnahmeDatum(dtTmAufnahme.getDateTime()); |
|
|
|
@@ -282,6 +319,7 @@ public class FallController { |
|
|
|
//fall.setVorstellDatum(); //TODO |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void copyFallDataIntoField(Fall fall){ |
|
|
|
if(fall==null){ |
|
|
|
System.out.println("copyFallDataIntoFiled - Fall ist null"); |
|
|
|
@@ -305,24 +343,29 @@ public class FallController { |
|
|
|
fallVersichertennummer.setText(fall.getVersichertenNummer()); |
|
|
|
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()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |