|
|
|
@@ -4,7 +4,9 @@ package de.uniluebeck.mi.projmi6.controller; |
|
|
|
* Created by 631806 on 12.11.15. |
|
|
|
*/ |
|
|
|
|
|
|
|
import ca.uhn.hl7v2.HL7Exception; |
|
|
|
import de.uniluebeck.mi.projmi6.db.DBHandler; |
|
|
|
import de.uniluebeck.mi.projmi6.hapi.HL7Sender; |
|
|
|
import de.uniluebeck.mi.projmi6.model.*; |
|
|
|
import de.uniluebeck.mi.projmi6.view.DateTimePicker; |
|
|
|
import javafx.beans.property.ObjectProperty; |
|
|
|
@@ -14,48 +16,34 @@ import javafx.collections.FXCollections; |
|
|
|
import javafx.collections.ObservableList; |
|
|
|
import javafx.event.ActionEvent; |
|
|
|
import javafx.fxml.FXML; |
|
|
|
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.control.*; |
|
|
|
import javafx.scene.layout.GridPane; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
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 |
|
|
|
@@ -66,34 +54,30 @@ 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 Fall getFall() { |
|
|
|
return fallProperty.get(); |
|
|
|
public FallController(MainController mainController) { |
|
|
|
this.mainController = mainController; |
|
|
|
} |
|
|
|
|
|
|
|
public SimpleObjectProperty<Fall> fallPropertyProperty() { |
|
|
|
return fallProperty; |
|
|
|
public Fall getFall() { |
|
|
|
return fallProperty.get(); |
|
|
|
} |
|
|
|
|
|
|
|
public void setFall(Fall fall) { |
|
|
|
this.fallProperty.set(fall); |
|
|
|
} |
|
|
|
|
|
|
|
public enum State { |
|
|
|
CREATE, EDIT, VIEW |
|
|
|
public SimpleObjectProperty<Fall> fallPropertyProperty() { |
|
|
|
return fallProperty; |
|
|
|
} |
|
|
|
|
|
|
|
public State getState() { |
|
|
|
@@ -104,12 +88,6 @@ public class FallController { |
|
|
|
return state; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ObjectProperty<ObservableList<Diagnose>> diagnosenProperty(){ |
|
|
|
return fallHauptdiagnose.itemsProperty(); |
|
|
|
} |
|
|
|
@@ -184,21 +162,24 @@ public class FallController { |
|
|
|
} |
|
|
|
|
|
|
|
@FXML |
|
|
|
Button btnFallSendHl7; |
|
|
|
|
|
|
|
@FXML |
|
|
|
private void clickedSendHl7(){ |
|
|
|
/* Natascha */ |
|
|
|
//TODO send funny message |
|
|
|
Fall fall = fallProperty.get(); |
|
|
|
Patient patient = mainController.getPatientTablesController().getSelectedPatient(); |
|
|
|
Fall fall = fallProperty.get(); |
|
|
|
fall.setPatient(patient); |
|
|
|
|
|
|
|
try { |
|
|
|
HL7Sender.createMessageADT_A01(fall); |
|
|
|
} catch (HL7Exception | IOException | SQLException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void editFall(){ |
|
|
|
this.state.set(State.EDIT); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@FXML |
|
|
|
void clickedFallEnableEdit(ActionEvent event) { |
|
|
|
editFall(); |
|
|
|
@@ -206,11 +187,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()); |
|
|
|
@@ -263,9 +244,6 @@ public class FallController { |
|
|
|
fallVersichertennummer.setText(patient.getVersichertennummer()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void clearFields(){ |
|
|
|
if(state.get() == State.CREATE) { |
|
|
|
dtTmAufnahme.setToCurrentDateTime(); |
|
|
|
@@ -294,7 +272,6 @@ public class FallController { |
|
|
|
fallFallart.setValue(null); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void copyFieldDataIntoFall(Fall fall){ |
|
|
|
fall.setPatient(mainController.getPatientTablesController().getSelectedPatient()); |
|
|
|
fall.setAufnahmeDatum(dtTmAufnahme.getDateTime()); |
|
|
|
@@ -319,7 +296,6 @@ public class FallController { |
|
|
|
//fall.setVorstellDatum(); //TODO |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void copyFallDataIntoField(Fall fall){ |
|
|
|
if(fall==null){ |
|
|
|
System.out.println("copyFallDataIntoFiled - Fall ist null"); |
|
|
|
@@ -366,6 +342,10 @@ public class FallController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public enum State { |
|
|
|
CREATE, EDIT, VIEW |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |