| @@ -5,6 +5,8 @@ import ca.uhn.hl7v2.HL7Exception; | |||
| import ca.uhn.hl7v2.HapiContext; | |||
| import ca.uhn.hl7v2.model.DataTypeException; | |||
| import ca.uhn.hl7v2.model.Message; | |||
| import ca.uhn.hl7v2.model.v25.datatype.DTM; | |||
| import ca.uhn.hl7v2.model.v251.datatype.FN; | |||
| import ca.uhn.hl7v2.model.v251.message.ADT_A01; | |||
| import ca.uhn.hl7v2.model.v251.message.BAR_P05; | |||
| import ca.uhn.hl7v2.model.v251.segment.*; | |||
| @@ -115,6 +117,17 @@ public class HL7 { | |||
| Patient patient = new Patient(); | |||
| Fall fall = new Fall(); | |||
| EVN evnSegment = p05.getEVN (); | |||
| LocalDateTime ldt = generateLocalDateTimeFromHl7(p05); | |||
| patient.setBearbeitetDatumZeit(ldt); | |||
| //patient.setBearbeiter(evnSegment.getEvn5_OperatorID(0).getIDNumber()); | |||
| PID pidSegment = p05.getPID(); | |||
| patient.setPatID(Integer.valueOf(pidSegment.getPid3_PatientIdentifierList(0).getIDNumber().getValue()));//evt das 4. Segment | |||
| patient.setNachname(pidSegment.getPid5_PatientName(0).getFamilyName().getName()); | |||
| patient.setVorname(pidSegment.getPid5_PatientName(0).getGivenName().getValue()); | |||
| ca.uhn.hl7v2.model.v251.datatype.DTM geburtsTag = pidSegment.getPid7_DateTimeOfBirth().getTime(); | |||
| LocalDate ld = LocalDate.of(geburtsTag.getYear(),geburtsTag.getMonth(),geburtsTag.getDay()); | |||
| patient.setGeburtsdatum(ld); | |||
| // patient.setGeschlecht(pidSegment.getPid8_AdministrativeSex().getValue()); | |||
| @@ -133,6 +146,7 @@ public class HL7 { | |||
| LocalTime bearbeitetZeit = LocalTime.of(stunden,minuten,sekunden); | |||
| LocalDate bearbeitetDate = LocalDate.of(jahr, monat, tag); | |||
| LocalDateTime ldt = LocalDateTime.of(bearbeitetDate, bearbeitetZeit); | |||
| return ldt; | |||
| } | |||
| @@ -6,6 +6,7 @@ import de.uniluebeck.mi.projmi6.model.Kasse; | |||
| import de.uniluebeck.mi.projmi6.model.Mitarbeiter; | |||
| import de.uniluebeck.mi.projmi6.model.OpsCode; | |||
| import javafx.application.Application; | |||
| import javafx.beans.property.ReadOnlyStringProperty; | |||
| import javafx.collections.FXCollections; | |||
| import javafx.concurrent.Task; | |||
| import javafx.fxml.FXMLLoader; | |||
| @@ -13,6 +14,7 @@ import javafx.geometry.Insets; | |||
| import javafx.geometry.Pos; | |||
| import javafx.scene.Parent; | |||
| import javafx.scene.Scene; | |||
| import javafx.scene.control.ProgressIndicator; | |||
| import javafx.scene.image.Image; | |||
| import javafx.scene.image.ImageView; | |||
| import javafx.scene.layout.Background; | |||
| @@ -36,33 +38,38 @@ public class Main extends Application { | |||
| @Override | |||
| protected Parent call() throws Exception { | |||
| FXMLLoader fxmlLoader = new FXMLLoader(); | |||
| fxmlLoader.setLocation(getClass().getClassLoader().getResource("main.fxml")); | |||
| MainController mainController = new MainController(); | |||
| fxmlLoader.setControllerFactory(mainController.getControllerFactory()); | |||
| mainController.setOpsCodes(FXCollections.observableArrayList( | |||
| updateMessage("Lade OPS-Codes..."); | |||
| mainController.getStammdaten().setOpsCodes(FXCollections.observableArrayList( | |||
| DBHandler.getAllOpsCodes() | |||
| )); | |||
| mainController.setIcd10Codes(FXCollections.observableArrayList( | |||
| updateMessage("Lade ICD-10-Codes..."); | |||
| mainController.getStammdaten().setIcd10Codes(FXCollections.observableArrayList( | |||
| DBHandler.getAllIcd10Codes() | |||
| )); | |||
| mainController.setKassen(FXCollections.observableArrayList( | |||
| //DBHandler.getAll | |||
| updateMessage("Lade Krankenkassen..."); | |||
| mainController.getStammdaten().setKassen(FXCollections.observableArrayList( | |||
| DBHandler.getAllKassen() | |||
| )); | |||
| mainController.setMitarbeiter(FXCollections.observableArrayList( | |||
| updateMessage("Lade Mitarbeiter..."); | |||
| mainController.getStammdaten().setMitarbeiter(FXCollections.observableArrayList( | |||
| DBHandler.getAllMitarbeiter() | |||
| )); | |||
| mainController.setStationen(FXCollections.observableArrayList( | |||
| updateMessage("Lade Stationen..."); | |||
| mainController.getStammdaten().setStationen(FXCollections.observableArrayList( | |||
| DBHandler.getAllStationen()) | |||
| ); | |||
| updateMessage("Lade GUI..."); | |||
| FXMLLoader fxmlLoader = new FXMLLoader(); | |||
| fxmlLoader.setLocation(getClass().getClassLoader().getResource("main.fxml")); | |||
| fxmlLoader.setControllerFactory(mainController.getControllerFactory()); | |||
| Parent root = fxmlLoader.load(); | |||
| return root; | |||
| @@ -81,7 +88,7 @@ public class Main extends Application { | |||
| primaryStage.getIcons().add(icon); | |||
| Stage loadingMessage = createLoadWindow(); | |||
| Stage loadingMessage = createLoadWindow(loadMainWindowTask.messageProperty()); | |||
| loadMainWindowTask.setOnFailed(event -> { | |||
| loadMainWindowTask.getException().printStackTrace(); | |||
| @@ -96,6 +103,7 @@ public class Main extends Application { | |||
| primaryStage.setScene(new Scene(root, 1000, 800)); | |||
| primaryStage.show(); | |||
| }); | |||
| Thread thread = new Thread(loadMainWindowTask); | |||
| thread.setDaemon(true); | |||
| thread.start(); | |||
| @@ -109,17 +117,20 @@ public class Main extends Application { | |||
| * | |||
| * @return the splash screen | |||
| */ | |||
| public Stage createLoadWindow(){ | |||
| public Stage createLoadWindow(ReadOnlyStringProperty progressMessage){ | |||
| Text kis = new Text("KIS"); | |||
| kis.setFont(Font.font(50)); | |||
| Text gruppe6 = new Text("Gruppe 06"); | |||
| gruppe6.setFont(Font.font(20)); | |||
| VBox root = new VBox(gruppe6, new ImageView(icon), kis); | |||
| Text progress = new Text(); | |||
| progress.textProperty().bind(progressMessage); | |||
| VBox root = new VBox(gruppe6, new ImageView(icon), kis, progress); | |||
| root.setSpacing(20); | |||
| root.setAlignment(Pos.CENTER); | |||
| Scene scene = new Scene(root, 400, 400); | |||
| Scene scene = new Scene(root, 400, 500); | |||
| Stage stage = new Stage(StageStyle.UNDECORATED); | |||
| stage.getIcons().add(icon); | |||
| @@ -4,95 +4,143 @@ package de.uniluebeck.mi.projmi6.controller; | |||
| * Created by 631806 on 12.11.15. | |||
| */ | |||
| import de.uniluebeck.mi.projmi6.model.*; | |||
| import de.uniluebeck.mi.projmi6.db.DBHandler; | |||
| import de.uniluebeck.mi.projmi6.model.DiagArt; | |||
| import de.uniluebeck.mi.projmi6.model.Diagnose; | |||
| import de.uniluebeck.mi.projmi6.model.Icd10Code; | |||
| import de.uniluebeck.mi.projmi6.model.Mitarbeiter; | |||
| import de.uniluebeck.mi.projmi6.view.SelectKeyComboBoxListener; | |||
| import javafx.beans.property.ReadOnlyObjectProperty; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| import javafx.collections.FXCollections; | |||
| import javafx.collections.ObservableList; | |||
| import javafx.event.ActionEvent; | |||
| import javafx.fxml.FXML; | |||
| import javafx.scene.control.*; | |||
| import javafx.event.ActionEvent; | |||
| import javafx.scene.layout.GridPane; | |||
| public class DiagnoseController { | |||
| SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW); | |||
| @FXML | |||
| Button btnDiagAbort, btnDiagEdit; | |||
| private MainController mainController; | |||
| private SimpleObjectProperty<ObservableList<Diagnose>> diagnosen = new SimpleObjectProperty<>(); | |||
| @FXML | |||
| private ListView<Diagnose> diagnoseList; | |||
| @FXML | |||
| private GridPane fields; | |||
| @FXML | |||
| private ComboBox<Mitarbeiter> diagDiagnoseArzt; | |||
| @FXML | |||
| private Label diagCreator; | |||
| @FXML | |||
| private Button btnDiagCancel; | |||
| @FXML | |||
| private TextArea diagFreitext; | |||
| @FXML | |||
| private Button btnDiagSave; | |||
| @FXML | |||
| private Label diagCreateTime; | |||
| @FXML | |||
| private ComboBox<DiagArt> diagDiagnoseArt; | |||
| @FXML | |||
| private Label diagChanger; | |||
| @FXML | |||
| private ComboBox<Icd10Code> diagDiagnose; | |||
| @FXML | |||
| private Label diagChangeTime; | |||
| @FXML | |||
| private Button btnDiagCreate; | |||
| public DiagnoseController(MainController mainController){ | |||
| public DiagnoseController(MainController mainController) { | |||
| this.mainController = mainController; | |||
| } | |||
| public ObservableList<Diagnose> getDiagnosen() { | |||
| return diagnosen.get(); | |||
| } | |||
| public void setDiagnosen(ObservableList<Diagnose> diagnosen) { | |||
| this.diagnosen.set(diagnosen); | |||
| } | |||
| public SimpleObjectProperty<ObservableList<Diagnose>> diagnosenProperty() { | |||
| return diagnosen; | |||
| } | |||
| public void setDiagnosen(ObservableList<Diagnose> diagnosen) { | |||
| this.diagnosen.set(diagnosen); | |||
| public State getState() { | |||
| return state.get(); | |||
| } | |||
| private SimpleObjectProperty<ObservableList<Diagnose>> diagnosen = new SimpleObjectProperty<>(); | |||
| public ReadOnlyObjectProperty<State> stateProperty() { | |||
| return state; | |||
| } | |||
| @FXML | |||
| public void initialize() { | |||
| diagDiagnose.itemsProperty().bind(mainController.getStammdaten().icd10CodesProperty()); | |||
| @FXML | |||
| private ListView<Diagnose> diagnoseList; | |||
| new SelectKeyComboBoxListener(diagDiagnose); | |||
| @FXML | |||
| public void initialize(){ | |||
| diagDiagnose.itemsProperty().bind(mainController.icd10CodesProperty()); | |||
| diagDiagnoseArt.setItems(FXCollections.observableArrayList(DiagArt.values())); | |||
| diagDiagnoseArzt.itemsProperty().bind(mainController.mitarbeiterProperty()); | |||
| diagDiagnoseArzt.itemsProperty().bind(mainController.getStammdaten().mitarbeiterProperty()); | |||
| diagnoseList.itemsProperty().bind(diagnosen); | |||
| initButtons(); | |||
| fields.disableProperty().bind(state.isEqualTo(State.VIEW)); | |||
| diagnoseList.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); | |||
| diagnoseList.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { | |||
| this.setDiagnose(newValue); | |||
| if (newValue == null) { | |||
| clearFields(); | |||
| } else { | |||
| copyDiagnoseDataIntoFields(newValue); | |||
| } | |||
| }); | |||
| } | |||
| @FXML | |||
| private ComboBox<Mitarbeiter> diagDiagnoseArzt; | |||
| @FXML | |||
| private Label diagCreator; | |||
| } | |||
| @FXML | |||
| private Button btnDiagCancel; | |||
| private void initButtons() { | |||
| btnDiagCreate.disableProperty().bind(mainController.fallProperty().isNull()); | |||
| @FXML | |||
| private TextArea diagFreitext; | |||
| btnDiagEdit.disableProperty().bind(diagnoseList.getSelectionModel().selectedItemProperty().isNull()); | |||
| @FXML | |||
| private Button btnDiagSave; | |||
| btnDiagEdit.managedProperty().bind(state.isEqualTo(State.VIEW)); | |||
| btnDiagEdit.visibleProperty().bind(btnDiagEdit.managedProperty()); | |||
| @FXML | |||
| private Label diagCreateTime; | |||
| @FXML | |||
| private ComboBox<DiagArt> diagDiagnoseArt; | |||
| btnDiagSave.managedProperty().bind(state.isNotEqualTo(State.VIEW)); | |||
| btnDiagSave.visibleProperty().bind(btnDiagSave.managedProperty()); | |||
| @FXML | |||
| private Label diagChanger; | |||
| btnDiagAbort.managedProperty().bind(btnDiagSave.managedProperty()); | |||
| btnDiagAbort.visibleProperty().bind(btnDiagSave.managedProperty()); | |||
| @FXML | |||
| private ComboBox<Icd10Code> diagDiagnose; | |||
| } | |||
| @FXML | |||
| private Label diagChangeTime; | |||
| private void clickedEdit() { | |||
| state.set(State.EDIT); | |||
| } | |||
| @FXML | |||
| private Button btnDiagCreate; | |||
| private void clickedAbort() { | |||
| state.set(State.VIEW); | |||
| Diagnose diagnose = diagnoseList.getSelectionModel().getSelectedItem(); | |||
| if (diagnose == null) { | |||
| clearFields(); | |||
| } else { | |||
| copyDiagnoseDataIntoFields(diagnose); | |||
| } | |||
| } | |||
| @FXML | |||
| void clickedDiagCreate(ActionEvent event) { | |||
| this.state.set(State.CREATE); | |||
| } | |||
| @FXML | |||
| @@ -102,28 +150,27 @@ public class DiagnoseController { | |||
| @FXML | |||
| void clickedDiagSave(ActionEvent event) { | |||
| if(state.get() == State.CREATE){ | |||
| //Create new diagnosis | |||
| Diagnose diagnose = new Diagnose(); | |||
| copyFieldDataIntoDiagnose(diagnose); | |||
| try { | |||
| DBHandler.setDiagnose(diagnose); | |||
| }catch (Exception e){ | |||
| e.printStackTrace(); | |||
| } | |||
| }else{ | |||
| //Update diagnosis in db | |||
| } | |||
| /** | |||
| * The diagnose that is shown in the edit window, or null if a new diagnose should be created. | |||
| */ | |||
| private Diagnose diagnose = null; | |||
| public void setDiagnose(Diagnose diagnose){ | |||
| this.diagnose = diagnose; | |||
| if(diagnose==null){ | |||
| clearFields(); | |||
| }else { | |||
| copyDiagnoseDataIntoFields(diagnose); | |||
| } | |||
| mainController.refreshCaseData(); | |||
| } | |||
| private void copyDiagnoseDataIntoFields(Diagnose diagnose){ | |||
| diagDiagnoseArzt.setValue(diagnose.getArzt()); | |||
| diagFreitext.setText(diagnose.getFreiText()); | |||
| diagDiagnoseArt.setValue(diagnose.getDiagArt()); | |||
| diagDiagnose.setValue(diagnose.getIcd10code()); | |||
| @@ -139,17 +186,25 @@ public class DiagnoseController { | |||
| diagnose.setArzt(diagDiagnoseArzt.getValue()); | |||
| diagnose.setFreiText(diagFreitext.getText()); | |||
| diagnose.setDiagArt(diagDiagnoseArt.getValue()); | |||
| diagnose.setFall(mainController.getFall()); | |||
| diagnose.setErsteller(mainController.getCurrentMitarbeiter().getMitarbID()); | |||
| diagnose.setBearbeiter(mainController.getCurrentMitarbeiter().getMitarbID()); | |||
| } | |||
| private void clearFields(){ | |||
| diagDiagnoseArzt.setValue(null); | |||
| diagDiagnoseArzt.setValue(mainController.getCurrentMitarbeiter()); | |||
| diagDiagnose.setValue(null); | |||
| diagFreitext.setText(""); | |||
| diagDiagnoseArt.setValue(null); | |||
| diagCreator.setText("todo"); | |||
| diagCreateTime.setText("<auto>"); | |||
| diagChanger.setText("todo"); | |||
| diagChangeTime.setText("<auto>"); | |||
| diagCreator.setText(""); | |||
| diagCreateTime.setText(""); | |||
| diagChanger.setText(""); | |||
| diagChangeTime.setText(""); | |||
| } | |||
| public enum State { | |||
| CREATE, EDIT, VIEW | |||
| } | |||
| } | |||
| @@ -3,55 +3,44 @@ 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.db.DBHandler; | |||
| import de.uniluebeck.mi.projmi6.model.*; | |||
| import de.uniluebeck.mi.projmi6.view.DateTimePicker; | |||
| import javafx.beans.property.ObjectProperty; | |||
| import javafx.beans.property.ReadOnlyObjectProperty; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| 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.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 | |||
| @@ -62,58 +51,61 @@ 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 getFallProperty() { | |||
| public FallController(MainController mainController) { | |||
| this.mainController = mainController; | |||
| } | |||
| public Fall getFall() { | |||
| return fallProperty.get(); | |||
| } | |||
| public void setFall(Fall fall) { | |||
| this.fallProperty.set(fall); | |||
| } | |||
| public SimpleObjectProperty<Fall> fallPropertyProperty() { | |||
| return fallProperty; | |||
| } | |||
| public void setFallProperty(Fall fallProperty) { | |||
| this.fallProperty.set(fallProperty); | |||
| public State getState() { | |||
| return state.get(); | |||
| } | |||
| public enum State { | |||
| CREATE, EDIT, VIEW | |||
| public ReadOnlyObjectProperty<State> stateProperty() { | |||
| return state; | |||
| } | |||
| SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW); | |||
| public ObjectProperty<ObservableList<Diagnose>> diagnosenProperty(){ | |||
| return fallHauptdiagnose.itemsProperty(); | |||
| } | |||
| public ObservableList<Diagnose> getDiagnosen() { | |||
| return fallHauptdiagnose.getItems(); | |||
| } | |||
| public void setDiagnosen(ObservableList<Diagnose> list){ | |||
| fallHauptdiagnose.setItems(list); | |||
| } | |||
| @FXML | |||
| public void initialize(){ | |||
| fallEinweisenderArzt.disableProperty().bind(fallSelbsteinweisung.selectedProperty()); | |||
| fallFallart.setItems(FXCollections.observableArrayList(FallArt.values())); | |||
| fallKasse.setItems(mainController.getKassen()); | |||
| fallKasse.setItems(mainController.getStammdaten().getKassen()); | |||
| btnFallEnableEdit.visibleProperty().bind( | |||
| state.isEqualTo(State.VIEW).and(fallProperty.isNotNull()) | |||
| ); | |||
| btnFallAbort.visibleProperty().bind( | |||
| state.isNotEqualTo(State.VIEW) | |||
| ); | |||
| btnFallSave.visibleProperty().bind( | |||
| state.isNotEqualTo(State.VIEW) | |||
| ); | |||
| btnFallCancel.visibleProperty().bind( | |||
| state.isEqualTo(State.VIEW).and(fallProperty.isNotNull()) | |||
| ); | |||
| initButtons(); | |||
| fallFields.disableProperty().bind(state.isEqualTo(State.VIEW)); | |||
| @@ -122,15 +114,58 @@ public class FallController { | |||
| copyFallDataIntoField(fallProperty.get()); | |||
| } | |||
| })); | |||
| state.addListener((observable, oldValue, newValue) -> { | |||
| if(newValue==State.EDIT || newValue == State.CREATE){ | |||
| mainController.lockForEdit(MainController.TabName.OVERVIEW); | |||
| }else{ | |||
| mainController.unlockFromEdit(); | |||
| } | |||
| }); | |||
| } | |||
| /** | |||
| * Hide the buttons depending on controller state. | |||
| */ | |||
| private void initButtons(){ | |||
| btnFallEnableEdit.managedProperty().bind( | |||
| state.isEqualTo(State.VIEW).and(fallProperty.isNotNull()) | |||
| ); | |||
| btnFallEnableEdit.visibleProperty().bind(btnFallEnableEdit.managedProperty()); | |||
| btnFallAbort.managedProperty().bind( | |||
| state.isNotEqualTo(State.VIEW) | |||
| ); | |||
| btnFallAbort.visibleProperty().bind(btnFallAbort.managedProperty()); | |||
| btnFallSave.managedProperty().bind( | |||
| state.isNotEqualTo(State.VIEW) | |||
| ); | |||
| btnFallSave.visibleProperty().bind(btnFallSave.managedProperty()); | |||
| btnFallCancel.managedProperty().bind( | |||
| state.isEqualTo(State.VIEW).and(fallProperty.isNotNull()) | |||
| ); | |||
| btnFallCancel.visibleProperty().bind(btnFallCancel.managedProperty()); | |||
| btnFallSendHl7.managedProperty().bind( | |||
| state.isEqualTo(State.VIEW).and(fallProperty.isNotNull()) | |||
| ); | |||
| btnFallSendHl7.visibleProperty().bind(btnFallSendHl7.managedProperty()); | |||
| } | |||
| @FXML | |||
| private void clickedSendHl7(){ | |||
| /* Natascha */ | |||
| //TODO send funny message | |||
| Fall fall = fallProperty.get(); | |||
| Patient patient = mainController.getPatientTablesController().getSelectedPatient(); | |||
| } | |||
| public void editFall(){ | |||
| this.state.set(State.EDIT); | |||
| } | |||
| @FXML | |||
| void clickedFallEnableEdit(ActionEvent event) { | |||
| editFall(); | |||
| @@ -138,31 +173,62 @@ public class FallController { | |||
| @FXML | |||
| void clickedFallCancel(ActionEvent event) { | |||
| this.state.set(State.VIEW); | |||
| copyFallDataIntoField(fallProperty.get()); | |||
| if (fallProperty.get() != null) { | |||
| fallProperty.get().setStorniert(true); | |||
| try { | |||
| DBHandler.setFall(fallProperty.get(), mainController.getCurrentMitarbeiter().getMitarbID(), true); | |||
| } catch (Exception e) { | |||
| e.printStackTrace(); | |||
| } | |||
| mainController.refreshCasesFromDb(mainController.getPatientTablesController().getSelectedPatient()); | |||
| } | |||
| } | |||
| @FXML | |||
| void clickedFallAbort(ActionEvent event) { | |||
| this.state.set(State.VIEW); | |||
| copyFallDataIntoField(fallProperty.get()); | |||
| mainController.fallCreationComplete(); | |||
| } | |||
| @FXML | |||
| void clickedFallSave(ActionEvent event) { | |||
| mainController.fallCreationComplete(); | |||
| if (this.state.get() == State.CREATE) { | |||
| Fall fall = new Fall(); | |||
| copyFieldDataIntoFall(fall); | |||
| try { | |||
| DBHandler.setFall(fall, mainController.getCurrentMitarbeiter().getMitarbID()); | |||
| } catch (SQLException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| } else { | |||
| copyFieldDataIntoFall(fallProperty.get()); | |||
| try { | |||
| DBHandler.setFall(fallProperty.get(), mainController.getCurrentMitarbeiter().getMitarbID(), true); | |||
| } catch (SQLException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| } | |||
| this.state.set(State.VIEW); | |||
| //TODO Update/create in db | |||
| mainController.refreshCasesFromDb(mainController.getPatientTablesController().getSelectedPatient()); | |||
| } | |||
| public void createNewFall() { | |||
| clearFields(); | |||
| this.state.set(State.CREATE); | |||
| } | |||
| Patient patient = mainController.getPatientTablesController().getSelectedPatient(); | |||
| // Kasse by Default auf die im Patienten hinterlegten Kasse setzen. | |||
| for (Kasse kasse : fallKasse.getItems()) { | |||
| if (kasse.getKassenID() == patient.getKassenID()) { | |||
| fallKasse.getSelectionModel().select(kasse); | |||
| break; | |||
| } | |||
| } | |||
| fallVersichertennummer.setText(patient.getVersichertennummer()); | |||
| } | |||
| private void clearFields(){ | |||
| if(state.get() == State.CREATE) { | |||
| @@ -175,10 +241,10 @@ public class FallController { | |||
| fallPatID.setText(""); //TODO | |||
| fallCreateTime.setText("<auto>"); | |||
| fallCreator.setText("<auto>"); | |||
| fallEditTime.setText("<auto>"); | |||
| fallEditor.setText("<auto>"); | |||
| fallCreateTime.setText(""); | |||
| fallCreator.setText(""); | |||
| fallEditTime.setText(""); | |||
| fallEditor.setText(""); | |||
| fallEinweisenderArzt.setText(""); | |||
| fallSelbsteinweisung.setSelected(false); | |||
| @@ -192,27 +258,30 @@ public class FallController { | |||
| fallFallart.setValue(null); | |||
| } | |||
| private void copyFieldDataIntoFall(Fall fall){ | |||
| fall.setPatient(mainController.getPatientTablesController().getSelectedPatient()); | |||
| fall.setAufnahmeDatum(dtTmAufnahme.getDateTime()); | |||
| fall.setEntlassungsDatum(dtTmEntlassung.getDateTime()); | |||
| if(fallSelbsteinweisung.isSelected()) { | |||
| fall.setSelbsteinweisung(true); | |||
| fall.setEinweisenderArzt(null); | |||
| }else{ | |||
| // fall.setEinweisenderArzt(fallEinweisenderArzt.getText()); TODO | |||
| fall.setEinweisenderArzt(fallEinweisenderArzt.getText()); | |||
| fall.setSelbsteinweisung(false); | |||
| } | |||
| fall.setVersichertenNummer(fallVersichertennummer.getText()); | |||
| fall.setKasse(fallKasse.getValue()); | |||
| fall.setFallArt(fallFallart.getValue()); | |||
| if (fallHauptdiagnose.getSelectionModel().getSelectedItem() != null) { | |||
| fall.setHauptdiagnoseId(fallHauptdiagnose.getSelectionModel().getSelectedItem().getDiagID()); | |||
| } | |||
| //fall.setVorstellDatum(); //TODO | |||
| } | |||
| private void copyFallDataIntoField(Fall fall){ | |||
| if(fall==null){ | |||
| System.out.println("copyFallDataIntoFiled - Fall ist null"); | |||
| @@ -223,22 +292,37 @@ public class FallController { | |||
| dtTmAufnahme.setDateTime(fall.getAufnahmeDatum()); | |||
| dtTmEntlassung.setDateTime(fall.getEntlassungsDatum()); | |||
| fallPatID.setText(fallProperty.get().getPatient()+""); //(fall.getPatient().getVorname()+" "+fall.getPatient().getNachname()); //TODO | |||
| fallPatID.setText(fallProperty.get().getPatient() + ""); //(fall.getPatient().getVorname()+" "+fall.getPatient().getNachname()); //TODO | |||
| fallCreateTime.setText(fall.getErstellDatumZeit() !=null ? fall.getErstellDatumZeit().toString():""); | |||
| fallCreator.setText(Integer.toString(fall.getErsteller())); | |||
| fallEditTime.setText(fall.getBearbeitetDatumZeit()!=null? fall.getBearbeitetDatumZeit().toString():""); | |||
| fallEditor.setText(Integer.toString(fall.getBearbeiter())); | |||
| // fallEinweisenderArzt.setText(fall.getEinweisenderArzt()); | |||
| fallEinweisenderArzt.setText(fall.getEinweisenderArzt()); | |||
| fallSelbsteinweisung.setSelected(fall.getSelbsteinweisung()); | |||
| 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 | |||
| //fallFallart.setValue(fall.getFallArt()); | |||
| fallFallart.setValue(fall.getFallArt()); | |||
| } | |||
| public enum State { | |||
| CREATE, EDIT, VIEW | |||
| } | |||
| } | |||
| @@ -0,0 +1,109 @@ | |||
| package de.uniluebeck.mi.projmi6.controller; | |||
| import de.uniluebeck.mi.projmi6.db.DBHandler; | |||
| import de.uniluebeck.mi.projmi6.model.HL7LogEntry; | |||
| import javafx.collections.FXCollections; | |||
| import javafx.concurrent.Task; | |||
| import javafx.fxml.FXML; | |||
| import javafx.scene.control.Button; | |||
| import javafx.scene.control.TableColumn; | |||
| import javafx.scene.control.TableView; | |||
| import javafx.scene.control.cell.PropertyValueFactory; | |||
| import javafx.scene.text.Text; | |||
| import java.time.LocalDateTime; | |||
| import java.util.List; | |||
| /** | |||
| * Created by 631806 on 19.11.15. | |||
| */ | |||
| public class LogController { | |||
| final MainController mainController; | |||
| @FXML | |||
| TableView<HL7LogEntry> tblLog; | |||
| @FXML | |||
| TableColumn<HL7LogEntry, String> colLogIp, colLogMessage; | |||
| @FXML | |||
| TableColumn<HL7LogEntry, LocalDateTime> colLogTime; | |||
| @FXML | |||
| Button btnRefresh; | |||
| public LogController(MainController mainController) { | |||
| this.mainController = mainController; | |||
| } | |||
| @FXML | |||
| private void initialize(){ | |||
| initColumns(); | |||
| refreshLogFromDb(); | |||
| } | |||
| private void initColumns(){ | |||
| colLogIp.setCellValueFactory(new PropertyValueFactory<HL7LogEntry, String>("source")); | |||
| colLogTime.setCellValueFactory(new PropertyValueFactory<HL7LogEntry, LocalDateTime>("timestamp")); | |||
| colLogIp.setCellValueFactory(new PropertyValueFactory<HL7LogEntry, String>("message")); | |||
| } | |||
| private Task<List<HL7LogEntry>> loadLogEntryTask = null; | |||
| public void refreshLogFromDb(){ | |||
| if (this.loadLogEntryTask != null && this.loadLogEntryTask.isRunning()) { | |||
| return; | |||
| } | |||
| btnRefresh.setDisable(true); | |||
| tblLog.setItems(null); | |||
| mainController.increaseParallelTaskCount(); | |||
| tblLog.setPlaceholder(new Text("Liste wird geladen...")); | |||
| loadLogEntryTask= new Task<List<HL7LogEntry>>() { | |||
| @Override | |||
| protected List<HL7LogEntry> call() throws Exception { | |||
| return FXCollections.<HL7LogEntry>observableArrayList(DBHandler.getLastHL7LogEntries()); | |||
| } | |||
| @Override | |||
| protected void succeeded() { | |||
| super.succeeded(); | |||
| tblLog.setPlaceholder(new Text("Liste ist leer.")); | |||
| tblLog.setItems(FXCollections.observableArrayList(this.getValue())); | |||
| mainController.decreaseParallelTaskCount(); | |||
| btnRefresh.setDisable(false); | |||
| } | |||
| @Override | |||
| protected void failed() { | |||
| super.failed(); | |||
| tblLog.setPlaceholder(new Text("Laden fehlgeschlagen")); | |||
| mainController.decreaseParallelTaskCount(); | |||
| tblLog.setItems(null); | |||
| getException().printStackTrace(); | |||
| } | |||
| }; | |||
| Thread thread = new Thread(loadLogEntryTask); | |||
| thread.setDaemon(true); | |||
| thread.start(); | |||
| } | |||
| @FXML | |||
| private void clickedRefresh(){ | |||
| refreshLogFromDb(); | |||
| } | |||
| } | |||
| @@ -3,16 +3,23 @@ package de.uniluebeck.mi.projmi6.controller; | |||
| import de.uniluebeck.mi.projmi6.db.DBHandler; | |||
| import de.uniluebeck.mi.projmi6.model.*; | |||
| import javafx.beans.binding.Bindings; | |||
| import javafx.beans.property.ReadOnlyObjectProperty; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| import javafx.beans.value.ChangeListener; | |||
| import javafx.collections.FXCollections; | |||
| import javafx.collections.ObservableList; | |||
| import javafx.concurrent.Task; | |||
| import javafx.fxml.FXML; | |||
| import javafx.scene.control.*; | |||
| import javafx.scene.paint.Color; | |||
| import javafx.scene.text.Text; | |||
| import javafx.util.Callback; | |||
| import javax.swing.*; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| import java.util.Set; | |||
| import java.util.concurrent.ThreadFactory; | |||
| public class MainController { | |||
| @@ -22,50 +29,7 @@ public class MainController { | |||
| private SettingsController settingsController; | |||
| private StationsHistorieController stationsHistorieController; | |||
| private UntersuchungenController untersuchungenController; | |||
| private SimpleObjectProperty<ObservableList<OpsCode>> opsCodes = new SimpleObjectProperty<>(); | |||
| private SimpleObjectProperty<ObservableList<Icd10Code>> icd10Codes = new SimpleObjectProperty<>(); | |||
| private SimpleObjectProperty<ObservableList<Mitarbeiter>> mitarbeiter = new SimpleObjectProperty<>(); | |||
| private SimpleObjectProperty<ObservableList<Kasse>> kassen = new SimpleObjectProperty<>(); | |||
| private SimpleObjectProperty<ObservableList<Station>> stationen = new SimpleObjectProperty<>(); | |||
| public ObservableList<Station> getStationen() { | |||
| return stationen.get(); | |||
| } | |||
| public SimpleObjectProperty<ObservableList<Station>> stationenProperty() { | |||
| return stationen; | |||
| } | |||
| public void setStationen(ObservableList<Station> stationen) { | |||
| this.stationen.set(stationen); | |||
| } | |||
| public ObservableList<Mitarbeiter> getMitarbeiter() { | |||
| return mitarbeiter.get(); | |||
| } | |||
| public SimpleObjectProperty<ObservableList<Mitarbeiter>> mitarbeiterProperty() { | |||
| return mitarbeiter; | |||
| } | |||
| public void setMitarbeiter(ObservableList<Mitarbeiter> mitarbeiter) { | |||
| this.mitarbeiter.set(mitarbeiter); | |||
| } | |||
| public ObservableList<Kasse> getKassen() { | |||
| return kassen.get(); | |||
| } | |||
| public SimpleObjectProperty<ObservableList<Kasse>> kassenProperty() { | |||
| return kassen; | |||
| } | |||
| public void setKassen(ObservableList<Kasse> kassen) { | |||
| this.kassen.set(kassen); | |||
| } | |||
| private LogController logController; | |||
| private int parallelTaskCount = 0; | |||
| @@ -74,6 +38,7 @@ public class MainController { | |||
| @FXML | |||
| private ProgressIndicator progressIndicator; | |||
| @FXML | |||
| private Button btnFallCreate; | |||
| @@ -87,192 +52,367 @@ public class MainController { | |||
| private TabPane tabPaneFall; | |||
| @FXML | |||
| private Tab tabFallOverview, tabFallUntersuchungen, tabFallDiagnose, tabFallStationsHistorie ; | |||
| private Tab tabFallOverview, tabFallUntersuchungen, tabFallDiagnose, tabFallStationsHistorie; | |||
| private Stammdaten stammdaten = new Stammdaten(); | |||
| private Callback<Class<?>, Object> controllerFactory = clazz -> { | |||
| if(clazz.equals(MainController.class)) { | |||
| if (clazz.equals(MainController.class)) { | |||
| return this; | |||
| }else if(clazz.equals(FallController.class)){ | |||
| } else if (clazz.equals(FallController.class)) { | |||
| return fallController; | |||
| }else if(clazz.equals(DiagnoseController.class)){ | |||
| } else if (clazz.equals(DiagnoseController.class)) { | |||
| return diagnoseController; | |||
| }else if(clazz.equals(PatientTablesController.class)){ | |||
| } else if (clazz.equals(PatientTablesController.class)) { | |||
| return patientTablesController; | |||
| }else if(clazz.equals(SettingsController.class)){ | |||
| return settingsController; | |||
| } else if(clazz.equals(UntersuchungenController.class)) { | |||
| } else if (clazz.equals(SettingsController.class)) { | |||
| return settingsController; | |||
| } else if (clazz.equals(UntersuchungenController.class)) { | |||
| return untersuchungenController; | |||
| }else if(clazz.equals(StationsHistorieController.class)){ | |||
| } else if (clazz.equals(StationsHistorieController.class)) { | |||
| return stationsHistorieController; | |||
| }else { | |||
| System.err.println("Keine Controller-Klasse des Typs "+clazz+" gefunden!!!"); | |||
| } else if (clazz.equals(LogController.class)){ | |||
| return logController; | |||
| } else { | |||
| System.err.println("Keine Controller-Klasse des Typs " + clazz + " gefunden!!!"); | |||
| return null; | |||
| } | |||
| }; | |||
| public MainController(){ | |||
| public MainController() { | |||
| fallController = new FallController(this); | |||
| diagnoseController = new DiagnoseController(this); | |||
| patientTablesController = new PatientTablesController(this); | |||
| settingsController = new SettingsController(this); | |||
| untersuchungenController = new UntersuchungenController(this); | |||
| stationsHistorieController = new StationsHistorieController(this); | |||
| logController = new LogController(this); | |||
| } | |||
| public Stammdaten getStammdaten() { | |||
| return stammdaten; | |||
| } | |||
| public Callback<Class<?>, Object> getControllerFactory(){ | |||
| public Callback<Class<?>, Object> getControllerFactory() { | |||
| return controllerFactory; | |||
| } | |||
| public FallController getFallController(){ | |||
| public FallController getFallController() { | |||
| return fallController; | |||
| } | |||
| public DiagnoseController getDiagnoseController(){ | |||
| public DiagnoseController getDiagnoseController() { | |||
| return diagnoseController; | |||
| } | |||
| public PatientTablesController getPatientTablesController(){ | |||
| return patientTablesController; | |||
| public PatientTablesController getPatientTablesController() { | |||
| return patientTablesController; | |||
| } | |||
| public SettingsController getSettingsController(){ | |||
| public SettingsController getSettingsController() { | |||
| return settingsController; | |||
| } | |||
| public UntersuchungenController getUntersuchungenController(){ | |||
| return untersuchungenController; | |||
| public UntersuchungenController getUntersuchungenController() { | |||
| return untersuchungenController; | |||
| } | |||
| public void increaseParallelTaskCount(){ | |||
| public void increaseParallelTaskCount() { | |||
| parallelTaskCount++; | |||
| if(parallelTaskCount>0){ | |||
| if (parallelTaskCount > 0 && progressIndicator != null) { | |||
| progressIndicator.setVisible(true); | |||
| } | |||
| } | |||
| public void decreaseParallelTaskCount(){ | |||
| parallelTaskCount++; | |||
| if(parallelTaskCount<=0){ | |||
| public void decreaseParallelTaskCount() { | |||
| parallelTaskCount--; | |||
| if (parallelTaskCount <= 0 && progressIndicator != null) { | |||
| parallelTaskCount = 0; | |||
| progressIndicator.setVisible(false); | |||
| } | |||
| } | |||
| public ObservableList<OpsCode> getOpsCodes() { | |||
| return opsCodes.get(); | |||
| } | |||
| @FXML | |||
| private Label lvFallPlaceholder; | |||
| public SimpleObjectProperty<ObservableList<OpsCode>> opsCodesProperty() { | |||
| return opsCodes; | |||
| } | |||
| public void setOpsCodes(ObservableList<OpsCode> opsCodes){ | |||
| this.opsCodesProperty().set(opsCodes); | |||
| } | |||
| private Task<List<Fall>> loadFallTask = null; | |||
| public ObservableList<Icd10Code> getIcd10Codes() { | |||
| return icd10Codes.get(); | |||
| } | |||
| public SimpleObjectProperty<ObservableList<Icd10Code>> icd10CodesProperty() { | |||
| return icd10Codes; | |||
| } | |||
| public void refreshCasesFromDb(Patient patient) { | |||
| lvFall.setItems(null); //clear list | |||
| if (patient == null) { // If no patient is selected | |||
| lvFallPlaceholder.setText("Kein Patient ausgew\u00e4hlt!"); | |||
| return; | |||
| } | |||
| if (loadFallTask != null && loadFallTask.isRunning()) { | |||
| loadFallTask.cancel(); | |||
| } | |||
| public void setIcd10Codes(ObservableList<Icd10Code> icd10Codes) { | |||
| this.icd10Codes.set(icd10Codes); | |||
| loadFallTask = new Task<List<Fall>>() { | |||
| @Override | |||
| protected List<Fall> call() throws Exception { | |||
| return DBHandler.getFaelleByPatID(patient.getPatID()); | |||
| } | |||
| @Override | |||
| protected void succeeded() { | |||
| super.succeeded(); | |||
| if (isCancelled()) { | |||
| return; | |||
| } | |||
| lvFallPlaceholder.setText("Keine F\u00e4lle vorhanden!"); | |||
| lvFall.setItems(FXCollections.observableArrayList(getValue())); | |||
| decreaseParallelTaskCount(); | |||
| } | |||
| @Override | |||
| protected void cancelled() { | |||
| super.cancelled(); | |||
| decreaseParallelTaskCount(); | |||
| } | |||
| @Override | |||
| protected void failed() { | |||
| super.failed(); | |||
| lvFallPlaceholder.setText("Laden fehlgeschlagen!"); | |||
| lvFall.setItems(null); | |||
| decreaseParallelTaskCount(); | |||
| } | |||
| }; | |||
| lvFallPlaceholder.setText("Liste wird geladen..."); | |||
| increaseParallelTaskCount(); | |||
| Thread thread = new Thread(loadFallTask); | |||
| thread.setDaemon(true); | |||
| thread.start(); | |||
| } | |||
| @FXML | |||
| private void initialize(){ | |||
| cmbUserChoose.itemsProperty().bind(this.mitarbeiterProperty()); | |||
| private void initialize() { | |||
| //Init user data. | |||
| cmbUserChoose.itemsProperty().bind(this.getStammdaten().mitarbeiterProperty()); | |||
| cmbUserChoose.getSelectionModel().select(0); // TODO: Bessere Loesung finden. | |||
| fallOverview.disableProperty().bind(patientTablesController.selectedPatientProperty().isNull()); | |||
| //Disable the right side if no case is selected. | |||
| fallOverview.disableProperty().bind(patientTablesController.selectedPatientProperty().isNull() | |||
| .and(fallController.stateProperty().isNotEqualTo(FallController.State.CREATE))); | |||
| //Load the cases async if patient changes | |||
| patientTablesController.selectedPatientProperty().addListener((observableValue, oldValue, newValue) -> { | |||
| refreshCasesFromDb(newValue); | |||
| }); | |||
| patientTablesController.selectedPatientProperty().addListener((observableValue,oldValue,newValue)-> { | |||
| if(newValue==null){ | |||
| lvFall.setItems(FXCollections.emptyObservableList()); | |||
| return; | |||
| } | |||
| lvFall.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); | |||
| try { | |||
| List<Fall> faelle = DBHandler.getFaelleByPatID(newValue.getPatID()); | |||
| System.out.println(faelle); | |||
| System.out.println("Liste der Faelle hat "+ faelle.size()+ " Eintrage "); | |||
| lvFall.setItems(FXCollections.observableArrayList(faelle)); | |||
| fallController.fallPropertyProperty().bind(lvFall.getSelectionModel().selectedItemProperty()); | |||
| lvFall.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> { | |||
| refreshCaseData(newValue); | |||
| }); | |||
| }catch (Exception e){ | |||
| e.printStackTrace(); | |||
| } | |||
| lvFall.setCellFactory(lv -> { | |||
| return new ListCell<Fall>() { | |||
| @Override | |||
| protected void updateItem(Fall item, boolean empty) { | |||
| super.updateItem(item, empty); | |||
| if (item == null || empty) { | |||
| this.setText(null); | |||
| this.setGraphic(null); | |||
| return; | |||
| } | |||
| setText(item.toString()); | |||
| if (item.getStorniert()) { | |||
| Text text = new Text("<storniert> "); | |||
| text.setFill(Color.RED); | |||
| setGraphic(text); | |||
| setTextFill(Color.GRAY); //TODO | |||
| } else { | |||
| setTextFill(Color.BLACK); | |||
| setGraphic(null); | |||
| } | |||
| } | |||
| }; | |||
| }); | |||
| } | |||
| fallController.fallPropertyProperty().bind(lvFall.getSelectionModel().selectedItemProperty()); | |||
| lvFall.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); | |||
| private Task<Void> loadCaseData = null; | |||
| private void refreshCaseData(Fall fall){ | |||
| if (loadCaseData != null && loadCaseData.isRunning()) { | |||
| loadCaseData.cancel(); | |||
| } | |||
| tabPaneFall.setDisable(false); | |||
| tabFallDiagnose.setDisable(true); | |||
| tabFallStationsHistorie.setDisable(true); | |||
| tabFallUntersuchungen.setDisable(true); | |||
| if (fall == null) { | |||
| tabPaneFall.setDisable(true); | |||
| System.out.println("TODO: Clear tables cuz fall = null!"); | |||
| //fallController.c | |||
| return; | |||
| } | |||
| if (fall == null) { // If no patient is selected | |||
| //lvFallPlaceholder.setText("Kein Patient ausgew\u00e4hlt!"); | |||
| return; | |||
| } | |||
| loadCaseData = new Task<Void>() { | |||
| List<Untersuchung> untersuchungList; | |||
| List<Diagnose> diagnoseList; | |||
| List<StationsHistorie> stationsHistorieList; | |||
| @Override | |||
| protected Void call() throws Exception { | |||
| untersuchungList = DBHandler.getUntersuchungByFall(fall); | |||
| diagnoseList = DBHandler.getDiagnosenByFall(fall); | |||
| stationsHistorieList = DBHandler.getStationsHistorieByFall(fall); | |||
| return null; | |||
| } | |||
| @Override | |||
| protected void succeeded() { | |||
| super.succeeded(); | |||
| if (isCancelled()) { | |||
| System.out.println("Task wurde gecancelt"); | |||
| return; | |||
| } | |||
| ObservableList<Diagnose> diagnoses = FXCollections.observableArrayList(diagnoseList); | |||
| untersuchungenController.setUntersuchungen(FXCollections.observableArrayList(untersuchungList)); | |||
| diagnoseController.setDiagnosen(diagnoses); | |||
| stationsHistorieController.setStationsHistorie(FXCollections.observableArrayList(stationsHistorieList)); | |||
| fallController.setDiagnosen(diagnoses); | |||
| tabPaneFall.setDisable(false); | |||
| tabFallDiagnose.setDisable(false); | |||
| tabFallStationsHistorie.setDisable(false); | |||
| tabFallUntersuchungen.setDisable(false); | |||
| decreaseParallelTaskCount(); | |||
| } | |||
| /* untersuchungenController.untersuchungenProperty().bind( | |||
| Bindings.createObjectBinding(() ->{ | |||
| Fall selectedFall = lvFall.getSelectionModel().getSelectedItem(); | |||
| System.out.println("Liste der Untersuchungen ...y"); | |||
| if(selectedFall==null) return null; | |||
| List<Untersuchung> untersuchungList = DBHandler.getUntersuchungByFall(selectedFall); | |||
| System.out.println("Es sind "+untersuchungList.size()+" Untersuchungen vorhanden."); | |||
| return FXCollections.observableArrayList(untersuchungList); | |||
| }, lvFall.getSelectionModel().selectedIndexProperty()));*/ | |||
| lvFall.getSelectionModel().selectedItemProperty().addListener(((observable, oldValue, newValue) -> { | |||
| System.out.println("Changed choosen Fall"); | |||
| if(newValue==null) { | |||
| System.out.println("TODO: Clear tables cuz fall = null!"); | |||
| return; | |||
| @Override | |||
| protected void cancelled() { | |||
| super.cancelled(); | |||
| decreaseParallelTaskCount(); | |||
| } | |||
| try { | |||
| List<Untersuchung> untersuchungList = DBHandler.getUntersuchungByFall(newValue); | |||
| System.out.println("untersuchungenList"+untersuchungList); | |||
| untersuchungenController.untersuchungenProperty().set(FXCollections.observableArrayList(untersuchungList)); | |||
| List<Diagnose> diagnoseList = DBHandler.getDiagnosenByFall(newValue); | |||
| System.out.println("diagnoseList ="+diagnoseList); | |||
| diagnoseController.diagnosenProperty().set(FXCollections.observableArrayList(diagnoseList)); | |||
| }catch(Exception e){ | |||
| e.printStackTrace(); | |||
| @Override | |||
| protected void failed() { | |||
| super.failed(); | |||
| //lvFallPlaceholder.setText("Laden fehlgeschlagen!"); | |||
| getException().printStackTrace(); | |||
| decreaseParallelTaskCount(); | |||
| } | |||
| })); | |||
| }; | |||
| Thread thread = new Thread(loadCaseData); | |||
| thread.setDaemon(true); | |||
| thread.start(); | |||
| increaseParallelTaskCount(); | |||
| } | |||
| public void refreshCaseData(){ | |||
| refreshCaseData(lvFall.getSelectionModel().getSelectedItem()); | |||
| } | |||
| @FXML | |||
| private void clickedCreateFall(){ | |||
| private void clickedCreateFall() { | |||
| // tabFallDiagnose.setDisable(true); | |||
| // tabFallUntersuchungen.setDisable(true); | |||
| // tabFallStationsHistorie.setDisable(true); | |||
| // tabPaneFall.getSelectionModel().select(tabFallOverview); | |||
| // patientTablesController.getPatientOverviewTabPane().setDisable(true); | |||
| // | |||
| // | |||
| fallController.createNewFall(); | |||
| lockForEdit(TabName.OVERVIEW); | |||
| } | |||
| public Fall getFall(){ | |||
| return lvFall.getSelectionModel().getSelectedItem(); | |||
| } | |||
| public ReadOnlyObjectProperty<Fall> fallProperty(){ | |||
| return lvFall.getSelectionModel().selectedItemProperty(); | |||
| } | |||
| public enum TabName { | |||
| OVERVIEW, DIAGNOSE, UNTERSUCHUNG, STATIONSHISTORIE; | |||
| } | |||
| public void lockForEdit(TabName exclude) { | |||
| tabFallDiagnose.setDisable(true); | |||
| tabFallUntersuchungen.setDisable(true); | |||
| tabFallStationsHistorie.setDisable(true); | |||
| tabPaneFall.getSelectionModel().select(tabFallOverview); | |||
| tabFallOverview.setDisable(true); | |||
| lvFall.setDisable(true); | |||
| btnFallCreate.setDisable(true); | |||
| patientTablesController.getPatientOverviewTabPane().setDisable(true); | |||
| switch (exclude) { | |||
| case OVERVIEW: | |||
| tabFallOverview.setDisable(false); | |||
| break; | |||
| case DIAGNOSE: | |||
| tabFallDiagnose.setDisable(false); | |||
| break; | |||
| case UNTERSUCHUNG: | |||
| tabFallUntersuchungen.setDisable(false); | |||
| break; | |||
| case STATIONSHISTORIE: | |||
| tabFallStationsHistorie.setDisable(false); | |||
| default: | |||
| break; | |||
| } | |||
| fallController.createNewFall(); | |||
| } | |||
| public void fallCreationComplete(){ | |||
| public void unlockFromEdit() { | |||
| tabFallDiagnose.setDisable(false); | |||
| tabFallUntersuchungen.setDisable(false); | |||
| tabFallStationsHistorie.setDisable(false); | |||
| tabFallOverview.setDisable(false); | |||
| patientTablesController.getPatientOverviewTabPane().setDisable(false); | |||
| lvFall.setDisable(false); | |||
| btnFallCreate.setDisable(false); | |||
| } | |||
| public Mitarbeiter getCurrentMitarbeiter() { | |||
| return cmbUserChoose==null?null:cmbUserChoose.getValue(); | |||
| } | |||
| public ReadOnlyObjectProperty<Mitarbeiter> currentMitarbeiterProperty() { | |||
| return cmbUserChoose.valueProperty(); | |||
| } | |||
| } | |||
| @@ -8,9 +8,9 @@ import de.uniluebeck.mi.projmi6.db.DBHandler; | |||
| import de.uniluebeck.mi.projmi6.model.Kasse; | |||
| import de.uniluebeck.mi.projmi6.model.Patient; | |||
| import javafx.collections.FXCollections; | |||
| import javafx.event.ActionEvent; | |||
| import javafx.fxml.FXML; | |||
| import javafx.scene.control.*; | |||
| import javafx.event.ActionEvent; | |||
| import javafx.stage.Stage; | |||
| import java.sql.SQLException; | |||
| @@ -45,6 +45,9 @@ public class PatientEditorController { | |||
| private TextField patNachname; | |||
| @FXML | |||
| private TextField patTelefonnummer; | |||
| @FXML | |||
| private TextField patStrasse; | |||
| @FXML | |||
| private TextField patHausnummer; | |||
| @@ -75,36 +78,33 @@ public class PatientEditorController { | |||
| private Button btnPatSave; | |||
| public PatientEditorController(MainController mainController) { | |||
| this.mainController = mainController; | |||
| } | |||
| @FXML | |||
| public void initialize(){ | |||
| public void initialize() { | |||
| patGeschlecht.setItems(FXCollections.observableArrayList(Patient.Geschlecht.values())); | |||
| patFamilienstand.setItems(FXCollections.observableArrayList(Patient.Familienstand.values())); | |||
| patVersicherung.setItems(mainController.getKassen()); | |||
| } | |||
| public PatientEditorController(MainController mainController){ | |||
| this.mainController = mainController; | |||
| patVersicherung.setItems(mainController.getStammdaten().getKassen()); | |||
| } | |||
| public void setPatient(Patient patient){ | |||
| public void setPatient(Patient patient) { | |||
| this.patient = patient; | |||
| if(patient==null){ | |||
| if (patient == null) { | |||
| clearFields(); | |||
| }else { | |||
| } else { | |||
| copyPatientDataIntoFields(); | |||
| } | |||
| } | |||
| private void copyPatientDataIntoFields(){ | |||
| private void copyPatientDataIntoFields() { | |||
| patId.setText(Integer.toString(patient.getPatID())); | |||
| patGeburtsname.setText(patient.getGeburtsname()); | |||
| patNachname.setText(patient.getNachname()); | |||
| patVorname.setText(patient.getVorname()); | |||
| patTelefonnummer.setText(patient.getTelefon()); | |||
| patStrasse.setText(patient.getStrasse()); | |||
| patHausnummer.setText(patient.getHausnummer()); | |||
| patPlz.setText(patient.getPlz()); | |||
| @@ -113,7 +113,12 @@ public class PatientEditorController { | |||
| patFamilienstand.setValue(patient.getFamilienstand()); | |||
| patGeschlecht.setValue(patient.getGeschlecht()); | |||
| patVersicherungsnummer.setText(patient.getVersichertennummer()); | |||
| // patVersicherung.setValue(patient.getVersicherung()); TODO | |||
| for (Kasse kasse : patVersicherung.getItems()) { | |||
| if (kasse.getKassenID() == patient.getKassenID()) { | |||
| patVersicherung.getSelectionModel().select(kasse); | |||
| break; | |||
| } | |||
| } | |||
| patCave.setText(patient.getCave()); | |||
| patCreator.setText(Integer.toString(patient.getErsteller())); | |||
| @@ -122,7 +127,7 @@ public class PatientEditorController { | |||
| patChangeTime.setText(patient.getBearbeitetDatumZeit().toString()); | |||
| } | |||
| private void showMessage(String title, String message){ | |||
| private void showMessage(String title, String message) { | |||
| Alert alert = new Alert(Alert.AlertType.INFORMATION); | |||
| alert.setTitle("Ung\u00fcltige Daten!"); | |||
| alert.setHeaderText(title); | |||
| @@ -131,26 +136,28 @@ public class PatientEditorController { | |||
| alert.showAndWait(); | |||
| } | |||
| private void copyFieldDataIntoPatient(Patient patient){ | |||
| private void copyFieldDataIntoPatient(Patient patient) { | |||
| patient.setGeburtsname(patGeburtsname.getText()); | |||
| patient.setNachname(patNachname.getText()); | |||
| patient.setVorname(patVorname.getText()); | |||
| patient.setTelefon(patTelefonnummer.getText()); | |||
| patient.setStrasse(patStrasse.getText()); | |||
| patient.setHausnummer(patHausnummer.getText()); | |||
| patient.setPlz(patPlz.getText()); | |||
| patient.setOrt(patOrt.getText()); | |||
| patient.setGeburtsdatum(patGeburtsdatum.getValue()); | |||
| patient.setFamilienstand(patFamilienstand.getValue()); | |||
| patient.setGeschlecht(patient.getGeschlecht()); | |||
| patient.setGeschlecht(patGeschlecht.getValue()); | |||
| patient.setVersichertennummer(patVersicherungsnummer.getText()); | |||
| //patient.setVersicherung TODO | |||
| if (patVersicherung.getSelectionModel().getSelectedItem() != null) | |||
| patient.setKassenID(patVersicherung.getSelectionModel().getSelectedItem().getKassenID()); | |||
| patient.setCave(patCave.getText()); | |||
| } | |||
| private boolean validateData(){ | |||
| if(!patPlz.getText().matches("[0-9]{5}")){ | |||
| private boolean validateData() { | |||
| if (!patPlz.getText().matches("[0-9]{5}") && !(patPlz.getText().length() == 0)) { | |||
| showMessage("Die eingegebene PLZ ist ung\u00fcltig!", | |||
| "Postleitzahlen m\u00fcssen aus exakt 5 Ziffern bestehen!"); | |||
| return false; | |||
| @@ -161,21 +168,22 @@ public class PatientEditorController { | |||
| // TODO: Remove default values. | |||
| private void clearFields(){ | |||
| private void clearFields() { | |||
| patId.setText("<auto>"); | |||
| patGeburtsname.setText(""); | |||
| patNachname.setText("Peter"); | |||
| patVorname.setText("Hans"); | |||
| patNachname.setText(""); | |||
| patVorname.setText(""); | |||
| patStrasse.setText(""); | |||
| patHausnummer.setText(""); | |||
| patPlz.setText("12345"); | |||
| patPlz.setText(""); | |||
| patOrt.setText(""); | |||
| patGeburtsdatum.setValue(LocalDate.of(1988, 4, 7)); | |||
| patFamilienstand.setValue(Patient.Familienstand.VERWITWET); | |||
| patGeschlecht.setValue(null); | |||
| patTelefonnummer.setText(""); | |||
| patGeburtsdatum.setValue(LocalDate.of(1900, 1, 1)); | |||
| patFamilienstand.setValue(Patient.Familienstand.LEDIG); | |||
| patGeschlecht.setValue(Patient.Geschlecht.FEMALE); | |||
| patVersicherungsnummer.setText(""); | |||
| patVersicherung.setValue(null); | |||
| patCave.setText("Angst"); | |||
| patCave.setText(""); | |||
| patCreator.setText("todo"); | |||
| patCreateTime.setText("<auto>"); | |||
| @@ -185,34 +193,34 @@ public class PatientEditorController { | |||
| @FXML | |||
| void clickedSave(ActionEvent event) { | |||
| if(!validateData()){ | |||
| if (!validateData()) { | |||
| return; | |||
| } | |||
| if(patient==null){ | |||
| if (patient == null) { | |||
| patient = new Patient(); | |||
| copyFieldDataIntoPatient(patient); | |||
| try { | |||
| DBHandler.insertPatient(patient, 1003); | |||
| DBHandler.setPatient(patient, mainController.getCurrentMitarbeiter().getMitarbID(), false); | |||
| mainController.getPatientTablesController().updatePatientsFromDb(); | |||
| ((Stage) patNachname.getScene().getWindow()).close(); | |||
| } catch (SQLException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| //Create new db entry TODO | |||
| }else{ | |||
| } else { | |||
| copyFieldDataIntoPatient(patient); | |||
| //Update db entry... TODO | |||
| try { | |||
| DBHandler.updatePatient(patient, 1005); // TODO: MitarbeiterID uebergeben! | |||
| DBHandler.setPatient(patient, mainController.getCurrentMitarbeiter().getMitarbID(), true); | |||
| ((Stage) patNachname.getScene().getWindow()).close(); | |||
| } catch (SQLException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| } | |||
| ((Stage)patNachname.getScene().getWindow()).close(); | |||
| } | |||
| @FXML | |||
| void clickedAbort(ActionEvent event) { | |||
| ((Stage)patVorname.getScene().getWindow()).close(); //Close Window | |||
| ((Stage) patVorname.getScene().getWindow()).close(); //Close Window | |||
| } | |||
| } | |||
| @@ -3,17 +3,18 @@ package de.uniluebeck.mi.projmi6.controller; | |||
| /** | |||
| * Created by Johannes on 12.11.15. | |||
| */ | |||
| import de.uniluebeck.mi.projmi6.db.DBHandler; | |||
| import de.uniluebeck.mi.projmi6.model.Patient; | |||
| import de.uniluebeck.mi.projmi6.model.Station; | |||
| import de.uniluebeck.mi.projmi6.model.StationsUebersichtsItem; | |||
| import de.uniluebeck.mi.projmi6.view.SelectKeyComboBoxListener; | |||
| import javafx.beans.binding.Bindings; | |||
| import javafx.beans.binding.ObjectBinding; | |||
| import javafx.beans.property.ObjectProperty; | |||
| import javafx.beans.property.ReadOnlyObjectProperty; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| import javafx.collections.FXCollections; | |||
| import javafx.collections.ObservableList; | |||
| import javafx.collections.transformation.FilteredList; | |||
| import javafx.concurrent.Task; | |||
| import javafx.fxml.FXML; | |||
| import javafx.fxml.FXMLLoader; | |||
| import javafx.scene.Parent; | |||
| @@ -25,110 +26,86 @@ import javafx.stage.Modality; | |||
| import javafx.stage.Stage; | |||
| import java.io.IOException; | |||
| import java.rmi.server.ExportException; | |||
| import java.sql.SQLException; | |||
| import java.time.LocalDate; | |||
| import java.util.List; | |||
| /** | |||
| * Controller class. | |||
| */ | |||
| public class PatientTablesController{ | |||
| public class PatientTablesController { | |||
| @FXML | |||
| Button btnStatRefresh; | |||
| private MainController mainController; | |||
| @FXML | |||
| private Label lblTablePatientEmpty; | |||
| @FXML | |||
| private Label lblTableStationEmpty; | |||
| @FXML | |||
| private Button btnPatCreate; | |||
| @FXML | |||
| private Button btnPatEdit; | |||
| @FXML | |||
| private TableView<Patient> tblPatientOverview; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatPatId; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatGeburtsname; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatNachname; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatVorname; | |||
| @FXML | |||
| private TableColumn<Patient, LocalDate> colPatGebDatum; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatStrasse; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatPlz; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatOrt; | |||
| @FXML | |||
| private TableColumn<Patient, String> colPatCave; | |||
| @FXML | |||
| private ToggleButton btnEntlassenePatientenZeigen; | |||
| @FXML | |||
| private ComboBox<Station> cmbStationenFilter; | |||
| @FXML | |||
| private TableView<StationsUebersichtsItem> tblStationOverview; | |||
| @FXML | |||
| private TableColumn<StationsUebersichtsItem, String> colStatPatId; | |||
| private TableColumn<StationsUebersichtsItem, Integer> colStatPatId; | |||
| @FXML | |||
| private TableColumn<StationsUebersichtsItem, String> colStatFullName; | |||
| @FXML | |||
| private TableColumn<StationsUebersichtsItem, String> colStatGebDatum; | |||
| private TableColumn<StationsUebersichtsItem, LocalDate> colStatGebDatum; | |||
| @FXML | |||
| private TableColumn<StationsUebersichtsItem, String> colStatAlter; | |||
| private TableColumn<StationsUebersichtsItem, Integer> colStatAlter; | |||
| @FXML | |||
| private TableColumn<StationsUebersichtsItem, String> colStatAufnahmedatum; | |||
| private TableColumn<StationsUebersichtsItem, LocalDate> colStatAufnahmedatum; | |||
| @FXML | |||
| private TableColumn<StationsUebersichtsItem, String> colStatEntlassungsdatum; | |||
| private TableColumn<StationsUebersichtsItem, LocalDate> colStatEntlassungsdatum; | |||
| @FXML | |||
| private Tab stationOverviewTab; | |||
| public TabPane getPatientOverviewTabPane() { | |||
| return patientOverviewTabPane; | |||
| } | |||
| @FXML | |||
| private Tab patientOverviewTab; | |||
| @FXML | |||
| private TabPane patientOverviewTabPane; | |||
| private TabPane patientOverviewTabPane; | |||
| private ObservableList<StationsUebersichtsItem> stationsUebersicht = FXCollections.observableArrayList(); | |||
| private FilteredList<StationsUebersichtsItem> stationsUebersichtsItemFilteredList = new FilteredList<StationsUebersichtsItem>(stationsUebersicht, | |||
| item -> item.getStationEntlassung() == null || item.getStationEntlassung().isAfter(LocalDate.now())); | |||
| private Task loadStationsHistorieTask = null; | |||
| private Task loadPatientTask = null; | |||
| @FXML | |||
| private Button btnPatRefresh; | |||
| private ObjectBinding<Patient> patientObjectBinding = null; | |||
| public PatientTablesController(MainController mainController){ | |||
| public PatientTablesController(MainController mainController) { | |||
| this.mainController = mainController; | |||
| } | |||
| public TabPane getPatientOverviewTabPane() { | |||
| return patientOverviewTabPane; | |||
| } | |||
| @FXML | |||
| public void initialize() { | |||
| @@ -136,41 +113,42 @@ public class PatientTablesController{ | |||
| tblPatientOverview.setRowFactory(tableView -> { | |||
| TableRow<Patient> tableRow = new TableRow<>(); | |||
| tableRow.setOnMouseClicked(event -> { | |||
| if(event.getClickCount()==2 && (!tableRow.isEmpty())){ | |||
| if (event.getClickCount() == 2 && (!tableRow.isEmpty())) { | |||
| Patient patient = tableRow.getItem(); | |||
| showEditWindow(patient); | |||
| } | |||
| }); | |||
| return tableRow; | |||
| return tableRow; | |||
| }); | |||
| lblTablePatientEmpty.setText("Liste ist leer."); | |||
| lblTableStationEmpty.setText("Daten werden geladen..."); | |||
| cmbStationenFilter.itemsProperty().bind(mainController.stationenProperty()); | |||
| ObservableList<Patient> patientList = null; | |||
| try { | |||
| patientList = FXCollections.<Patient>observableArrayList(DBHandler.getAllPatients()); | |||
| } catch (SQLException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| patientObjectBinding = Bindings.<Patient>createObjectBinding(() ->{ | |||
| return patientOverviewTabPane.getSelectionModel().getSelectedItem().equals(patientOverviewTab) | |||
| ? tblPatientOverview.getSelectionModel().getSelectedItem() | |||
| : null; //(Patient)tblStationOverview.getSelectionModel().getSelectedItem(); //TODO | |||
| tblStationOverview.disableProperty().bind(cmbStationenFilter.valueProperty().isNull()); | |||
| cmbStationenFilter.itemsProperty().bind(mainController.getStammdaten().stationenProperty()); | |||
| new SelectKeyComboBoxListener(cmbStationenFilter); | |||
| patientObjectBinding = Bindings.<Patient>createObjectBinding(() -> { | |||
| if (patientOverviewTabPane.getSelectionModel().getSelectedItem().equals(patientOverviewTab)) { | |||
| return tblPatientOverview.getSelectionModel().getSelectedItem(); | |||
| } else if (tblStationOverview.getSelectionModel().getSelectedItem() == null) { | |||
| return null; | |||
| } else { | |||
| int selectedPatId = tblStationOverview.getSelectionModel().getSelectedItem().getPatId(); | |||
| Patient selectedPatient = tblPatientOverview.getItems().stream().filter(p -> p.getPatID() == selectedPatId).findFirst().orElse(null); | |||
| return selectedPatient; | |||
| } | |||
| }, tblPatientOverview.getSelectionModel().selectedItemProperty(), | |||
| tblStationOverview.getSelectionModel().selectedItemProperty(), | |||
| patientOverviewTabPane.getSelectionModel().selectedItemProperty()); | |||
| tblPatientOverview.setItems(patientList); | |||
| initColumnsPatient(); | |||
| initColumnsStation(); | |||
| updatePatientsFromDb(); | |||
| } | |||
| private void initColumnsPatient(){ | |||
| private void initColumnsPatient() { | |||
| colPatPatId.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().patIDProperty().asString()); | |||
| colPatGeburtsname.setCellValueFactory(new PropertyValueFactory<>("geburtsname")); | |||
| colPatNachname.setCellValueFactory(new PropertyValueFactory<>("nachname")); | |||
| @@ -178,51 +156,61 @@ public class PatientTablesController{ | |||
| colPatGebDatum.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().geburtsdatumProperty()); | |||
| colPatStrasse.setCellValueFactory(cellDataFeatures -> { | |||
| Patient patient = cellDataFeatures.getValue(); | |||
| return Bindings.concat(patient.strasseProperty(), " ", patient.hausnummerProperty()); | |||
| return Bindings.concat(patient.strasseProperty(), " ", patient.hausnummerProperty()); | |||
| }); | |||
| colPatPlz.setCellValueFactory(new PropertyValueFactory<>("plz")); | |||
| colPatOrt.setCellValueFactory(new PropertyValueFactory<>("ort")); | |||
| colPatCave.setCellValueFactory(new PropertyValueFactory<>("cave")); | |||
| } | |||
| private void initColumnsStation(){ | |||
| colStatPatId.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().patIdProperty().asString()); | |||
| private void initColumnsStation() { | |||
| colStatPatId.setCellValueFactory(new PropertyValueFactory<StationsUebersichtsItem, Integer>("patId")); | |||
| colStatFullName.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().patNameProperty()); | |||
| colStatGebDatum.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().patBirthdateProperty().asString()); | |||
| colStatAlter.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().patAgeProperty().asString()); | |||
| colStatAufnahmedatum.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().stationAufnahmeProperty().asString()); | |||
| colStatEntlassungsdatum.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().stationEntlassungProperty().asString()); | |||
| colStatGebDatum.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().patBirthdateProperty()); | |||
| colStatAlter.setCellValueFactory(new PropertyValueFactory<StationsUebersichtsItem, Integer>("patAge")); | |||
| colStatAufnahmedatum.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().stationAufnahmeProperty()); | |||
| colStatEntlassungsdatum.setCellValueFactory(cellDataFeatures -> cellDataFeatures.getValue().stationEntlassungProperty()); | |||
| cmbStationenFilter.valueProperty().addListener((observableValue, oldValue, newValue) -> { | |||
| updateStationsHistorieFromDb(); | |||
| }); | |||
| tblStationOverview.itemsProperty().bind(Bindings.createObjectBinding(() -> { | |||
| if (btnEntlassenePatientenZeigen.isSelected()) { | |||
| return stationsUebersicht; | |||
| } else { | |||
| return stationsUebersichtsItemFilteredList; | |||
| } | |||
| }, btnEntlassenePatientenZeigen.selectedProperty())); | |||
| } | |||
| @FXML | |||
| private void clickedCreatePatient (){ | |||
| private void clickedCreatePatient() { | |||
| showEditWindow(null); | |||
| } | |||
| @FXML | |||
| private void clickedEditPatient(){ | |||
| private void clickedEditPatient() { | |||
| showEditWindow(tblPatientOverview.getSelectionModel().getSelectedItem()); | |||
| } | |||
| private void showEditWindow(Patient patient){ | |||
| private void showEditWindow(Patient patient) { | |||
| FXMLLoader fxmlLoader = new FXMLLoader(); | |||
| fxmlLoader.setLocation(getClass().getClassLoader().getResource("patient_edit.fxml")); | |||
| PatientEditorController patientEditorController = new PatientEditorController(mainController); | |||
| fxmlLoader.setControllerFactory(clazz -> patientEditorController); | |||
| Parent root = null; | |||
| try{ | |||
| try { | |||
| root = fxmlLoader.load(); | |||
| }catch (IOException e){ | |||
| } catch (IOException e) { | |||
| e.printStackTrace(); | |||
| return; | |||
| } | |||
| Stage stage = new Stage(); | |||
| stage.setTitle(patient==null ? "Neuen Patienten erstellen": "Patient bearbeiten"); | |||
| stage.setTitle(patient == null ? "Neuen Patienten erstellen" : "Patient bearbeiten"); | |||
| stage.setScene(new Scene(root, 600, 600)); | |||
| stage.getIcons().add(new Image("icon.png")); | |||
| @@ -233,15 +221,129 @@ public class PatientTablesController{ | |||
| stage.show(); | |||
| } | |||
| public void updatePatientsFromDb() { | |||
| if (this.loadPatientTask != null && this.loadPatientTask.isRunning()) { | |||
| System.out.println("Patienten werden bereits geladen."); | |||
| return; | |||
| } | |||
| private ObjectBinding<Patient> patientObjectBinding = null; | |||
| btnPatRefresh.setDisable(true); | |||
| tblPatientOverview.setItems(null); | |||
| mainController.increaseParallelTaskCount(); | |||
| lblTablePatientEmpty.setText("Liste wird geladen..."); | |||
| Task<List<Patient>> loadPatientsTask = new Task<List<Patient>>() { | |||
| public ObjectBinding<Patient> selectedPatientProperty(){ | |||
| @Override | |||
| protected List<Patient> call() throws Exception { | |||
| return FXCollections.<Patient>observableArrayList(DBHandler.getAllPatients()); | |||
| } | |||
| @Override | |||
| protected void succeeded() { | |||
| super.succeeded(); | |||
| btnPatRefresh.setDisable(false); | |||
| lblTablePatientEmpty.setText("Liste ist leer."); | |||
| tblPatientOverview.setItems(FXCollections.observableArrayList(this.getValue())); | |||
| mainController.decreaseParallelTaskCount(); | |||
| } | |||
| @Override | |||
| protected void failed() { | |||
| super.failed(); | |||
| btnPatRefresh.setDisable(false); | |||
| lblTablePatientEmpty.setText("Laden fehlgeschlagen!"); | |||
| mainController.decreaseParallelTaskCount(); | |||
| tblPatientOverview.setItems(null); | |||
| if (getException() != null) { | |||
| getException().printStackTrace(); | |||
| } | |||
| } | |||
| }; | |||
| this.loadPatientTask = loadPatientsTask; | |||
| Thread thread = new Thread(loadPatientsTask); | |||
| thread.setDaemon(true); | |||
| thread.start(); | |||
| } | |||
| @FXML | |||
| private void clickedRefreshStation() { | |||
| updateStationsHistorieFromDb(); | |||
| } | |||
| public void updateStationsHistorieFromDb() { | |||
| if (this.loadStationsHistorieTask != null) { | |||
| loadStationsHistorieTask.cancel(); | |||
| } | |||
| lblTableStationEmpty.setText("Liste wird geladen..."); | |||
| btnStatRefresh.setDisable(true); | |||
| stationsUebersicht.clear(); | |||
| mainController.increaseParallelTaskCount(); | |||
| Task<List<StationsUebersichtsItem>> loadStatHist = new Task<List<StationsUebersichtsItem>>() { | |||
| @Override | |||
| protected List<StationsUebersichtsItem> call() throws Exception { | |||
| return FXCollections.<StationsUebersichtsItem>observableArrayList( | |||
| DBHandler.getStationsUebersichtsItems(cmbStationenFilter.getValue().getStation())); | |||
| } | |||
| @Override | |||
| protected void succeeded() { | |||
| super.succeeded(); | |||
| if (!isCancelled()) { | |||
| lblTableStationEmpty.setText("Liste ist leer."); | |||
| stationsUebersicht.setAll(this.getValue()); | |||
| btnStatRefresh.setDisable(false); | |||
| mainController.decreaseParallelTaskCount(); | |||
| } | |||
| } | |||
| @Override | |||
| protected void cancelled() { | |||
| super.cancelled(); | |||
| mainController.decreaseParallelTaskCount(); | |||
| } | |||
| @Override | |||
| protected void failed() { | |||
| super.failed(); | |||
| if (!isCancelled()) { | |||
| lblTableStationEmpty.setText("Laden fehlgeschlagen!"); | |||
| getException().printStackTrace(); | |||
| btnStatRefresh.setDisable(false); | |||
| mainController.decreaseParallelTaskCount(); | |||
| } | |||
| } | |||
| }; | |||
| this.loadStationsHistorieTask = loadStatHist; | |||
| Thread thread = new Thread(loadStationsHistorieTask); | |||
| thread.setDaemon(true); | |||
| thread.start(); | |||
| } | |||
| @FXML | |||
| private void clickedRefreshPatient() { | |||
| updatePatientsFromDb(); | |||
| } | |||
| public ObjectBinding<Patient> selectedPatientProperty() { | |||
| return patientObjectBinding; | |||
| } | |||
| public Patient getSelectedPatient(){ | |||
| public Patient getSelectedPatient() { | |||
| return selectedPatientProperty().get(); | |||
| } | |||
| } | |||
| @@ -1,63 +1,244 @@ | |||
| package de.uniluebeck.mi.projmi6.controller; | |||
| import de.uniluebeck.mi.projmi6.model.Fall; | |||
| import de.uniluebeck.mi.projmi6.db.DBHandler; | |||
| import de.uniluebeck.mi.projmi6.model.Station; | |||
| import de.uniluebeck.mi.projmi6.model.StationsHistorie; | |||
| import de.uniluebeck.mi.projmi6.model.Untersuchung; | |||
| import de.uniluebeck.mi.projmi6.view.DateTimePicker; | |||
| import de.uniluebeck.mi.projmi6.view.SelectKeyComboBoxListener; | |||
| import javafx.beans.binding.Bindings; | |||
| import javafx.beans.property.ReadOnlyObjectProperty; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| import javafx.collections.FXCollections; | |||
| import javafx.collections.ObservableList; | |||
| import javafx.collections.transformation.FilteredList; | |||
| import javafx.fxml.FXML; | |||
| import javafx.scene.control.Button; | |||
| import javafx.scene.control.Label; | |||
| import javafx.scene.control.TableColumn; | |||
| import javafx.scene.control.TableView; | |||
| import javafx.scene.control.*; | |||
| import javafx.scene.control.cell.PropertyValueFactory; | |||
| import javafx.scene.layout.GridPane; | |||
| import javafx.stage.Modality; | |||
| import java.sql.SQLException; | |||
| import java.time.LocalDate; | |||
| import java.time.LocalDateTime; | |||
| import java.util.Collections; | |||
| import java.util.List; | |||
| import java.util.stream.Collectors; | |||
| /** | |||
| * Created by 631806 on 12.11.15. | |||
| */ | |||
| public class StationsHistorieController { | |||
| @FXML | |||
| public Button btnStatHistAbort; | |||
| SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW); | |||
| @FXML | |||
| GridPane fields; | |||
| @FXML | |||
| Button btnStatHistEdit; | |||
| @FXML | |||
| Button btnStatHistDelete; | |||
| /** | |||
| * The station history that is shown in the edit window, or null if a new station history should be created. | |||
| */ | |||
| private StationsHistorie stationsHistorie = null; | |||
| private StationsHistorie stationsHistorieSelected = null; | |||
| private MainController mainController; | |||
| @FXML | |||
| private TableView<?>tblStationsHistorie; | |||
| private TableView<StationsHistorie>tblStationsHistorie; | |||
| @FXML | |||
| private Button btnStatHistCancel, btnStatHistSave; | |||
| @FXML | |||
| private Label statHistCreator, statHistCreatTime, statHistEditor, statHistEditTime; | |||
| private Label statHistCreator, statHistCreateTime, statHistEditor, statHistEditTime; | |||
| @FXML | |||
| private TableColumn<?,?> colStatHistAbteilung, colStatHistStation, colStatHistAufnahmeDatum, colStatHistEntlassungsDatum; | |||
| private TableColumn<StationsHistorie,String> colStatHistStation; | |||
| @FXML | |||
| private TableColumn<StationsHistorie,LocalDate> colStatHistAufnahmeDatum, colStatHistEntlassungsDatum; | |||
| @FXML | |||
| private DateTimePicker dtTmAufnahme, dtTmEntlassung; | |||
| @FXML | |||
| private ComboBox<Station> cmbStation; | |||
| @FXML | |||
| private ComboBox<String> cmbAbteilung; | |||
| private SimpleObjectProperty<ObservableList<StationsHistorie>> stationsHistorie = | |||
| new SimpleObjectProperty<>(); | |||
| @FXML | |||
| private Button btnStatHistCreate; | |||
| public StationsHistorieController(MainController mainController){ | |||
| public StationsHistorieController(MainController mainController) { | |||
| this.mainController = mainController; | |||
| } | |||
| @FXML | |||
| private void clickedCancel(){ | |||
| private void clickedEdit() { | |||
| this.state.set(State.EDIT); | |||
| } | |||
| public State getState() { | |||
| return state.get(); | |||
| } | |||
| public ReadOnlyObjectProperty<State> stateProperty() { | |||
| return state; | |||
| } | |||
| @FXML | |||
| private void initialize() { | |||
| initColumns(); | |||
| initStationsFilter(); | |||
| initButtons(); | |||
| fields.disableProperty().bind(stateProperty().isEqualTo(State.VIEW)); | |||
| btnStatHistCreate.disableProperty().bind(mainController.fallProperty().isNull()); | |||
| state.addListener((observable, oldValue, newValue) -> { | |||
| if (newValue == State.CREATE || newValue == State.EDIT) { | |||
| mainController.lockForEdit(MainController.TabName.STATIONSHISTORIE); | |||
| } else { | |||
| mainController.unlockFromEdit(); | |||
| } | |||
| }); | |||
| tblStationsHistorie.itemsProperty().bind(stationsHistorie); | |||
| tblStationsHistorie.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> { | |||
| setStationsHistorieSelected(newValue); | |||
| }); | |||
| } | |||
| private void initButtons(){ | |||
| btnStatHistCancel.visibleProperty().bind(state.isEqualTo(State.VIEW).and(tblStationsHistorie.getSelectionModel().selectedItemProperty().isNotNull())); | |||
| btnStatHistCancel.managedProperty().bind(btnStatHistCancel.visibleProperty()); | |||
| btnStatHistSave.visibleProperty().bind(state.isEqualTo(State.VIEW).not()); | |||
| btnStatHistSave.managedProperty().bind(btnStatHistSave.visibleProperty()); | |||
| btnStatHistAbort.visibleProperty().bind(state.isEqualTo(State.VIEW).not()); | |||
| btnStatHistAbort.managedProperty().bind(btnStatHistAbort.visibleProperty()); | |||
| btnStatHistEdit.visibleProperty().bind(state.isEqualTo(State.VIEW) | |||
| .and(tblStationsHistorie.getSelectionModel().selectedItemProperty().isNotNull())); | |||
| btnStatHistEdit.managedProperty().bind(btnStatHistEdit.visibleProperty()); | |||
| btnStatHistDelete.visibleProperty().bind(btnStatHistEdit.visibleProperty()); | |||
| btnStatHistDelete.managedProperty().bind(btnStatHistDelete.visibleProperty()); | |||
| } | |||
| private void initStationsFilter(){ | |||
| final String any = "beliebig"; | |||
| List<String> abteilungen = mainController.getStammdaten().getStationen().stream() | |||
| .map(stat->stat.getAbteilung()).distinct().collect(Collectors.toList()); | |||
| Collections.sort(abteilungen); | |||
| cmbAbteilung.setItems(FXCollections.observableArrayList(abteilungen)); | |||
| cmbAbteilung.getItems().add(0, any); | |||
| cmbAbteilung.getSelectionModel().select(0); | |||
| new SelectKeyComboBoxListener(cmbAbteilung); | |||
| tblStationsHistorie.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { | |||
| setStationsHistorieSelected(newValue); | |||
| }); | |||
| FilteredList<Station> stationenFiltered = new FilteredList<Station>(mainController.getStammdaten().getStationen()); | |||
| stationenFiltered.predicateProperty().bind(Bindings.createObjectBinding(() -> { | |||
| if(cmbAbteilung.getValue()==null || cmbAbteilung.getValue().equals(any)){ | |||
| return p->true; | |||
| } | |||
| return p -> p.getAbteilung().equals(cmbAbteilung.getValue()); | |||
| },cmbAbteilung.valueProperty())); | |||
| cmbStation.setItems(stationenFiltered); | |||
| new SelectKeyComboBoxListener(cmbStation); | |||
| } | |||
| @FXML | |||
| private void clickedCancel() { | |||
| // this.state.set(State.VIEW); | |||
| } | |||
| @FXML | |||
| private void clickedSave() { | |||
| if (getState() == State.CREATE) { | |||
| StationsHistorie stationsHistorie = new StationsHistorie(); | |||
| copyFieldDataIntoStationsHistorie(stationsHistorie); | |||
| try { | |||
| DBHandler.setStationsHistorie(stationsHistorie, false); | |||
| } catch (SQLException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| mainController.refreshCaseData(); | |||
| } else { | |||
| copyFieldDataIntoStationsHistorie(stationsHistorieSelected); | |||
| try { | |||
| DBHandler.setStationsHistorie(stationsHistorieSelected, true); | |||
| } catch (SQLException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| mainController.refreshCaseData(); | |||
| } | |||
| state.set(State.VIEW); | |||
| } | |||
| @FXML | |||
| private void clickedSave(){ | |||
| private void clickedAbort() { | |||
| state.set(State.VIEW); | |||
| copyStationsHistorieDataIntoFields(); | |||
| } | |||
| @FXML | |||
| private void clickedCreateAufenthalt() { | |||
| this.state.set(State.CREATE); | |||
| setStationsHistorieSelected(null); | |||
| } | |||
| @FXML | |||
| private void clickedCreateAufenthalt(){ | |||
| private void clickedDelete() { | |||
| StationsHistorie selectedItem = tblStationsHistorie.getSelectionModel().getSelectedItem(); | |||
| if (!LocalDateTime.now().isBefore(selectedItem.getAufnahmeDatum())) { | |||
| Alert alert = new Alert(Alert.AlertType.WARNING); | |||
| alert.setTitle("Stationsaufenthalt kann nicht entfernt werden!"); | |||
| alert.setHeaderText(null); | |||
| alert.setContentText("Der Aufenthalt muss in der Zukunft liegen, um gel\u00f6scht werden zu k\u00f6nnen!"); | |||
| alert.initOwner(btnStatHistCancel.getScene().getWindow()); | |||
| alert.initModality(Modality.APPLICATION_MODAL); | |||
| alert.showAndWait(); | |||
| return; | |||
| } | |||
| try { | |||
| DBHandler.delStationsHistorie(selectedItem); | |||
| } catch (Exception e) { | |||
| e.printStackTrace(); | |||
| } | |||
| mainController.refreshCaseData(); | |||
| } | |||
| public ObservableList<StationsHistorie> getStationsHistorie() { | |||
| return stationsHistorie.get(); | |||
| } | |||
| public void setStationsHistorie(ObservableList<StationsHistorie> stationsHistorie) { | |||
| this.stationsHistorie.set(stationsHistorie); | |||
| } | |||
| public SimpleObjectProperty<ObservableList<StationsHistorie>> stationsHistorieProperty() { | |||
| return stationsHistorie; | |||
| } | |||
| public void setStationsHistorie(StationsHistorie stationsHistorie){ | |||
| this.stationsHistorie = stationsHistorie; | |||
| public void setStationsHistorieSelected(StationsHistorie stationsHistorie){ | |||
| this.stationsHistorieSelected=stationsHistorie; | |||
| if(stationsHistorie==null){ | |||
| clearFields(); | |||
| }else { | |||
| @@ -66,47 +247,70 @@ public class StationsHistorieController { | |||
| } | |||
| private void copyStationsHistorieDataIntoFields(){ | |||
| // colStatHistAbteilung.setText(stationsHistorie.get()); | |||
| // colStatHistStation.setText(stationsHistorie.getStation()); | |||
| // colStatHistAufnahmeDatum.setDateTime(stationsHistorie.getAufnahmeDatum()); | |||
| // colStatHistEntlassungsDatum.setDateTime(stationsHistorie.getEntlassungsDatum()); | |||
| // dtTmAufnahme=setDateTime(stationsHistorie.getAufnahmeDatum()); | |||
| // dtTmEntlassung=setDateTime(stationsHistorie.getEntlassungsDatum()); | |||
| statHistCreator.setText(Integer.toString(stationsHistorie.getErsteller())); | |||
| statHistCreatTime.setText(stationsHistorie.getErstellDatumZeit().toString()); | |||
| statHistEditor.setText(Integer.toString(stationsHistorie.getBearbeiter())); | |||
| statHistEditTime.setText(stationsHistorie.getBearbeitetDatumZeit().toString()); | |||
| private void initColumns(){ | |||
| colStatHistStation.setCellValueFactory(new PropertyValueFactory<StationsHistorie, String>("stationKey")); | |||
| colStatHistAufnahmeDatum.setCellValueFactory(new PropertyValueFactory<StationsHistorie, LocalDate>("aufnahmeDatum")); | |||
| colStatHistEntlassungsDatum.setCellValueFactory(new PropertyValueFactory<StationsHistorie, LocalDate>("entlassungsDatum")); | |||
| } | |||
| private void copyFieldDataIntoStationsHistorie(StationsHistorie stationsHistorie){ | |||
| if(stationsHistorie==null){ | |||
| private void copyStationsHistorieDataIntoFields(){ | |||
| if(stationsHistorieSelected==null){ | |||
| clearFields(); | |||
| return; | |||
| } | |||
| // stationsHistorie.set(colStatHistAbteilung.getText()); | |||
| // stationsHistorie.setStation(colStatHistStation.getText()); | |||
| // stationsHistorie.setAufnahmeDatum(colStatHistAufnahmeDatum.getDateTime()); | |||
| // stationsHistorie.getEntlassungsDatum(colStatHistEntlassungsDatum.getDateTime()); | |||
| stationsHistorie.setAufnahmeDatum(dtTmAufnahme.getDateTime()); | |||
| // stationsHistorie.getEntlassungsDatum(dtTmEntlassung.getDateTime()); | |||
| //Setze Station im Dropdownfeld | |||
| for (Station station : cmbStation.getItems()) { | |||
| if(station.getStation().equals(stationsHistorieSelected.getStationKey())){ | |||
| cmbStation.getSelectionModel().select(station); | |||
| cmbAbteilung.getSelectionModel().select(station.getAbteilung()); | |||
| break; | |||
| } | |||
| } | |||
| dtTmAufnahme.setDateTime(stationsHistorieSelected.getAufnahmeDatum()); | |||
| dtTmEntlassung.setDateTime(stationsHistorieSelected.getEntlassungsDatum()); | |||
| statHistCreator.setText(Integer.toString(stationsHistorieSelected.getErsteller())); | |||
| if(stationsHistorieSelected.getErstellDatumZeit()!=null){ | |||
| statHistCreateTime.setText(stationsHistorieSelected.getErstellDatumZeit().toString()); | |||
| } | |||
| statHistEditor.setText(Integer.toString(stationsHistorieSelected.getBearbeiter())); | |||
| if (stationsHistorieSelected.getBearbeitetDatumZeit() != null) { | |||
| statHistEditTime.setText(stationsHistorieSelected.getBearbeitetDatumZeit().toString()); | |||
| } | |||
| } | |||
| private void copyFieldDataIntoStationsHistorie(StationsHistorie stationsHistorie){ | |||
| stationsHistorie.setAufnahmeDatum(dtTmAufnahme.getDateTime()); | |||
| stationsHistorie.setEntlassungsDatum(dtTmEntlassung.getDateTime()); | |||
| stationsHistorie.setStation(cmbStation.getValue()); | |||
| stationsHistorie.setFallID(mainController.getFallController().getFall().getFallID()); | |||
| stationsHistorie.setStationKey(cmbStation.getValue().getStation()); | |||
| stationsHistorie.setErsteller(mainController.getCurrentMitarbeiter().getMitarbID()); | |||
| stationsHistorie.setBearbeiter(mainController.getCurrentMitarbeiter().getMitarbID()); | |||
| } | |||
| private void clearFields(){ | |||
| //statHistCreateTime.setText("<auto>"); | |||
| //statHistCreator.setText("<auto>"); | |||
| //statHistEditTime.setText("<auto>"); | |||
| // statHistEditor.setText("<auto>"); | |||
| statHistCreateTime.setText(""); | |||
| statHistCreator.setText(""); | |||
| statHistEditTime.setText(""); | |||
| statHistEditor.setText(""); | |||
| cmbAbteilung.setValue(null); | |||
| cmbStation.setValue(null); | |||
| colStatHistAbteilung.setText(""); | |||
| colStatHistStation.setText(""); | |||
| // colStatHistAufnahmeDatum.setDateTime(null); | |||
| // colStatHistEntlassungsDatum.setDateTime(null); | |||
| dtTmAufnahme.setDateTime(null); | |||
| dtTmEntlassung.setDateTime(null); | |||
| dtTmEntlassung.setDateTime(null); | |||
| } | |||
| public enum State { | |||
| CREATE, EDIT, VIEW | |||
| } | |||
| } | |||
| @@ -4,26 +4,48 @@ package de.uniluebeck.mi.projmi6.controller; | |||
| * Created by 626947 on 12.11.15. | |||
| */ | |||
| import de.uniluebeck.mi.projmi6.Main; | |||
| import de.uniluebeck.mi.projmi6.model.*; | |||
| import de.uniluebeck.mi.projmi6.db.DBHandler; | |||
| import de.uniluebeck.mi.projmi6.model.Mitarbeiter; | |||
| import de.uniluebeck.mi.projmi6.model.OpsCode; | |||
| import de.uniluebeck.mi.projmi6.model.Untersuchung; | |||
| import de.uniluebeck.mi.projmi6.view.DateTimePicker; | |||
| import de.uniluebeck.mi.projmi6.view.SelectKeyComboBoxListener; | |||
| import javafx.beans.property.ReadOnlyObjectProperty; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| import javafx.collections.ObservableList; | |||
| import javafx.event.ActionEvent; | |||
| import javafx.fxml.FXML; | |||
| import javafx.scene.control.*; | |||
| import javafx.scene.layout.GridPane; | |||
| import javafx.scene.paint.Color; | |||
| import javafx.scene.text.Text; | |||
| import java.sql.SQLException; | |||
| public class UntersuchungenController { | |||
| /** | |||
| * The examination that is shown in the edit window, or null if a new examination should be created. | |||
| */ | |||
| private Untersuchung untersuchung = null; | |||
| public enum State { | |||
| CREATE, EDIT, VIEW | |||
| } | |||
| private final SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW); | |||
| private MainController mainController; | |||
| public State getState() { | |||
| return state.get(); | |||
| } | |||
| public ReadOnlyObjectProperty<State> stateProperty() { | |||
| return state; | |||
| } | |||
| private SimpleObjectProperty<ObservableList<Untersuchung>> untersuchungen = new SimpleObjectProperty<>(); | |||
| private MainController mainController; | |||
| @FXML | |||
| private Button btnUntsCancel; | |||
| @@ -54,61 +76,162 @@ public class UntersuchungenController { | |||
| @FXML | |||
| private ComboBox<OpsCode> untsOpsCode; | |||
| @FXML | |||
| private ComboBox<Mitarbeiter> untsArzt; | |||
| public UntersuchungenController(MainController mainController) { | |||
| this.mainController = mainController; | |||
| } | |||
| public ObservableList<Untersuchung> getUntersuchungen() { | |||
| return untersuchungen.get(); | |||
| } | |||
| public void setUntersuchungen(ObservableList<Untersuchung> untersuchungen) { | |||
| this.untersuchungen.set(untersuchungen); | |||
| } | |||
| public SimpleObjectProperty<ObservableList<Untersuchung>> untersuchungenProperty() { | |||
| return untersuchungen; | |||
| } | |||
| public void setUntersuchungen(ObservableList<Untersuchung> untersuchungen) { | |||
| this.untersuchungen.set(untersuchungen); | |||
| private void initComboBoxes(){ | |||
| untsOpsCode.itemsProperty().bind(mainController.getStammdaten().opsCodesProperty()); | |||
| new SelectKeyComboBoxListener(untsOpsCode); | |||
| untsList.itemsProperty().bind(untersuchungen); | |||
| untsArzt.itemsProperty().bind(mainController.getStammdaten().mitarbeiterProperty()); | |||
| } | |||
| private SimpleObjectProperty<ObservableList<Untersuchung>> untersuchungen = new SimpleObjectProperty<>(); | |||
| private void initButtons(){ | |||
| btnUntsCreate.disableProperty().bind(mainController.fallProperty().isNull()); | |||
| public UntersuchungenController (MainController mainController){ | |||
| this.mainController = mainController; | |||
| btnUntsCancel.managedProperty().bind(state.isEqualTo(State.VIEW) | |||
| .and(untsList.getSelectionModel().selectedItemProperty().isNotNull())); | |||
| btnUntsCancel.visibleProperty().bind(btnUntsCreate.managedProperty()); | |||
| btnUntsSave.managedProperty().bind(state.isNotEqualTo(State.VIEW)); | |||
| btnUntsSave.visibleProperty().bind(btnUntsSave.managedProperty()); | |||
| btnUntsAbort.managedProperty().bind(btnUntsSave.managedProperty()); | |||
| btnUntsAbort.visibleProperty().bind(btnUntsSave.managedProperty()); | |||
| } | |||
| @FXML | |||
| public void initialize(){ | |||
| untsOpsCode.itemsProperty().bind(mainController.opsCodesProperty()); | |||
| untsList.itemsProperty().bind(untersuchungen); | |||
| private Button btnUntsAbort; | |||
| @FXML | |||
| public void initialize(){ | |||
| //Clear fields on startup | |||
| copyUntersuchungDataIntoFields(); | |||
| initComboBoxes(); | |||
| initButtons(); | |||
| untsList.getSelectionModel().selectedItemProperty().addListener( | |||
| (observable, oldVal, newVal) -> copyUntersuchungDataIntoFields()); | |||
| fields.disableProperty().bind(state.isEqualTo(State.VIEW)); | |||
| state.addListener((observable, oldValue, newValue) -> { | |||
| if(newValue==State.VIEW){ | |||
| mainController.unlockFromEdit(); | |||
| }else{ | |||
| mainController.lockForEdit(MainController.TabName.UNTERSUCHUNG); | |||
| } | |||
| }); | |||
| untsList.disableProperty().bind(state.isNotEqualTo(State.VIEW)); | |||
| untsList.setCellFactory(lv -> { | |||
| return new ListCell<Untersuchung>(){ | |||
| @Override | |||
| protected void updateItem(Untersuchung item, boolean empty) { | |||
| super.updateItem(item, empty); | |||
| if(item==null||empty){ | |||
| setText(null); | |||
| setGraphic(null); | |||
| return; | |||
| } | |||
| setText(item.toString()); | |||
| if(item.getStorniert()){ | |||
| setTextFill(Color.GRAY); | |||
| Text text = new Text("<storniert> "); | |||
| text.setFill(Color.RED); | |||
| setGraphic(text); | |||
| }else{ | |||
| setTextFill(Color.BLACK); | |||
| setGraphic(null); | |||
| } | |||
| } | |||
| }; | |||
| }); | |||
| } | |||
| @FXML | |||
| void clickedUntsCreate(ActionEvent event) { | |||
| void clickedUntsCreate() { | |||
| this.state.set(State.CREATE); | |||
| clearFields(); | |||
| untsArzt.getSelectionModel().select(mainController.getCurrentMitarbeiter()); | |||
| } | |||
| @FXML | |||
| void clickedUntsCancel() { | |||
| Untersuchung untersuchung = untsList.getSelectionModel().getSelectedItem(); | |||
| if(untersuchung==null) { | |||
| return; | |||
| } | |||
| untersuchung.setStorniert(true); | |||
| try { | |||
| DBHandler.setUntersuchung(untersuchung, mainController.getCurrentMitarbeiter().getMitarbID(), true); | |||
| }catch (Exception e){ | |||
| e.printStackTrace(); | |||
| } | |||
| mainController.refreshCaseData(); | |||
| } | |||
| @FXML | |||
| void clickedUntsAbort(ActionEvent event) { | |||
| GridPane fields; | |||
| @FXML | |||
| private void clickedUntsAbort(){ | |||
| state.set(State.VIEW); | |||
| copyUntersuchungDataIntoFields(); | |||
| } | |||
| @FXML | |||
| void clickedUntsSave(ActionEvent event) { | |||
| if (state.get() == State.CREATE) { | |||
| Untersuchung untersuchung = new Untersuchung(); | |||
| untersuchung.setFall(mainController.getFallController().getFall()); | |||
| copyFieldDataIntoUntersuchung(untersuchung); | |||
| try { | |||
| DBHandler.setUntersuchung(untersuchung, mainController.getCurrentMitarbeiter().getMitarbID(), false); | |||
| } catch (SQLException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| } else if(state.get()==State.EDIT){ | |||
| Untersuchung untersuchung = untsList.getSelectionModel().getSelectedItem(); | |||
| copyFieldDataIntoUntersuchung(untersuchung); | |||
| //... | |||
| } | |||
| } | |||
| public void setUntersuchung(Untersuchung untersuchung){ | |||
| this.untersuchung = untersuchung; | |||
| private void copyUntersuchungDataIntoFields(){ | |||
| Untersuchung untersuchung = untsList.getSelectionModel().getSelectedItem(); | |||
| if(untersuchung==null){ | |||
| clearFields(); | |||
| }else { | |||
| copyUntersuchungDataIntoFields(); | |||
| return; | |||
| } | |||
| } | |||
| private void copyUntersuchungDataIntoFields(){ | |||
| // untsList.setText(Integer.toString(untersuchung.getUntersID())); | |||
| untsOpsCode.setValue(untersuchung.getOpscode()); | |||
| untsArzt.setValue(untersuchung.getDurchfuehrenderArzt()); | |||
| dtTmUntersuchungszeitpunkt.setDateTime(untersuchung.getUntersuchungsdatum()); | |||
| @@ -120,27 +243,19 @@ public class UntersuchungenController { | |||
| } | |||
| private void copyFieldDataIntoUntersuchung(Untersuchung untersuchung){ | |||
| untersuchung.setOpscode(untsOpsCode.getValue()); | |||
| untersuchung.setDurchfuehrenderArzt(untsArzt.getValue()); | |||
| // untersuchung.set?(untsList.getValue()); | |||
| untersuchung.setUntersuchungsdatum(dtTmUntersuchungszeitpunkt.getDateTime()); | |||
| // untersCreateTime.setText(untersuchung.getErstellDatumZeit().toString()); | |||
| // untersCreator.setText(Integer.toString(untersuchung.getErsteller())); | |||
| // untersEditTime.setText(untersuchung.getBearbeitetDatumZeit().toString()); | |||
| // untersEditor.setText(Integer.toString(untersuchung.getBearbeiter())); | |||
| untersuchung.setUntersuchungsdatum(dtTmUntersuchungszeitpunkt.getDateTime()); | |||
| } | |||
| private void clearFields(){ | |||
| //untersCreateTime.setText("<auto>"); | |||
| //untersCreator.setText("<auto>"); | |||
| //untersEditTime.setText("<auto>"); | |||
| // untersEditor.setText("<auto>"); | |||
| untsCreateTime.setText(""); | |||
| untsCreator.setText(""); | |||
| untsChangeTime.setText(""); | |||
| untsChanger.setText(""); | |||
| untsOpsCode.setValue(null); | |||
| untsArzt.setValue(null); | |||
| untsArzt.setValue(mainController.getCurrentMitarbeiter()); | |||
| dtTmUntersuchungszeitpunkt.setDateTime(null); | |||
| } | |||
| @@ -0,0 +1,4 @@ | |||
| /** | |||
| * Controller Klassen | |||
| */ | |||
| package de.uniluebeck.mi.projmi6.controller; | |||
| @@ -3,53 +3,84 @@ package de.uniluebeck.mi.projmi6.db; | |||
| import de.uniluebeck.mi.projmi6.model.*; | |||
| import java.sql.*; | |||
| import java.time.LocalDateTime; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| import java.util.StringJoiner; | |||
| /** | |||
| * Created by nils on 15.11.2015. | |||
| * Handler fuer alle DB Interaktionen. | |||
| */ | |||
| public class DBHandler { | |||
| private static final String SELECT_ALL_PATIENTS = "SELECT * FROM `patient`"; | |||
| private static final String SELECT_PATIENT_BY_ID = "SELECT * FROM `patient` WHERE `id` = ?"; | |||
| private static final String UPDATE_PATIENT = "UPDATE `patient` " + | |||
| "SET `CAVE`=?, " + | |||
| "`Familienstand`=?, " + | |||
| "`Geburtsdatum`=?, " + | |||
| "`Geburtsname`=?, " + | |||
| "`Geschlecht`=?, " + // TODO: Hausnummer fehlt | |||
| "`KassenID`=?, " + | |||
| "`LetzterBearbeiter`=?, " + | |||
| "`Nachname`=?, " + | |||
| "`Ort`=?, " + | |||
| "`PLZ`=?, " + | |||
| "`Strasse`=?, " + | |||
| "`Telefon`=?, " + | |||
| "`Versichertennummer`=?, " + | |||
| "`Vorname`=? " + | |||
| private static final String UPDATE_PATIENT = "UPDATE `patient`" + | |||
| "SET `CAVE`=?," + | |||
| "`Vorname`=?," + | |||
| "`Geburtsname`=?," + | |||
| "`Nachname`=?," + | |||
| "`Geburtsdatum`=?," + | |||
| "`Geschlecht`=?," + | |||
| "`Familienstand`=?," + | |||
| "`Strasse`=?," + | |||
| "`Hausnummer`=?," + | |||
| "`PLZ`=?," + | |||
| "`Ort`=?," + | |||
| "`Telefon`=?," + | |||
| "`KassenID`=?," + | |||
| "`Versichertennummer`=?," + | |||
| "`LetzterBearbeiter`=? " + | |||
| "WHERE `ID`=?"; | |||
| private static final String INSERT_PATIENT = "INSERT INTO `patient` " + | |||
| "(`CAVE`, " + | |||
| "`Familienstand`, " + | |||
| "`Geburtsdatum`, " + | |||
| private static final String INSERT_PATIENT = "INSERT INTO `patient`" + | |||
| "(`CAVE`," + | |||
| "`Vorname`," + | |||
| "`Geburtsname`," + | |||
| "`Geschlecht`, " + | |||
| "`Hausnummer`, " + | |||
| "`KassenID`, " + | |||
| "`LetzterBearbeiter`, " + | |||
| "`Nachname`, " + | |||
| "`Ort`, " + | |||
| "`PLZ`, " + | |||
| "`Strasse`, " + | |||
| "`Nachname`," + | |||
| "`Geburtsdatum`," + | |||
| "`Geschlecht`," + | |||
| "`Familienstand`," + | |||
| "`Strasse`," + | |||
| "`Hausnummer`," + | |||
| "`PLZ`," + | |||
| "`Ort`," + | |||
| "`Telefon`," + | |||
| "`Versichertennummer`, " + | |||
| "`Vorname`, " + | |||
| "`Ersteller`) " + | |||
| "`KassenID`," + | |||
| "`Versichertennummer`," + | |||
| "`LetzterBearbeiter`," + | |||
| "`Ersteller`)" + | |||
| "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; | |||
| private static final String SELECT_ALL_STATIONEN = "SELECT * FROM `stammstation`"; | |||
| private static final String SELECT_ALL_STATIONEN = "SELECT *,`r`.`abteilung` AS abteilung " + | |||
| "FROM `stammstation` s " + | |||
| "INNER JOIN `relfachrichtungstation` r ON s.station = r.station"; | |||
| private static final String SELECT_FAELLE_BY_PATID = "SELECT * FROM `fall` WHERE `patientid` = ?"; | |||
| private static final String INSERT_FALL = "INSERT INTO `fall`" + | |||
| "(`Aufnahmedatum`," + | |||
| "`Entlassungsdatum`," + | |||
| "`Vorstelldatum`," + | |||
| "`EinweisenderArzt`," + | |||
| "`Fallart`," + | |||
| "`Selbsteinweisung`," + | |||
| "`Hauptdiagnose`," + | |||
| "`Versichertennummer`," + | |||
| "`KassenID`," + | |||
| "`storniert`," + | |||
| "`LetzterBearbeiter`," + | |||
| "`PatientID`," + | |||
| "`Ersteller`)" + | |||
| "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; | |||
| private static final String UPDATE_FALL = "UPDATE `fall`" + | |||
| "SET `Aufnahmedatum`=?," + | |||
| "`Entlassungsdatum`=?," + | |||
| "`Vorstelldatum`=?," + | |||
| "`EinweisenderArzt`=?," + | |||
| "Fallart=?," + | |||
| "`Selbsteinweisung`=?," + | |||
| "Hauptdiagnose=?," + | |||
| "`Versichertennummer`=?," + | |||
| "KassenID=?," + | |||
| "`storniert`=?," + | |||
| "LetzterBearbeiter=? " + | |||
| "WHERE `FallID`=?"; | |||
| private static final String SELECT_DIAGNOSE_BY_ID = "SELECT * FROM `diagnose` WHERE `diagid` = ?"; | |||
| private static final String SELECT_ALL_ICD10CODES = "SELECT * FROM `stammicd10`"; | |||
| private static final String SELECT_ALL_OPSCODES = "SELECT * FROM `stammops`"; | |||
| @@ -57,11 +88,86 @@ public class DBHandler { | |||
| private static final String SELECT_OPSCODE_BY_ID = "SELECT * FROM `stammops` WHERE `opscode` = ? AND `version` = ?"; | |||
| private static final String SELECT_ALL_MITARBEITER = "SELECT * FROM `mitarbeiter`"; | |||
| private static final String SELECT_UNTERS_BY_FALLID = "SELECT * FROM `untersuchung` WHERE `fallid` = ?"; | |||
| private static final String INSERT_UNTERSUCHUNG = "INSERT INTO `untersuchung`" + | |||
| "(`DurchfuehrenderArzt`," + | |||
| "`FallID`," + | |||
| "`OPSCode`," + | |||
| "`OPSVersion`," + | |||
| "`storniert`," + | |||
| "`Untersuchungsdatum`," + | |||
| "`LetzterBearbeiter`," + | |||
| "`Ersteller`)" + | |||
| "VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; | |||
| private static final String UPDATE_UNTERSUCHUNG = "UPDATE `untersuchung` " + | |||
| "SET `DurchfuehrenderArzt`=?," + | |||
| "`FallID`=?," + | |||
| "`OPSCode`=?," + | |||
| "`OPSVersion`=?," + | |||
| "`storniert`=?," + | |||
| "`Untersuchungsdatum`=?," + | |||
| "`LetzterBearbeiter`=? " + | |||
| "WHERE `UntersID`=?"; | |||
| private static final String SELECT_MITARBEITER_BY_ID = "SELECT * FROM `mitarbeiter` WHERE `mitarbid` = ?"; | |||
| private static final String SELECT_DIAGNOSE_BY_FALLID = "SELECT * FROM `diagnose` WHERE `fallid` = ?"; | |||
| private static final String SELECT_ALL_KASSEN = "SELECT * FROM `kasse`"; | |||
| private static final String SELECT_KASSE_BY_KASSENID = "SELECT * FROM `kasse` WHERE `kasse`.`KassenID` = ?"; | |||
| private static final String SELECT_STATHIST_BY_FALLID = "SELECT * FROM `stationshistorie` WHERE `stationshistorie`.`fallid` = ?"; | |||
| private static final String SELECT_STATUBERITEMS_BY_STATION = "SELECT p.id AS patid," + | |||
| "concat(p.nachname, ', ', p.vorname) AS patname," + | |||
| "p.geburtsdatum AS dob," + | |||
| "timestampdiff(YEAR, p.geburtsdatum, curdate()) AS patage," + | |||
| "f.aufnahmedatum AS aufnahme," + | |||
| "f.entlassungsdatum AS entlassung," + | |||
| "f.fallid AS fallid " + | |||
| "FROM stationshistorie s " + | |||
| "INNER JOIN fall f ON s.fallid = f.fallid " + | |||
| "INNER JOIN patient p ON f.patientid = p.id " + | |||
| "WHERE s.station = ?"; | |||
| private static final String INSERT_STATHISTENTRY = "INSERT INTO `stationshistorie`" + | |||
| "(`Aufnahmedatum`," + | |||
| "`Entlassungsdatum`," + | |||
| "`FallID`," + | |||
| "`LetzterBearbeiter`," + | |||
| "`Station`," + | |||
| "`Ersteller`)" + | |||
| "VALUES (?, ?, ?, ?, ?, ?)"; | |||
| private static final String UPDATE_STATHISTENTRY = "UPDATE `stationshistorie` " + | |||
| "SET `Aufnahmedatum`=?," + | |||
| "`Entlassungsdatum`=?," + | |||
| "`FallID`=?," + | |||
| "`LetzterBearbeiter`=?," + | |||
| "`Station`=? " + | |||
| "WHERE `StatHistID`=?"; | |||
| private static final String SELECT_LAST_HL7ENTRIES = "SELECT * FROM `hl7_nachrichten` limit ?"; | |||
| private static final String INSERT_HL7NACHRICHT = "INSERT INTO `hl7_nachrichten` " + | |||
| "(`hl7msg`," + | |||
| "`timestamp`," + | |||
| "`source`) " + | |||
| "VALUES (?, ?, ?)"; | |||
| private static final String INSERT_DIAGNOSE = "INSERT INTO `diagnose` " + | |||
| "(`Arzt`," + | |||
| "`DiagArt`," + | |||
| "`Ersteller`," + | |||
| "`Freitext`," + | |||
| "`ICD10Code`," + | |||
| "`ICD10Version`," + | |||
| "`LetzterBearbeiter`," + | |||
| "`FallID`) " + | |||
| "VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; | |||
| private static final String DELETE_STATHIST = "DELETE FROM `stationshistorie` WHERE `StatHistID` =?"; | |||
| private DBHandler() { | |||
| } | |||
| /** | |||
| * Gibt alle {@link Patient} aus der DB zurueck. | |||
| * | |||
| * @return Liste aller {@link Patient}. | |||
| * @throws SQLException wenn Fehler bei der SQL Verarbeitung auftreten. | |||
| */ | |||
| public static List<Patient> getAllPatients() throws SQLException { | |||
| Statement statement = MySqlConnFactory.getConnection().createStatement(); | |||
| Statement statement = MySqlConnectionFactory.getConnection().createStatement(); | |||
| ResultSet rs = statement.executeQuery(SELECT_ALL_PATIENTS); | |||
| List<Patient> patients = new ArrayList<>(); | |||
| @@ -72,100 +178,104 @@ public class DBHandler { | |||
| return patients; | |||
| } | |||
| public static Patient getPatient(int id) throws SQLException { | |||
| PreparedStatement statement = MySqlConnFactory.getConnection().prepareStatement(SELECT_PATIENT_BY_ID); | |||
| ResultSet rs; | |||
| statement.setInt(1, id); | |||
| rs = statement.executeQuery(); | |||
| return getPatient(rs); | |||
| } | |||
| /** | |||
| * Extrahiert ein Objekt {@link Patient} aus einem gegebenen {@link ResultSet}. | |||
| * | |||
| * @param rs ResultSet from Database Query. | |||
| * @return {@link Patient} | |||
| * @throws SQLException | |||
| */ | |||
| private static Patient getPatient(ResultSet rs) throws SQLException { | |||
| Patient patient = new Patient(); | |||
| patient.setPatID(rs.getInt("id")); | |||
| patient.setGeburtsname(rs.getString("geburtsname")); | |||
| patient.setVorname(rs.getString("vorname")); | |||
| patient.setNachname(rs.getString("nachname")); | |||
| if (rs.getDate("geburtsdatum") != null) | |||
| if (rs.getDate("geburtsdatum") != null) { | |||
| patient.setGeburtsdatum(rs.getDate("geburtsdatum").toLocalDate()); | |||
| } | |||
| patient.setCave(rs.getString("cave")); | |||
| patient.setStrasse(rs.getString("strasse")); | |||
| patient.setHausnummer(rs.getString("hausnummer")); | |||
| patient.setPlz(rs.getString("plz")); | |||
| patient.setOrt(rs.getString("ort")); | |||
| patient.setTelefon(rs.getString("telefon")); | |||
| // patient.setFamilienstand(rs.getString("familienstand")); TODO | |||
| // patient.setGeschlecht(Patient.Geschlecht.valueOf(rs.getString("geschlecht"))); TODO | |||
| if (rs.getString("familienstand") != null) { | |||
| patient.setFamilienstand(Patient.Familienstand.parseChar(rs.getString("familienstand").charAt(0))); | |||
| } | |||
| if (rs.getString("geschlecht") != null) { | |||
| patient.setGeschlecht(Patient.Geschlecht.parseChar(rs.getString("geschlecht").charAt(0))); | |||
| } | |||
| patient.setVersichertennummer(rs.getString("versichertennummer")); | |||
| patient.setKassenID(rs.getInt("kassenid")); | |||
| setVersionInformation(patient, rs); | |||
| return patient; | |||
| } | |||
| // TODO: Defaultwerte entfernen und so. | |||
| public static void updatePatient(Patient patient, int mitarbid) throws SQLException { | |||
| PreparedStatement statement = MySqlConnFactory.getConnection().prepareStatement(UPDATE_PATIENT); | |||
| // TODO: Never used. | |||
| public static Patient getPatient(int id) throws SQLException { | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(SELECT_PATIENT_BY_ID); | |||
| ResultSet rs; | |||
| statement.setInt(1, id); | |||
| rs = statement.executeQuery(); | |||
| return getPatient(rs); | |||
| } | |||
| /** | |||
| * Fuehrt {@code INSERT} bei einem neuen Datensatz und {@code UPDATE} bei einem existierenden Datensatz aus. | |||
| * | |||
| * @param patient zu verarbeitender Datensatz. | |||
| * @param mitarbid {@link Mitarbeiter#mitarbID} des aktuellen Benutzers/Mitarbeiters. | |||
| * @param isUpdate {@code true} wenn der Datensatz bereits existiert, sonst {@code false}. | |||
| * @throws SQLException wenn Fehler bei der SQL Verarbeitung auftreten. | |||
| */ | |||
| public static void setPatient(Patient patient, int mitarbid, boolean isUpdate) throws SQLException { | |||
| PreparedStatement statement; | |||
| if (isUpdate) { | |||
| statement = MySqlConnectionFactory.getConnection().prepareStatement(UPDATE_PATIENT); | |||
| } else { | |||
| statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_PATIENT); | |||
| } | |||
| statement.setString(1, patient.getCave()); // CAVE | |||
| if (patient.getFamilienstand() != null) | |||
| statement.setString(2, patient.getFamilienstand().toString()); // Familienstand | |||
| else | |||
| statement.setString(2, "l"); | |||
| statement.setDate(3, Date.valueOf(patient.getGeburtsdatum())); // Geburtsdatum | |||
| statement.setString(4, patient.getGeburtsname()); // Geburtsname | |||
| if (patient.getGeschlecht() != null) | |||
| statement.setString(5, String.valueOf(patient.getGeschlecht().id())); // Geschlecht | |||
| else | |||
| statement.setString(5, "o"); | |||
| // statement.setInt(6, patient.getKassenID()); // KasseId | |||
| statement.setInt(6, 1); // KasseId | |||
| statement.setInt(7, mitarbid); // Letzterbearbeiter | |||
| statement.setString(8, patient.getNachname()); // Nachname | |||
| statement.setString(9, patient.getOrt()); // Ort | |||
| statement.setString(2, patient.getVorname()); // Vorname | |||
| statement.setString(3, patient.getGeburtsname()); // Geburtsname | |||
| statement.setString(4, patient.getNachname()); // Nachname | |||
| statement.setDate(5, Date.valueOf(patient.getGeburtsdatum())); // Geburtsdatum | |||
| if (patient.getGeschlecht() != null) { | |||
| statement.setString(6, String.valueOf(patient.getGeschlecht().id())); // Geschlecht | |||
| } else { | |||
| statement.setString(6, String.valueOf(Patient.Geschlecht.OTHER.id())); | |||
| } | |||
| if (patient.getFamilienstand() != null) { | |||
| statement.setString(7, String.valueOf(patient.getFamilienstand().id()));// Familienstand | |||
| } else { | |||
| statement.setString(7, String.valueOf(Patient.Familienstand.LEDIG.id())); | |||
| } | |||
| statement.setString(8, patient.getStrasse()); // Strasse | |||
| statement.setString(9, patient.getHausnummer()); // Hausnummer | |||
| statement.setString(10, patient.getPlz()); // PLZ | |||
| statement.setString(11, patient.getStrasse()); // Strasse | |||
| statement.setString(12, patient.getTelefon()); // telefon | |||
| statement.setString(13, patient.getVersichertennummer()); // versichertennummer | |||
| statement.setString(14, patient.getVorname()); // vorname | |||
| statement.setInt(15, patient.getPatID()); // patid | |||
| System.out.println(statement.toString()); | |||
| statement.executeUpdate(); | |||
| } | |||
| public static void insertPatient(Patient patient, int mitarbid) throws SQLException { | |||
| PreparedStatement statement = MySqlConnFactory.getConnection().prepareStatement(INSERT_PATIENT); | |||
| statement.setString(1, patient.getCave()); // `CAVE` | |||
| if (patient.getFamilienstand() != null) | |||
| statement.setString(2, String.valueOf(patient.getFamilienstand().id())); // `Familienstand` | |||
| else | |||
| statement.setString(2, "l"); | |||
| statement.setDate(3, Date.valueOf(patient.getGeburtsdatum())); // `Geburtdatum` | |||
| statement.setString(4, patient.getGeburtsname()); // `Geburtsname` | |||
| if (patient.getGeschlecht() != null) | |||
| statement.setString(5, String.valueOf(patient.getGeschlecht().id())); // `Geschlecht` | |||
| else | |||
| statement.setString(5, "o"); | |||
| statement.setString(6, patient.getHausnummer()); // `Hausnummer` | |||
| //statement.setInt(7, patient.getKassenID()); // `KassenID` | |||
| statement.setInt(7, 1); // `KassenID` | |||
| statement.setInt(8, mitarbid); // `LetzterBearbeiter` | |||
| statement.setString(9, patient.getNachname()); // `Nachname` | |||
| statement.setString(10, patient.getOrt()); // `Ort` | |||
| statement.setString(11, patient.getPlz()); // `PLZ` | |||
| statement.setString(12, patient.getStrasse()); // `Strasse` | |||
| statement.setString(13, patient.getTelefon()); // `Telefon` | |||
| statement.setString(14, patient.getVersichertennummer()); // `Versichertennummer` | |||
| statement.setString(15, patient.getVorname()); // `Vorname` | |||
| statement.setInt(16, mitarbid); // `Ersteller` | |||
| System.out.println(statement.toString()); | |||
| statement.setString(11, patient.getOrt()); // Ort | |||
| statement.setString(12, patient.getTelefon()); // Telefon | |||
| statement.setInt(13, patient.getKassenID()); // KassenID | |||
| statement.setString(14, patient.getVersichertennummer()); // Versichertennummer | |||
| statement.setInt(15, mitarbid); // LetzterBearbeiter | |||
| if (!isUpdate) { | |||
| statement.setInt(16, mitarbid); // Ersteller | |||
| } else { | |||
| statement.setInt(16, patient.getPatID()); // PatID (WHERE) | |||
| } | |||
| statement.execute(); | |||
| statement.execute(); | |||
| } | |||
| public static List<Station> getAllStationen() throws SQLException { | |||
| Statement statement = MySqlConnFactory.getConnection().createStatement(); | |||
| Statement statement = MySqlConnectionFactory.getConnection().createStatement(); | |||
| ResultSet rs = statement.executeQuery(SELECT_ALL_STATIONEN); | |||
| List<Station> stationen = new ArrayList<>(); | |||
| @@ -176,18 +286,119 @@ public class DBHandler { | |||
| return stationen; | |||
| } | |||
| /** | |||
| * Extrahiert ein Objekt {@link Station} aus einem gegebenen {@link ResultSet}. | |||
| * | |||
| * @param rs ResultSet from Database Query. | |||
| * @return {@link Station} | |||
| * @throws SQLException wenn Fehler bei der SQL Verarbeitung auftreten. | |||
| */ | |||
| private static Station getStation(ResultSet rs) throws SQLException { | |||
| Station station = new Station(); | |||
| station.setStation(rs.getString("station")); | |||
| station.setBezeichnung(rs.getString("bezeichnung")); | |||
| station.setBezeichnungLang(rs.getString("bezeichnunglang")); | |||
| station.setStationstyp(rs.getInt("stationstyp")); | |||
| station.setAbteilung(rs.getString("abteilung")); | |||
| return station; | |||
| } | |||
| public static List<StationsUebersichtsItem> getStationsUebersichtsItems(String station) throws SQLException { | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(SELECT_STATUBERITEMS_BY_STATION); | |||
| statement.setString(1, station); | |||
| ResultSet rs = statement.executeQuery(); | |||
| List<StationsUebersichtsItem> statUeberItems = new ArrayList<>(); | |||
| while (rs.next()) { | |||
| statUeberItems.add(getStatUeberItem(rs)); | |||
| } | |||
| return statUeberItems; | |||
| } | |||
| private static StationsUebersichtsItem getStatUeberItem(ResultSet rs) throws SQLException { | |||
| StationsUebersichtsItem item = new StationsUebersichtsItem(); | |||
| item.setFallId(rs.getInt("fallid")); | |||
| item.setPatId(rs.getInt("patid")); | |||
| item.setPatName(rs.getString("patname")); | |||
| item.setPatAge(rs.getInt("patage")); | |||
| item.setPatBirthdate(rs.getDate("dob").toLocalDate()); | |||
| if (rs.getDate("aufnahme") != null) { | |||
| item.setStationAufnahme(rs.getDate("aufnahme").toLocalDate()); | |||
| } | |||
| if (rs.getDate("entlassung") != null) { | |||
| item.setStationEntlassung(rs.getDate("entlassung").toLocalDate()); | |||
| } | |||
| return item; | |||
| } | |||
| public static List<StationsHistorie> getStationsHistorieByFall(Fall fall) throws SQLException { | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(SELECT_STATHIST_BY_FALLID); | |||
| statement.setInt(1, fall.getFallID()); | |||
| ResultSet rs = statement.executeQuery(); | |||
| List<StationsHistorie> historie = new ArrayList<>(); | |||
| while (rs.next()) { | |||
| historie.add(getStationsHistorie(rs)); | |||
| } | |||
| return historie; | |||
| } | |||
| public static void setStationsHistorie(StationsHistorie hist, boolean isUpdate) throws SQLException { | |||
| PreparedStatement statement; | |||
| if (isUpdate) { | |||
| statement = MySqlConnectionFactory.getConnection().prepareStatement(UPDATE_STATHISTENTRY); | |||
| } else { | |||
| statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_STATHISTENTRY); | |||
| } | |||
| if (hist.getAufnahmeDatum() != null) { | |||
| statement.setTimestamp(1, Timestamp.valueOf(hist.getAufnahmeDatum())); // `Aufnahmedatum` | |||
| } else { | |||
| statement.setTimestamp(1, null); | |||
| } | |||
| if (hist.getEntlassungsDatum() != null) { | |||
| statement.setTimestamp(2, Timestamp.valueOf(hist.getEntlassungsDatum())); // `Entlassungsdatum` | |||
| } else { | |||
| statement.setTimestamp(2, null); | |||
| } | |||
| statement.setInt(3, hist.getFallID()); // `FallID` | |||
| statement.setInt(4, hist.getBearbeiter()); // `LetzterBearbeiter` | |||
| statement.setString(5, hist.getStationKey()); // `Station` | |||
| if (isUpdate) { | |||
| statement.setInt(6, hist.getStatHistID()); // `StatHistID` | |||
| statement.executeUpdate(); | |||
| } else { | |||
| statement.setInt(6, hist.getErsteller()); // `Ersteller` | |||
| statement.execute(); | |||
| } | |||
| } | |||
| public static void delStationsHistorie(StationsHistorie hist) throws SQLException { | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(DELETE_STATHIST); | |||
| statement.setInt(1, hist.getStatHistID()); | |||
| statement.execute(); | |||
| } | |||
| private static StationsHistorie getStationsHistorie(ResultSet rs) throws SQLException { | |||
| StationsHistorie hist = new StationsHistorie(); | |||
| hist.setStatHistID(rs.getInt("stathistid")); | |||
| if (rs.getTimestamp("aufnahmedatum") != null) { | |||
| hist.setAufnahmeDatum(rs.getTimestamp("aufnahmedatum").toLocalDateTime()); | |||
| } | |||
| if (rs.getTimestamp("entlassungsdatum") != null) { | |||
| hist.setEntlassungsDatum(rs.getTimestamp("entlassungsdatum").toLocalDateTime()); | |||
| } | |||
| hist.setStationKey(rs.getString("station")); | |||
| return hist; | |||
| } | |||
| public static List<Fall> getFaelleByPatID(int id) throws SQLException { | |||
| PreparedStatement statement = MySqlConnFactory.getConnection().prepareStatement(SELECT_FAELLE_BY_PATID); | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(SELECT_FAELLE_BY_PATID); | |||
| statement.setInt(1, id); | |||
| ResultSet rs = statement.executeQuery(); | |||
| @@ -199,20 +410,117 @@ public class DBHandler { | |||
| return faelle; | |||
| } | |||
| /** | |||
| * Extrahiert ein Objekt {@link Fall} aus einem gegebenen {@link ResultSet}. | |||
| * | |||
| * @param rs ResultSet from Database Query. | |||
| * @return {@link Fall} | |||
| * @throws SQLException wenn Fehler bei der SQL Verarbeitung auftreten. | |||
| */ | |||
| private static Fall getFall(ResultSet rs) throws SQLException { | |||
| Fall fall = new Fall(); | |||
| fall.setFallID(rs.getInt("fallid")); | |||
| if (rs.getTimestamp("aufnahmedatum") != null) | |||
| if (rs.getTimestamp("aufnahmedatum") != null) { | |||
| fall.setAufnahmeDatum(rs.getTimestamp("aufnahmedatum").toLocalDateTime()); | |||
| if (rs.getTimestamp("entlassungsdatum") != null) | |||
| } | |||
| if (rs.getTimestamp("entlassungsdatum") != null) { | |||
| fall.setEntlassungsDatum(rs.getTimestamp("entlassungsdatum").toLocalDateTime()); | |||
| if (rs.getInt("hauptdiagnose") != 0) | |||
| } | |||
| if (rs.getInt("hauptdiagnose") != 0) { | |||
| fall.setHauptDiagnose(getDiagnose(rs.getInt("hauptdiagnose"), fall)); | |||
| fall.setHauptdiagnoseId(rs.getInt("hauptdiagnose")); | |||
| } | |||
| if (rs.getString("versichertennummer") != null) { | |||
| fall.setVersichertenNummer(rs.getString("versichertennummer")); | |||
| } | |||
| if (rs.getInt("kassenid") != 0) { | |||
| fall.setKasse(getKasse(rs.getInt("kassenid"))); | |||
| } | |||
| fall.setFallArt(FallArt.parseString(rs.getString("fallart"))); | |||
| fall.setEinweisenderArzt(rs.getString("einweisenderarzt")); | |||
| fall.setStorniert(rs.getBoolean("storniert")); | |||
| return fall; | |||
| } | |||
| /** | |||
| * Fuehrt {@code INSERT} bei einem neuen Datensatz und {@code UPDATE} bei einem existierenden Datensatz aus. | |||
| * | |||
| * @param fall zu verarbeitender Datensatz. | |||
| * @param mitarbid {@link Mitarbeiter#mitarbID} des aktuellen Benutzers/Mitarbeiters. | |||
| * @param isUpdate {@code true} wenn der Datensatz bereits existiert, sonst {@code false}. | |||
| * @throws SQLException wenn Fehler bei der SQL Verarbeitung auftreten. | |||
| */ | |||
| public static void setFall(Fall fall, int mitarbid, boolean isUpdate) throws SQLException { | |||
| PreparedStatement statement; | |||
| if (isUpdate) { | |||
| statement = MySqlConnectionFactory.getConnection().prepareStatement(UPDATE_FALL); | |||
| } else { | |||
| statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_FALL); | |||
| } | |||
| if (fall.getAufnahmeDatum() != null) { | |||
| statement.setTimestamp(1, Timestamp.valueOf(fall.getAufnahmeDatum())); // Aufnahmedatum | |||
| } else { | |||
| statement.setTimestamp(1, null); | |||
| } | |||
| if (fall.getEntlassungsDatum() != null) { | |||
| statement.setTimestamp(2, Timestamp.valueOf(fall.getEntlassungsDatum())); // Entlassungsdatum | |||
| } else { | |||
| statement.setTimestamp(2, null); | |||
| } | |||
| if (fall.getVorstellDatum() != null) { | |||
| statement.setTimestamp(3, Timestamp.valueOf(fall.getVorstellDatum())); // Vorstelldatum | |||
| } else { | |||
| statement.setTimestamp(3, null); | |||
| } | |||
| if (fall.getEinweisenderArzt() != null) { | |||
| statement.setString(4, fall.getEinweisenderArzt()); // EinweisenderArzt | |||
| } else { | |||
| statement.setTimestamp(4, null); | |||
| } | |||
| if (fall.getFallArt() != null) { | |||
| statement.setString(5, fall.getFallArt().id()); // Fallart | |||
| } else { | |||
| statement.setString(5, null); | |||
| } | |||
| statement.setBoolean(6, fall.getSelbsteinweisung()); // Selbsteinweisung | |||
| if (fall.getHauptdiagnoseId() != 0) { | |||
| statement.setInt(7, fall.getHauptdiagnoseId()); // Hauptdiagnose | |||
| } else { | |||
| statement.setTimestamp(7, null); | |||
| } | |||
| statement.setString(8, fall.getVersichertenNummer()); // Versichertennummer | |||
| if (fall.getKasse() != null) { | |||
| statement.setInt(9, fall.getKasse().getKassenID()); // KassenID | |||
| } else { | |||
| statement.setTimestamp(9, null); | |||
| } | |||
| statement.setBoolean(10, fall.getStorniert()); // storniert | |||
| statement.setInt(11, mitarbid); // Letzter Bearbeiter | |||
| if (!isUpdate) { | |||
| statement.setInt(12, fall.getPatient().getPatID()); // PatientID | |||
| statement.setInt(13, mitarbid); // Ersteller | |||
| } | |||
| if (isUpdate) { | |||
| statement.setInt(12, fall.getFallID()); | |||
| } | |||
| statement.execute(); | |||
| } | |||
| /** | |||
| * Fuehrt {@code INSERT} eines neuen Datensatz durch. | |||
| * | |||
| * @param fall zu verarbeitender Datensatz. | |||
| * @param mitarbid {@link Mitarbeiter#mitarbID} des aktuellen Benutzers/Mitarbeiters. | |||
| * @throws SQLException wenn Fehler bei der SQL Verarbeitung auftreten. | |||
| */ | |||
| public static void setFall(Fall fall, int mitarbid) throws SQLException { | |||
| setFall(fall, mitarbid, false); | |||
| } | |||
| private static Diagnose getDiagnose(int diagid, Fall fall) throws SQLException { | |||
| Diagnose diagnose = getDiagnose(diagid); | |||
| diagnose.setFall(fall); | |||
| @@ -221,7 +529,7 @@ public class DBHandler { | |||
| } | |||
| private static Diagnose getDiagnose(int id) throws SQLException { | |||
| PreparedStatement statement = MySqlConnFactory.getConnection().prepareStatement(SELECT_DIAGNOSE_BY_ID); | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(SELECT_DIAGNOSE_BY_ID); | |||
| statement.setInt(1, id); | |||
| ResultSet rs = statement.executeQuery(); | |||
| @@ -229,9 +537,17 @@ public class DBHandler { | |||
| return getDiagnose(rs); | |||
| } | |||
| /** | |||
| * Extrahiert ein Objekt {@link Diagnose} aus einem gegebenen {@link ResultSet}. | |||
| * | |||
| * @param rs ResultSet from Database Query. | |||
| * @return {@link Diagnose} | |||
| * @throws SQLException wenn Fehler bei der SQL Verarbeitung auftreten. | |||
| */ | |||
| private static Diagnose getDiagnose(ResultSet rs) throws SQLException { | |||
| Diagnose diagnose = new Diagnose(); | |||
| diagnose.setDiagID(rs.getInt("diagid")); | |||
| diagnose.setFreiText(rs.getString("freitext")); | |||
| diagnose.setArzt(new Mitarbeiter(rs.getInt("arzt"))); | |||
| diagnose.setDiagArt(DiagArt.parseInt(rs.getInt("diagart"))); | |||
| @@ -242,15 +558,17 @@ public class DBHandler { | |||
| private static void setVersionInformation(Version version, ResultSet rs) throws SQLException { | |||
| version.setErsteller(rs.getInt("ersteller")); | |||
| if (rs.getTimestamp("erstelldatum") != null) | |||
| if (rs.getTimestamp("erstelldatum") != null) { | |||
| version.setErstellDatumZeit(rs.getTimestamp("erstelldatum").toLocalDateTime()); | |||
| } | |||
| version.setBearbeiter(rs.getInt("letzterbearbeiter")); | |||
| if (rs.getTimestamp("letztesbearbeitungsdatum") != null) | |||
| if (rs.getTimestamp("letztesbearbeitungsdatum") != null) { | |||
| version.setBearbeitetDatumZeit(rs.getTimestamp("letztesbearbeitungsdatum").toLocalDateTime()); | |||
| } | |||
| } | |||
| public static List<Icd10Code> getAllIcd10Codes() throws SQLException { | |||
| Statement statement = MySqlConnFactory.getConnection().createStatement(); | |||
| Statement statement = MySqlConnectionFactory.getConnection().createStatement(); | |||
| ResultSet rs = statement.executeQuery(SELECT_ALL_ICD10CODES); | |||
| List<Icd10Code> icd10codes = new ArrayList<>(); | |||
| @@ -262,7 +580,7 @@ public class DBHandler { | |||
| } | |||
| private static Icd10Code getIcd10Code(String code, int version) throws SQLException { | |||
| PreparedStatement statement = MySqlConnFactory.getConnection().prepareStatement(SELECT_ICD10CODE_BY_ID); | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(SELECT_ICD10CODE_BY_ID); | |||
| ResultSet rs; | |||
| statement.setString(1, code); | |||
| statement.setInt(2, version); | |||
| @@ -272,6 +590,13 @@ public class DBHandler { | |||
| return getIcd10Code(rs); | |||
| } | |||
| /** | |||
| * Extrahiert ein Objekt {@link Icd10Code} aus einem gegebenen {@link ResultSet}. | |||
| * | |||
| * @param rs ResultSet from Database Query. | |||
| * @return {@link Icd10Code} | |||
| * @throws SQLException wenn Fehler bei der SQL Verarbeitung auftreten. | |||
| */ | |||
| private static Icd10Code getIcd10Code(ResultSet rs) throws SQLException { | |||
| String code = rs.getString("icd10code"); | |||
| String text = rs.getString("text"); | |||
| @@ -281,7 +606,7 @@ public class DBHandler { | |||
| } | |||
| public static List<OpsCode> getAllOpsCodes() throws SQLException { | |||
| Statement statement = MySqlConnFactory.getConnection().createStatement(); | |||
| Statement statement = MySqlConnectionFactory.getConnection().createStatement(); | |||
| ResultSet rs = statement.executeQuery(SELECT_ALL_OPSCODES); | |||
| List<OpsCode> opscodes = new ArrayList<>(); | |||
| @@ -292,8 +617,8 @@ public class DBHandler { | |||
| return opscodes; | |||
| } | |||
| public static OpsCode getOpsCode(String code, int version) throws SQLException { | |||
| PreparedStatement statement = MySqlConnFactory.getConnection().prepareStatement(SELECT_OPSCODE_BY_ID); | |||
| private static OpsCode getOpsCode(String code, int version) throws SQLException { | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(SELECT_OPSCODE_BY_ID); | |||
| ResultSet rs; | |||
| statement.setString(1, code); | |||
| statement.setInt(2, version); | |||
| @@ -303,6 +628,13 @@ public class DBHandler { | |||
| return getOpsCode(rs); | |||
| } | |||
| /** | |||
| * Extrahiert ein Objekt {@link OpsCode} aus einem gegebenen {@link ResultSet}. | |||
| * | |||
| * @param rs ResultSet from Database Query. | |||
| * @return {@link OpsCode} | |||
| * @throws SQLException wenn Fehler bei der SQL Verarbeitung auftreten. | |||
| */ | |||
| private static OpsCode getOpsCode(ResultSet rs) throws SQLException { | |||
| String code = rs.getString("opscode"); | |||
| String text = rs.getString("text"); | |||
| @@ -312,7 +644,7 @@ public class DBHandler { | |||
| } | |||
| public static List<Mitarbeiter> getAllMitarbeiter() throws SQLException { | |||
| Statement statement = MySqlConnFactory.getConnection().createStatement(); | |||
| Statement statement = MySqlConnectionFactory.getConnection().createStatement(); | |||
| ResultSet rs = statement.executeQuery(SELECT_ALL_MITARBEITER); | |||
| List<Mitarbeiter> mitarbeiters = new ArrayList<>(); | |||
| @@ -324,7 +656,7 @@ public class DBHandler { | |||
| } | |||
| private static Mitarbeiter getMitarbeiter(int id) throws SQLException { | |||
| PreparedStatement statement = MySqlConnFactory.getConnection().prepareStatement(SELECT_MITARBEITER_BY_ID); | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(SELECT_MITARBEITER_BY_ID); | |||
| ResultSet rs; | |||
| statement.setInt(1, id); | |||
| rs = statement.executeQuery(); | |||
| @@ -333,6 +665,13 @@ public class DBHandler { | |||
| return getMitarbeiter(rs); | |||
| } | |||
| /** | |||
| * Extrahiert ein Objekt {@link Mitarbeiter} aus einem gegebenen {@link ResultSet}. | |||
| * | |||
| * @param rs ResultSet from Database Query. | |||
| * @return {@link Mitarbeiter} | |||
| * @throws SQLException wenn Fehler bei der SQL Verarbeitung auftreten. | |||
| */ | |||
| private static Mitarbeiter getMitarbeiter(ResultSet rs) throws SQLException { | |||
| Mitarbeiter mitarbeiter = new Mitarbeiter(rs.getInt("mitarbid")); | |||
| mitarbeiter.setTitel(rs.getString("titel")); | |||
| @@ -342,8 +681,15 @@ public class DBHandler { | |||
| return mitarbeiter; | |||
| } | |||
| /** | |||
| * Gibt gibt alle {@link Untersuchung} zu einem {@link Fall} aus. | |||
| * | |||
| * @param fall Parent {@link Fall} | |||
| * @return Liste aller {@link Untersuchung} zu einem {@link Fall}. | |||
| * @throws SQLException wenn Fehler bei der SQL Verarbeitung auftreten. | |||
| */ | |||
| public static List<Untersuchung> getUntersuchungByFall(Fall fall) throws SQLException { | |||
| PreparedStatement statement = MySqlConnFactory.getConnection().prepareStatement(SELECT_UNTERS_BY_FALLID); | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(SELECT_UNTERS_BY_FALLID); | |||
| statement.setInt(1, fall.getFallID()); | |||
| ResultSet rs = statement.executeQuery(); | |||
| @@ -362,12 +708,46 @@ public class DBHandler { | |||
| untersuchung.setDurchfuehrenderArzt(getMitarbeiter(rs.getInt("durchfuehrenderarzt"))); | |||
| untersuchung.setUntersuchungsdatum(rs.getTimestamp("untersuchungsdatum").toLocalDateTime()); | |||
| untersuchung.setOpscode(getOpsCode(rs.getString("opscode"), rs.getInt("opsversion"))); | |||
| untersuchung.setStorniert(rs.getBoolean("storniert")); | |||
| setVersionInformation(untersuchung, rs); | |||
| return untersuchung; | |||
| } | |||
| /** | |||
| * Fuehrt {@code INSERT} bei einem neuen Datensatz und {@code UPDATE} bei einem existierenden Datensatz aus. | |||
| * | |||
| * @param untersuchung zu verarbeitender Datensatz. | |||
| * @param mitarbid {@link Mitarbeiter#mitarbID} des aktuellen Benutzers/Mitarbeiters. | |||
| * @param isUpdate {@code true} wenn der Datensatz bereits existiert, sonst {@code false}. | |||
| * @throws SQLException wenn Fehler bei der SQL Verarbeitung auftreten. | |||
| */ | |||
| public static void setUntersuchung(Untersuchung untersuchung, int mitarbid, boolean isUpdate) throws SQLException { | |||
| PreparedStatement statement; | |||
| if (isUpdate) { | |||
| statement = MySqlConnectionFactory.getConnection().prepareStatement(UPDATE_UNTERSUCHUNG); | |||
| } else { | |||
| statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_UNTERSUCHUNG); | |||
| } | |||
| statement.setInt(1, untersuchung.getDurchfuehrenderArzt().getMitarbID()); // DurchfuehrenderArzt | |||
| statement.setInt(2, untersuchung.getFall().getFallID()); // FallID | |||
| statement.setString(3, untersuchung.getOpscode().getOpsCode()); // OPSCode | |||
| statement.setInt(4, untersuchung.getOpscode().getVersion()); // OPSVersion | |||
| statement.setBoolean(5, untersuchung.getStorniert()); // storniert | |||
| statement.setTimestamp(6, Timestamp.valueOf(untersuchung.getUntersuchungsdatum())); // Untersuchungsdatum | |||
| statement.setInt(7, mitarbid); // Letzter Bearbeiter | |||
| if (isUpdate) { | |||
| statement.setInt(8, untersuchung.getUntersID()); // `UntersID` | |||
| } else { | |||
| statement.setInt(8, mitarbid); // Ersteller | |||
| } | |||
| statement.execute(); | |||
| } | |||
| public static List<Diagnose> getDiagnosenByFall(Fall fall) throws SQLException { | |||
| PreparedStatement statement = MySqlConnFactory.getConnection().prepareStatement(SELECT_DIAGNOSE_BY_FALLID); | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(SELECT_DIAGNOSE_BY_FALLID); | |||
| statement.setInt(1, fall.getFallID()); | |||
| ResultSet rs = statement.executeQuery(); | |||
| @@ -378,4 +758,87 @@ public class DBHandler { | |||
| return diagnosen; | |||
| } | |||
| public static List<Kasse> getAllKassen() throws SQLException { | |||
| Statement statement = MySqlConnectionFactory.getConnection().createStatement(); | |||
| ResultSet rs = statement.executeQuery(SELECT_ALL_KASSEN); | |||
| List<Kasse> kassen = new ArrayList<>(); | |||
| while (rs.next()) { | |||
| kassen.add(getKasse(rs)); | |||
| } | |||
| return kassen; | |||
| } | |||
| private static Kasse getKasse(int kassenid) throws SQLException { | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(SELECT_KASSE_BY_KASSENID); | |||
| statement.setInt(1, kassenid); | |||
| ResultSet rs = statement.executeQuery(); | |||
| rs.next(); // TODO | |||
| return getKasse(rs); | |||
| } | |||
| /** | |||
| * Extrahiert ein Objekt {@link Kasse} aus einem gegebenen {@link ResultSet}. | |||
| * | |||
| * @param rs ResultSet from Database Query. | |||
| * @return {@link Kasse} | |||
| * @throws SQLException wenn Fehler bei der SQL Verarbeitung auftreten. | |||
| */ | |||
| private static Kasse getKasse(ResultSet rs) throws SQLException { | |||
| Kasse kasse = new Kasse(); | |||
| kasse.setKassenID(rs.getInt("kassenid")); | |||
| kasse.setName(rs.getString("name")); | |||
| kasse.setAdresse(rs.getString("adresse")); | |||
| kasse.setPrivat(rs.getBoolean("privat")); | |||
| setVersionInformation(kasse, rs); | |||
| return kasse; | |||
| } | |||
| public static void setDiagnose(Diagnose diagnose) throws SQLException { | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_DIAGNOSE); | |||
| statement.setInt(1, diagnose.getArzt().getMitarbID()); // `Arzt` | |||
| statement.setInt(2, diagnose.getDiagArt().id()); // `DiagArt` | |||
| statement.setInt(3, diagnose.getErsteller()); // `Ersteller` | |||
| statement.setString(4, diagnose.getFreiText()); // `Freitext` | |||
| statement.setString(5, diagnose.getIcd10code().getCode()); // `ICD10Code` | |||
| statement.setInt(6, diagnose.getIcd10code().getVersion()); // `ICD10Version` | |||
| statement.setInt(7, diagnose.getBearbeiter()); // `LetzterBearbeiter` | |||
| statement.setInt(8, diagnose.getFall().getFallID()); // `FallID` | |||
| statement.execute(); | |||
| } | |||
| public static void setHL7Nachricht(String hl7msg, LocalDateTime timestamp, String source) throws SQLException { | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_HL7NACHRICHT); | |||
| statement.setString(1, hl7msg); | |||
| statement.setTimestamp(2, Timestamp.valueOf(timestamp)); | |||
| statement.setString(3, source); | |||
| statement.execute(); | |||
| } | |||
| public static List<HL7LogEntry> getLastHL7LogEntries() throws SQLException { | |||
| return getLastHL7LogEntries(30); | |||
| } | |||
| public static List<HL7LogEntry> getLastHL7LogEntries(int last) throws SQLException { | |||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(SELECT_LAST_HL7ENTRIES); | |||
| statement.setInt(1, last); | |||
| ResultSet rs = statement.executeQuery(); | |||
| List<HL7LogEntry> hl7entries = new ArrayList<>(); | |||
| while (rs.next()) { | |||
| hl7entries.add(getHL7LogEntry(rs)); | |||
| } | |||
| return hl7entries; | |||
| } | |||
| private static HL7LogEntry getHL7LogEntry(ResultSet rs) throws SQLException { | |||
| HL7LogEntry entry = new HL7LogEntry(rs.getInt("msgid")); | |||
| entry.setMessage(rs.getString("hl7msg")); | |||
| entry.setTimestamp(rs.getTimestamp("timestamp").toLocalDateTime()); | |||
| entry.setSource(rs.getString("source")); | |||
| return entry; | |||
| } | |||
| } | |||
| @@ -5,16 +5,16 @@ import java.sql.DriverManager; | |||
| import java.sql.SQLException; | |||
| /** | |||
| * Created by nils on 15.11.2015. | |||
| * MySQL Connection Factory. | |||
| */ | |||
| public class MySqlConnFactory { | |||
| private static MySqlConnFactory instance = new MySqlConnFactory(); | |||
| public static final String URL = "jdbc:mysql://127.0.0.1:3306/pmiw15g06_v01"; | |||
| public class MySqlConnectionFactory { | |||
| public static final String URL = "jdbc:mysql://141.83.20.84:3306/pmiw15g06_v01"; | |||
| public static final String USER = "pmiw15g06"; | |||
| public static final String PASS = "AX3yQSYJSH43PrSz"; | |||
| public static final String DRIVER = "com.mysql.jdbc.Driver"; | |||
| private static MySqlConnectionFactory instance = new MySqlConnectionFactory(); | |||
| private MySqlConnFactory() { | |||
| private MySqlConnectionFactory() { | |||
| try { | |||
| Class.forName(DRIVER); | |||
| } catch (ClassNotFoundException e) { | |||
| @@ -22,6 +22,10 @@ public class MySqlConnFactory { | |||
| } | |||
| } | |||
| protected static Connection getConnection() { | |||
| return instance.createConnection(); | |||
| } | |||
| private Connection createConnection() { | |||
| Connection conn = null; | |||
| try { | |||
| @@ -31,8 +35,4 @@ public class MySqlConnFactory { | |||
| } | |||
| return conn; | |||
| } | |||
| public static Connection getConnection() { | |||
| return instance.createConnection(); | |||
| } | |||
| } | |||
| @@ -0,0 +1,4 @@ | |||
| /** | |||
| * Klassen fuer DB Zugriff. | |||
| */ | |||
| package de.uniluebeck.mi.projmi6.db; | |||
| @@ -34,6 +34,10 @@ public enum DiagArt { | |||
| } | |||
| } | |||
| public int id() { | |||
| return id; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return diagArt; | |||
| @@ -8,11 +8,19 @@ import javafx.beans.property.SimpleStringProperty; | |||
| public class Diagnose extends Version { | |||
| private Fall fall; | |||
| //ICDCODE | |||
| private int diagID; | |||
| private Icd10Code icd10code; | |||
| private Mitarbeiter arzt; | |||
| private SimpleStringProperty freiText = new SimpleStringProperty(this, "freiText"); | |||
| private DiagArt diagArt; | |||
| public int getDiagID() { | |||
| return diagID; | |||
| } | |||
| public void setDiagID(int diagID) { | |||
| this.diagID = diagID; | |||
| } | |||
| public Fall getFall() { | |||
| return fall; | |||
| @@ -5,7 +5,6 @@ import javafx.beans.property.SimpleIntegerProperty; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| import javafx.beans.property.SimpleStringProperty; | |||
| import java.text.SimpleDateFormat; | |||
| import java.time.LocalDateTime; | |||
| /** | |||
| @@ -15,7 +14,11 @@ public class Fall extends Version { | |||
| private Patient patient; | |||
| private Kasse kasse; | |||
| private Diagnose hauptDiagnose; | |||
| private Mitarbeiter einweisenderArzt; | |||
| private SimpleIntegerProperty hauptdiagnoseId = new SimpleIntegerProperty(this, "hauptdiagnoseId"); | |||
| private SimpleStringProperty einweisenderArzt = new SimpleStringProperty(this, "einweiser"); | |||
| private FallArt fallArt; | |||
| private SimpleBooleanProperty selbsteinweisung = new SimpleBooleanProperty(this, "selbsteinweisung"); | |||
| private SimpleStringProperty versichertenNummer = new SimpleStringProperty(this, "versichertenNummer"); | |||
| @@ -25,42 +28,55 @@ public class Fall extends Version { | |||
| private SimpleObjectProperty<LocalDateTime> entlassungsDatum = new SimpleObjectProperty<>(this, "entlassungsDatum"); | |||
| private SimpleIntegerProperty fallID = new SimpleIntegerProperty(this, "fallid"); | |||
| public void setVorstellDatum(LocalDateTime vorstellDatum) { | |||
| this.vorstellDatum.set(vorstellDatum); | |||
| } | |||
| public LocalDateTime getVorstellDatum() { | |||
| return vorstellDatum.get(); | |||
| } | |||
| public SimpleObjectProperty<LocalDateTime> vorstellDatumProperty() { | |||
| return vorstellDatum; | |||
| public int getHauptdiagnoseId() { | |||
| return hauptdiagnoseId.get(); | |||
| } | |||
| public void setVorstellDatum(LocalDateTime vorstellDatum) { | |||
| this.vorstellDatum.set(vorstellDatum); | |||
| public SimpleIntegerProperty hauptdiagnoseIdProperty() { | |||
| return hauptdiagnoseId; | |||
| } | |||
| public LocalDateTime getAufnahmeDatum() { | |||
| return aufnahmeDatum.get(); | |||
| public void setHauptdiagnoseId(int hauptdiagnoseId) { | |||
| this.hauptdiagnoseId.set(hauptdiagnoseId); | |||
| } | |||
| public SimpleObjectProperty<LocalDateTime> vorstellDatumProperty() { | |||
| return vorstellDatum; | |||
| } | |||
| public SimpleObjectProperty<LocalDateTime> aufnahmeDatumProperty() { | |||
| return aufnahmeDatum; | |||
| public LocalDateTime getAufnahmeDatum() { | |||
| return aufnahmeDatum.get(); | |||
| } | |||
| public void setAufnahmeDatum(LocalDateTime aufnahmeDatum) { | |||
| this.aufnahmeDatum.set(aufnahmeDatum); | |||
| } | |||
| public LocalDateTime getEntlassungsDatum() { | |||
| return entlassungsDatum.get(); | |||
| public SimpleObjectProperty<LocalDateTime> aufnahmeDatumProperty() { | |||
| return aufnahmeDatum; | |||
| } | |||
| public SimpleObjectProperty<LocalDateTime> entlassungsDatumProperty() { | |||
| return entlassungsDatum; | |||
| public LocalDateTime getEntlassungsDatum() { | |||
| return entlassungsDatum.get(); | |||
| } | |||
| public void setEntlassungsDatum(LocalDateTime entlassungsDatum) { | |||
| this.entlassungsDatum.set(entlassungsDatum); | |||
| } | |||
| public SimpleObjectProperty<LocalDateTime> entlassungsDatumProperty() { | |||
| return entlassungsDatum; | |||
| } | |||
| public Patient getPatient() { | |||
| return patient; | |||
| @@ -86,63 +102,71 @@ public class Fall extends Version { | |||
| this.hauptDiagnose = hauptDiagnose; | |||
| } | |||
| public Mitarbeiter getEinweisenderArzt() { | |||
| return einweisenderArzt; | |||
| public String getEinweisenderArzt() { | |||
| return einweisenderArzt.get(); | |||
| } | |||
| public void setEinweisenderArzt(Mitarbeiter einweisenderArzt) { | |||
| this.einweisenderArzt = einweisenderArzt; | |||
| public void setEinweisenderArzt(String einweisenderArzt) { | |||
| this.einweisenderArzt.set(einweisenderArzt); | |||
| } | |||
| public Enum<FallArt> getFallArt() { | |||
| return fallArt; | |||
| public SimpleStringProperty einweisenderArztProperty() { | |||
| return einweisenderArzt; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return Integer.toString(getFallID()); | |||
| public FallArt getFallArt() { | |||
| return fallArt; | |||
| } | |||
| public void setFallArt(FallArt fallArt) { | |||
| this.fallArt = fallArt; | |||
| } | |||
| public boolean getSelbsteinweisung() { | |||
| return selbsteinweisung.get(); | |||
| @Override | |||
| public String toString() { | |||
| if(getAufnahmeDatum()!=null){ | |||
| return getAufnahmeDatum().toLocalDate().toString(); | |||
| }else{ | |||
| return Integer.toString(getFallID()); | |||
| } | |||
| } | |||
| public SimpleBooleanProperty selbsteinweisungProperty() { | |||
| return selbsteinweisung; | |||
| public boolean getSelbsteinweisung() { | |||
| return selbsteinweisung.get(); | |||
| } | |||
| public void setSelbsteinweisung(boolean selbsteinweisung) { | |||
| this.selbsteinweisung.set(selbsteinweisung); | |||
| } | |||
| public String getVersichertenNummer() { | |||
| return versichertenNummer.get(); | |||
| public SimpleBooleanProperty selbsteinweisungProperty() { | |||
| return selbsteinweisung; | |||
| } | |||
| public SimpleStringProperty versichertenNummerProperts() { | |||
| return versichertenNummer; | |||
| public String getVersichertenNummer() { | |||
| return versichertenNummer.get(); | |||
| } | |||
| public void setVersichertenNummer(String versichertenNummer) { | |||
| this.versichertenNummer.set(versichertenNummer); | |||
| } | |||
| public boolean getStorniert() { | |||
| return storniert.get(); | |||
| public SimpleStringProperty versichertenNummerProperts() { | |||
| return versichertenNummer; | |||
| } | |||
| public SimpleBooleanProperty storniertProperty() { | |||
| return storniert; | |||
| public boolean getStorniert() { | |||
| return storniert.get(); | |||
| } | |||
| public void setStorniert(boolean storniert) { | |||
| this.storniert.set(storniert); | |||
| } | |||
| public SimpleBooleanProperty storniertProperty() { | |||
| return storniert; | |||
| } | |||
| public SimpleStringProperty versichertenNummerProperty() { | |||
| return versichertenNummer; | |||
| } | |||
| @@ -151,12 +175,12 @@ public class Fall extends Version { | |||
| return fallID.get(); | |||
| } | |||
| public SimpleIntegerProperty fallIDProperty() { | |||
| return fallID; | |||
| } | |||
| public void setFallID(int fallID) { | |||
| this.fallID.set(fallID); | |||
| } | |||
| public SimpleIntegerProperty fallIDProperty() { | |||
| return fallID; | |||
| } | |||
| } | |||
| @@ -27,6 +27,10 @@ public enum FallArt { | |||
| } | |||
| } | |||
| public String id() { | |||
| return id; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return fallArt; | |||
| @@ -0,0 +1,62 @@ | |||
| package de.uniluebeck.mi.projmi6.model; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| import javafx.beans.property.SimpleStringProperty; | |||
| import java.time.LocalDateTime; | |||
| /** | |||
| * Created by 631806 on 19.11.15. | |||
| */ | |||
| public class HL7LogEntry { | |||
| private final int msgid; | |||
| private final SimpleStringProperty message = new SimpleStringProperty(this, "message"); | |||
| private final SimpleStringProperty source = new SimpleStringProperty(this, "source"); | |||
| public HL7LogEntry(int msgid) { | |||
| this.msgid = msgid; | |||
| } | |||
| public LocalDateTime getTimestamp() { | |||
| return timestamp.get(); | |||
| } | |||
| public SimpleObjectProperty<LocalDateTime> timestampProperty() { | |||
| return timestamp; | |||
| } | |||
| public void setTimestamp(LocalDateTime timestamp) { | |||
| this.timestamp.set(timestamp); | |||
| } | |||
| public int getMsgid() { | |||
| return msgid; | |||
| } | |||
| public String getMessage() { | |||
| return message.get(); | |||
| } | |||
| public SimpleStringProperty messageProperty() { | |||
| return message; | |||
| } | |||
| public void setMessage(String message) { | |||
| this.message.set(message); | |||
| } | |||
| public String getSource() { | |||
| return source.get(); | |||
| } | |||
| public SimpleStringProperty sourceProperty() { | |||
| return source; | |||
| } | |||
| public void setSource(String source) { | |||
| this.source.set(source); | |||
| } | |||
| private final SimpleObjectProperty<LocalDateTime> timestamp = new SimpleObjectProperty<>(this, "timestamp"); | |||
| } | |||
| @@ -6,7 +6,7 @@ import javafx.beans.property.SimpleStringProperty; | |||
| /** | |||
| * Created by 627933 on 12.11.15. | |||
| */ | |||
| public class Kasse { | |||
| public class Kasse extends Version { | |||
| private SimpleStringProperty adresse = new SimpleStringProperty(this, "adresse"); | |||
| private SimpleIntegerProperty kassenID = new SimpleIntegerProperty(this, "kassenID"); | |||
| private SimpleStringProperty name = new SimpleStringProperty(this, "name"); | |||
| @@ -6,7 +6,7 @@ import javafx.beans.property.SimpleStringProperty; | |||
| /** | |||
| * Created by 627933 on 12.11.15. | |||
| */ | |||
| public class Mitarbeiter { | |||
| public class Mitarbeiter implements Comparable { | |||
| private SimpleStringProperty anrede = new SimpleStringProperty(this, "anrede"); | |||
| private SimpleStringProperty einweisenderArzt = new SimpleStringProperty(this, "einweisenderArzt"); | |||
| private SimpleStringProperty fachrichtung = new SimpleStringProperty(this, "fachrichtung"); | |||
| @@ -30,172 +30,177 @@ public class Mitarbeiter { | |||
| return anrede.get(); | |||
| } | |||
| public SimpleStringProperty anredeProperty() { | |||
| return anrede; | |||
| } | |||
| public void setAnrede(String anrede) { | |||
| this.anrede.set(anrede); | |||
| } | |||
| public String getEinweisenderArzt() { | |||
| return einweisenderArzt.get(); | |||
| public SimpleStringProperty anredeProperty() { | |||
| return anrede; | |||
| } | |||
| public SimpleStringProperty einweisenderArztProperty() { | |||
| return einweisenderArzt; | |||
| public String getEinweisenderArzt() { | |||
| return einweisenderArzt.get(); | |||
| } | |||
| public void setEinweisenderArzt(String einweisenderArzt) { | |||
| this.einweisenderArzt.set(einweisenderArzt); | |||
| } | |||
| public String getFachrichtung() { | |||
| return fachrichtung.get(); | |||
| public SimpleStringProperty einweisenderArztProperty() { | |||
| return einweisenderArzt; | |||
| } | |||
| public SimpleStringProperty fachrichtungProperty() { | |||
| return fachrichtung; | |||
| public String getFachrichtung() { | |||
| return fachrichtung.get(); | |||
| } | |||
| public void setFachrichtung(String fachrichtung) { | |||
| this.fachrichtung.set(fachrichtung); | |||
| } | |||
| public String getFachrichtungKurz() { | |||
| return fachrichtungKurz.get(); | |||
| public SimpleStringProperty fachrichtungProperty() { | |||
| return fachrichtung; | |||
| } | |||
| public SimpleStringProperty fachrichtungKurzProperty() { | |||
| return fachrichtungKurz; | |||
| public String getFachrichtungKurz() { | |||
| return fachrichtungKurz.get(); | |||
| } | |||
| public void setFachrichtungKurz(String fachrichtungKurz) { | |||
| this.fachrichtungKurz.set(fachrichtungKurz); | |||
| } | |||
| public String getLand() { | |||
| return land.get(); | |||
| public SimpleStringProperty fachrichtungKurzProperty() { | |||
| return fachrichtungKurz; | |||
| } | |||
| public SimpleStringProperty landProperty() { | |||
| return land; | |||
| public String getLand() { | |||
| return land.get(); | |||
| } | |||
| public void setLand(String land) { | |||
| this.land.set(land); | |||
| } | |||
| public int getMitarbID() { | |||
| return mitarbID.get(); | |||
| public SimpleStringProperty landProperty() { | |||
| return land; | |||
| } | |||
| public SimpleIntegerProperty mitarbIDProperty() { | |||
| return mitarbID; | |||
| public int getMitarbID() { | |||
| return mitarbID.get(); | |||
| } | |||
| public void setMitarbID(int mitarbID) { | |||
| this.mitarbID.set(mitarbID); | |||
| } | |||
| public String getNachname() { | |||
| return nachname.get(); | |||
| public SimpleIntegerProperty mitarbIDProperty() { | |||
| return mitarbID; | |||
| } | |||
| public SimpleStringProperty nachnameProperty() { | |||
| return nachname; | |||
| public String getNachname() { | |||
| return nachname.get(); | |||
| } | |||
| public void setNachname(String nachname) { | |||
| this.nachname.set(nachname); | |||
| } | |||
| public String getPlz() { | |||
| return plz.get(); | |||
| public SimpleStringProperty nachnameProperty() { | |||
| return nachname; | |||
| } | |||
| public SimpleStringProperty plzProperty() { | |||
| return plz; | |||
| public String getPlz() { | |||
| return plz.get(); | |||
| } | |||
| public void setPlz(String plz) { | |||
| this.plz.set(plz); | |||
| } | |||
| public String getStadt() { | |||
| return stadt.get(); | |||
| public SimpleStringProperty plzProperty() { | |||
| return plz; | |||
| } | |||
| public SimpleStringProperty stadtProperty() { | |||
| return stadt; | |||
| public String getStadt() { | |||
| return stadt.get(); | |||
| } | |||
| public void setStadt(String stadt) { | |||
| this.stadt.set(stadt); | |||
| } | |||
| public String getStrasse1() { | |||
| return strasse1.get(); | |||
| public SimpleStringProperty stadtProperty() { | |||
| return stadt; | |||
| } | |||
| public SimpleStringProperty strasse1Property() { | |||
| return strasse1; | |||
| public String getStrasse1() { | |||
| return strasse1.get(); | |||
| } | |||
| public void setStrasse1(String strasse1) { | |||
| this.strasse1.set(strasse1); | |||
| } | |||
| public String getStrasse2() { | |||
| return strasse2.get(); | |||
| public SimpleStringProperty strasse1Property() { | |||
| return strasse1; | |||
| } | |||
| public SimpleStringProperty strasse2Property() { | |||
| return strasse2; | |||
| public String getStrasse2() { | |||
| return strasse2.get(); | |||
| } | |||
| public void setStrasse2(String strasse2) { | |||
| this.strasse2.set(strasse2); | |||
| } | |||
| public String getTelefon() { | |||
| return telefon.get(); | |||
| public SimpleStringProperty strasse2Property() { | |||
| return strasse2; | |||
| } | |||
| public SimpleStringProperty telefonProperty() { | |||
| return telefon; | |||
| public String getTelefon() { | |||
| return telefon.get(); | |||
| } | |||
| public void setTelefon(String telefon) { | |||
| this.telefon.set(telefon); | |||
| } | |||
| public String getTitel() { | |||
| return titel.get(); | |||
| public SimpleStringProperty telefonProperty() { | |||
| return telefon; | |||
| } | |||
| public SimpleStringProperty titelProperty() { | |||
| return titel; | |||
| public String getTitel() { | |||
| return titel.get(); | |||
| } | |||
| public void setTitel(String titel) { | |||
| this.titel.set(titel); | |||
| } | |||
| public String getVorname() { | |||
| return vorname.get(); | |||
| public SimpleStringProperty titelProperty() { | |||
| return titel; | |||
| } | |||
| public SimpleStringProperty vornameProperty() { | |||
| return vorname; | |||
| public String getVorname() { | |||
| return vorname.get(); | |||
| } | |||
| public void setVorname(String vorname) { | |||
| this.vorname.set(vorname); | |||
| } | |||
| public SimpleStringProperty vornameProperty() { | |||
| return vorname; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return getNachname() + ", " + getVorname(); | |||
| } | |||
| @Override | |||
| public int compareTo(Object o) { | |||
| return nachname.get().compareTo(((Mitarbeiter) o).getNachname()); | |||
| } | |||
| } | |||
| @@ -234,6 +234,17 @@ public class Patient extends Version { | |||
| } | |||
| public static Geschlecht parseStringFromHL7(final String geschlecht) { | |||
| geschlecht.toLowerCase(); | |||
| if (geschlecht.startsWith("m")) { | |||
| return MALE; | |||
| } else if (geschlecht.startsWith("f")) { | |||
| return FEMALE; | |||
| } | |||
| return OTHER; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return geschlecht; | |||
| @@ -0,0 +1,79 @@ | |||
| package de.uniluebeck.mi.projmi6.model; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| import javafx.collections.FXCollections; | |||
| import javafx.collections.ObservableList; | |||
| /** | |||
| * Created by Johannes on 15/11/2015. | |||
| */ | |||
| public class Stammdaten { | |||
| private SimpleObjectProperty<ObservableList<OpsCode>> opsCodes = new SimpleObjectProperty<>(); | |||
| private SimpleObjectProperty<ObservableList<Icd10Code>> icd10Codes = new SimpleObjectProperty<>(); | |||
| private SimpleObjectProperty<ObservableList<Mitarbeiter>> mitarbeiter = new SimpleObjectProperty<>(); | |||
| private SimpleObjectProperty<ObservableList<Kasse>> kassen = new SimpleObjectProperty<>(); | |||
| private SimpleObjectProperty<ObservableList<Station>> stationen = new SimpleObjectProperty<>(); | |||
| public ObservableList<OpsCode> getOpsCodes() { | |||
| return opsCodes.get(); | |||
| } | |||
| public void setOpsCodes(ObservableList<OpsCode> opsCodes) { | |||
| this.opsCodesProperty().set(opsCodes); | |||
| } | |||
| public SimpleObjectProperty<ObservableList<OpsCode>> opsCodesProperty() { | |||
| return opsCodes; | |||
| } | |||
| public ObservableList<Icd10Code> getIcd10Codes() { | |||
| return icd10Codes.get(); | |||
| } | |||
| public void setIcd10Codes(ObservableList<Icd10Code> icd10Codes) { | |||
| this.icd10Codes.set(icd10Codes); | |||
| } | |||
| public SimpleObjectProperty<ObservableList<Icd10Code>> icd10CodesProperty() { | |||
| return icd10Codes; | |||
| } | |||
| public ObservableList<Station> getStationen() { | |||
| return stationen.get(); | |||
| } | |||
| public void setStationen(ObservableList<Station> stationen) { | |||
| FXCollections.sort(stationen); | |||
| this.stationen.set(stationen); | |||
| } | |||
| public SimpleObjectProperty<ObservableList<Station>> stationenProperty() { | |||
| return stationen; | |||
| } | |||
| public ObservableList<Mitarbeiter> getMitarbeiter() { | |||
| return mitarbeiter.get(); | |||
| } | |||
| public void setMitarbeiter(ObservableList<Mitarbeiter> mitarbeiter) { | |||
| FXCollections.sort(mitarbeiter); | |||
| this.mitarbeiter.set(mitarbeiter); | |||
| } | |||
| public SimpleObjectProperty<ObservableList<Mitarbeiter>> mitarbeiterProperty() { | |||
| return mitarbeiter; | |||
| } | |||
| public ObservableList<Kasse> getKassen() { | |||
| return kassen.get(); | |||
| } | |||
| public void setKassen(ObservableList<Kasse> kassen) { | |||
| this.kassen.set(kassen); | |||
| } | |||
| public SimpleObjectProperty<ObservableList<Kasse>> kassenProperty() { | |||
| return kassen; | |||
| } | |||
| } | |||
| @@ -6,63 +6,80 @@ import javafx.beans.property.SimpleStringProperty; | |||
| /** | |||
| * Created by 630030 on 12.11.15. | |||
| */ | |||
| public class Station { | |||
| public class Station implements Comparable { | |||
| private SimpleStringProperty bezeichnung = new SimpleStringProperty(this, "bezeichnung"); | |||
| private SimpleStringProperty bezeichnungLang = new SimpleStringProperty(this, "bezeichnungLang"); | |||
| private SimpleStringProperty station = new SimpleStringProperty(this, "station"); | |||
| private SimpleIntegerProperty stationstyp = new SimpleIntegerProperty( this, "stationstyp"); | |||
| private SimpleIntegerProperty stationstyp = new SimpleIntegerProperty(this, "stationstyp"); | |||
| private SimpleStringProperty abteilung = new SimpleStringProperty(this, "abteilung"); | |||
| public String getAbteilung() { | |||
| return abteilung.get(); | |||
| } | |||
| public String getBezeichnung() { | |||
| return bezeichnung.get(); | |||
| public void setAbteilung(String abteilung) { | |||
| this.abteilung.set(abteilung); | |||
| } | |||
| public SimpleStringProperty bezeichnungProperty() { | |||
| return bezeichnung; | |||
| public SimpleStringProperty abteilungProperty() { | |||
| return abteilung; | |||
| } | |||
| public String getBezeichnung() { | |||
| return bezeichnung.get(); | |||
| } | |||
| public void setBezeichnung(String bezeichnung) { | |||
| this.bezeichnung.set(bezeichnung); | |||
| } | |||
| public String getBezeichnungLang() { | |||
| return bezeichnungLang.get(); | |||
| public SimpleStringProperty bezeichnungProperty() { | |||
| return bezeichnung; | |||
| } | |||
| public SimpleStringProperty bezeichnungLangProperty() { | |||
| return bezeichnungLang; | |||
| public String getBezeichnungLang() { | |||
| return bezeichnungLang.get(); | |||
| } | |||
| public void setBezeichnungLang(String bezeichnungLang) { | |||
| this.bezeichnungLang.set(bezeichnungLang); | |||
| } | |||
| public String getStation() { | |||
| return station.get(); | |||
| public SimpleStringProperty bezeichnungLangProperty() { | |||
| return bezeichnungLang; | |||
| } | |||
| public SimpleStringProperty stationProperty() { | |||
| return station; | |||
| public String getStation() { | |||
| return station.get(); | |||
| } | |||
| public void setStation(String station) { | |||
| this.station.set(station); | |||
| } | |||
| public int getStationstyp() { | |||
| return stationstyp.get(); | |||
| public SimpleStringProperty stationProperty() { | |||
| return station; | |||
| } | |||
| public SimpleIntegerProperty stationstypProperty() { | |||
| return stationstyp; | |||
| public int getStationstyp() { | |||
| return stationstyp.get(); | |||
| } | |||
| public void setStationstyp(int stationstyp) { | |||
| this.stationstyp.set(stationstyp); | |||
| } | |||
| public SimpleIntegerProperty stationstypProperty() { | |||
| return stationstyp; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return getBezeichnung(); | |||
| } | |||
| @Override | |||
| public int compareTo(Object o) { | |||
| return bezeichnung.get().compareTo(((Station) o).getBezeichnung()); | |||
| } | |||
| } | |||
| @@ -2,6 +2,7 @@ package de.uniluebeck.mi.projmi6.model; | |||
| import javafx.beans.property.SimpleIntegerProperty; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| import javafx.beans.property.SimpleStringProperty; | |||
| import java.time.LocalDateTime; | |||
| @@ -11,40 +12,33 @@ import java.time.LocalDateTime; | |||
| public class StationsHistorie extends Version { | |||
| private SimpleObjectProperty<LocalDateTime> aufnahmeDatum = new SimpleObjectProperty<>(this, "aufnahmeDatum"); | |||
| private SimpleObjectProperty<LocalDateTime> entlassungsDatum = new SimpleObjectProperty<>(this, "entlassungsDatum"); | |||
| private Fall fall; | |||
| private int fallID; // platte Objektstruktur! | |||
| private Station station; | |||
| private SimpleStringProperty stationKey = new SimpleStringProperty(this, "stationskey"); // platte Objektstruktur! | |||
| private SimpleIntegerProperty StatHistID = new SimpleIntegerProperty(this, "stathistid"); | |||
| public LocalDateTime getAufnahmeDatum() { | |||
| return aufnahmeDatum.get(); | |||
| } | |||
| public SimpleObjectProperty<LocalDateTime> aufnahmeDatumProperty() { | |||
| return aufnahmeDatum; | |||
| } | |||
| public void setAufnahmeDatum(LocalDateTime aufnahmeDatum) { | |||
| this.aufnahmeDatum.set(aufnahmeDatum); | |||
| } | |||
| public LocalDateTime getEntlassungsDatum() { | |||
| return entlassungsDatum.get(); | |||
| public SimpleObjectProperty<LocalDateTime> aufnahmeDatumProperty() { | |||
| return aufnahmeDatum; | |||
| } | |||
| public SimpleObjectProperty<LocalDateTime> entlassungsDatumProperty() { | |||
| return entlassungsDatum; | |||
| public LocalDateTime getEntlassungsDatum() { | |||
| return entlassungsDatum.get(); | |||
| } | |||
| public void setEntlassungsDatum(LocalDateTime entlassungsDatum) { | |||
| this.entlassungsDatum.set(entlassungsDatum); | |||
| } | |||
| public Fall getFall() { | |||
| return fall; | |||
| } | |||
| public void setFall(Fall fall) { | |||
| this.fall = fall; | |||
| public SimpleObjectProperty<LocalDateTime> entlassungsDatumProperty() { | |||
| return entlassungsDatum; | |||
| } | |||
| public Station getStation() { | |||
| @@ -59,11 +53,31 @@ public class StationsHistorie extends Version { | |||
| return StatHistID.get(); | |||
| } | |||
| public void setStatHistID(int statHistID) { | |||
| this.StatHistID.set(statHistID); | |||
| } | |||
| public SimpleIntegerProperty statHistIDProperty() { | |||
| return StatHistID; | |||
| } | |||
| public void setStatHistID(int statHistID) { | |||
| this.StatHistID.set(statHistID); | |||
| public int getFallID() { | |||
| return fallID; | |||
| } | |||
| public void setFallID(int fallID) { | |||
| this.fallID = fallID; | |||
| } | |||
| public String getStationKey() { | |||
| return stationKey.get(); | |||
| } | |||
| public void setStationKey(String stationKey) { | |||
| this.stationKey.set(stationKey); | |||
| } | |||
| public SimpleStringProperty stationKeyProperty() { | |||
| return stationKey; | |||
| } | |||
| } | |||
| @@ -0,0 +1,4 @@ | |||
| /** | |||
| * Model Klassen. | |||
| */ | |||
| package de.uniluebeck.mi.projmi6.model; | |||
| @@ -0,0 +1,4 @@ | |||
| /** | |||
| * Projekt MI - Gruppe 6 - KIS | |||
| */ | |||
| package de.uniluebeck.mi.projmi6; | |||
| @@ -86,6 +86,7 @@ public class DateTimePicker extends HBox { | |||
| HBox timePicker = new HBox(hourText, colon,minuteText); | |||
| timePicker.maxHeightProperty().bind(datePicker.heightProperty()); | |||
| timePicker.getStyleClass().add("time-picker"); | |||
| timePicker.setMinWidth(55); | |||
| timePicker.setMaxWidth(70); | |||
| timePicker.getStyleClass().add("button"); | |||
| @@ -94,9 +95,12 @@ public class DateTimePicker extends HBox { | |||
| btnNow.setOnAction(event -> setToCurrentDateTime()); | |||
| //Make it large enough to read the text | |||
| btnNow.setMinWidth(50); | |||
| btnNow.getStyleClass().add("now-button"); | |||
| //Add the subcomponents to the view. | |||
| this.getChildren().addAll(datePicker,timePicker,btnNow); | |||
| this.setSpacing(5); | |||
| } | |||
| @@ -113,9 +117,11 @@ public class DateTimePicker extends HBox { | |||
| minuteText.setText(""); | |||
| datePicker.setValue(null); | |||
| }else{ | |||
| hourText.setText(Integer.toString(localDateTime.getHour())); | |||
| minuteText.setText(Integer.toString(localDateTime.getMinute())); | |||
| datePicker.setValue(LocalDate.from(localDateTime)); | |||
| hourText.setText(Integer.toString(localDateTime.getHour())); | |||
| int minute = localDateTime.getMinute(); | |||
| minuteText.setText((minute<9?"0":"")+Integer.toString(minute)); | |||
| } | |||
| } | |||
| @@ -0,0 +1,87 @@ | |||
| package de.uniluebeck.mi.projmi6.view; | |||
| import com.sun.javafx.scene.control.skin.ComboBoxListViewSkin; | |||
| import javafx.beans.value.ChangeListener; | |||
| import javafx.beans.value.ObservableValue; | |||
| import javafx.collections.ObservableList; | |||
| import javafx.event.EventHandler; | |||
| import javafx.scene.control.ComboBox; | |||
| import javafx.scene.control.ListView; | |||
| import javafx.scene.input.KeyCode; | |||
| import javafx.scene.input.KeyEvent; | |||
| import javafx.scene.input.MouseEvent; | |||
| /** | |||
| * Created by nils on 19.11.2015. | |||
| * <p/> | |||
| * Geklaut von <a href="http://tech.chitgoks.com/2013/07/19/how-to-go-to-item-in-combobox-on-keypress-in-java-fx-2/">hier</a> | |||
| */ | |||
| public class SelectKeyComboBoxListener implements EventHandler<KeyEvent> { | |||
| private ComboBox comboBox; | |||
| private StringBuilder sb = new StringBuilder(); | |||
| public SelectKeyComboBoxListener(ComboBox comboBox) { | |||
| this.comboBox = comboBox; | |||
| this.comboBox.setOnKeyReleased(SelectKeyComboBoxListener.this); | |||
| this.comboBox.addEventFilter(KeyEvent.KEY_RELEASED, new EventHandler<KeyEvent>() { | |||
| @Override | |||
| public void handle(KeyEvent event) { | |||
| if (event.getCode() == KeyCode.ESCAPE && sb.length() > 0) { | |||
| sb.delete(0, sb.length()); | |||
| } | |||
| } | |||
| }); | |||
| // add a focus listener such that if not in focus, reset the filtered typed keys | |||
| this.comboBox.focusedProperty().addListener(new ChangeListener() { | |||
| @Override | |||
| public void changed(ObservableValue observable, Object oldValue, Object newValue) { | |||
| if (newValue instanceof Boolean && !((Boolean) newValue).booleanValue()) | |||
| sb.delete(0, sb.length()); | |||
| else { | |||
| ListView lv = ((ComboBoxListViewSkin) SelectKeyComboBoxListener.this.comboBox.getSkin()).getListView(); | |||
| lv.scrollTo(lv.getSelectionModel().getSelectedIndex()); | |||
| } | |||
| } | |||
| }); | |||
| this.comboBox.setOnMouseClicked(new EventHandler<MouseEvent>() { | |||
| @Override | |||
| public void handle(MouseEvent event) { | |||
| ListView lv = ((ComboBoxListViewSkin) SelectKeyComboBoxListener.this.comboBox.getSkin()).getListView(); | |||
| lv.scrollTo(lv.getSelectionModel().getSelectedIndex()); | |||
| } | |||
| }); | |||
| } | |||
| @Override | |||
| public void handle(KeyEvent event) { | |||
| if (event.getCode() == KeyCode.DOWN || event.getCode() == KeyCode.UP || event.getCode() == KeyCode.TAB) { | |||
| return; | |||
| } else if (event.getCode() == KeyCode.BACK_SPACE && sb.length() > 0) { | |||
| sb.deleteCharAt(sb.length() - 1); | |||
| } else { | |||
| sb.append(event.getText()); | |||
| } | |||
| if (sb.length() == 0) | |||
| return; | |||
| boolean found = false; | |||
| ObservableList items = comboBox.getItems(); | |||
| for (int i = 0; i < items.size(); i++) { | |||
| if (event.getCode() != KeyCode.BACK_SPACE && items.get(i).toString().toLowerCase().startsWith(sb.toString().toLowerCase())) { | |||
| ListView lv = ((ComboBoxListViewSkin) comboBox.getSkin()).getListView(); | |||
| lv.getSelectionModel().clearAndSelect(i); | |||
| lv.scrollTo(lv.getSelectionModel().getSelectedIndex()); | |||
| found = true; | |||
| break; | |||
| } | |||
| } | |||
| if (!found && sb.length() > 0) | |||
| sb.deleteCharAt(sb.length() - 1); | |||
| } | |||
| } | |||
| @@ -0,0 +1,4 @@ | |||
| /** | |||
| * View Klassen. | |||
| */ | |||
| package de.uniluebeck.mi.projmi6.view; | |||
| @@ -22,7 +22,7 @@ | |||
| </VBox> | |||
| <VBox> | |||
| <children> | |||
| <GridPane vgap="5.0"> | |||
| <GridPane vgap="5.0" fx:id="fields" styleClass="fields"> | |||
| <columnConstraints> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |||
| @@ -46,7 +46,8 @@ | |||
| </GridPane> | |||
| <HBox alignment="TOP_RIGHT" spacing="5.0" VBox.vgrow="ALWAYS"> | |||
| <children> | |||
| <Button fx:id="btnDiagCancel" mnemonicParsing="false" onAction="#clickedDiagCancel" text="Storno" /> | |||
| <Button fx:id="btnDiagAbort" mnemonicParsing="false" onAction="#clickedAbort" text="Abbrechen" /> | |||
| <Button fx:id="btnDiagEdit" mnemonicParsing="false" onAction="#clickedEdit" text="Bearbeiten" /> | |||
| <Button fx:id="btnDiagSave" mnemonicParsing="false" onAction="#clickedDiagSave" text="Speichern" /> | |||
| </children> | |||
| <VBox.margin> | |||
| @@ -10,34 +10,20 @@ | |||
| <?import de.uniluebeck.mi.projmi6.view.DateTimePicker?> | |||
| <VBox fx:controller="de.uniluebeck.mi.projmi6.controller.FallController" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> | |||
| <children> | |||
| <GridPane vgap="5.0" fx:id="fallFields"> | |||
| <GridPane vgap="5.0" fx:id="fallFields" styleClass="fields"> | |||
| <children> | |||
| <Label text="Patient:"/> | |||
| <Label fx:id="fallPatID" text="John Doe (PatID = XXX)" GridPane.columnIndex="1"/> | |||
| <Label text="Aufnahmedatum:" GridPane.rowIndex="1"/> | |||
| <!-- <HBox prefHeight="100.0" prefWidth="200.0" spacing="5.0" GridPane.columnIndex="1" GridPane.rowIndex="1"> | |||
| <children> | |||
| <DatePicker fx:id="fallAufnDate"/> | |||
| <TextField fx:id="fallAufnTime" prefColumnCount="5" promptText="HH:MM"/> | |||
| <Button fx:id="btnFallAufnNow" mnemonicParsing="false" onAction="#clickedFallAufnNow" | |||
| text="Jetzt"/> | |||
| </children> | |||
| <GridPane.margin> | |||
| <Insets/> | |||
| </GridPane.margin> | |||
| </HBox>--> | |||
| <DateTimePicker GridPane.rowIndex="1" GridPane.columnIndex="1" fx:id="dtTmAufnahme" /> | |||
| <Label text="Entlassungsdatum:" GridPane.rowIndex="2"/> | |||
| <!--<HBox prefHeight="100.0" prefWidth="200.0" spacing="5.0" GridPane.columnIndex="1" GridPane.rowIndex="2"> | |||
| <children> | |||
| <DatePicker fx:id="fallEntlDate"/> | |||
| <TextField fx:id="fallEntlTime" prefColumnCount="5" promptText="HH:MM"/> | |||
| <Button fx:id="btnFallEntlNow" mnemonicParsing="false" onAction="#clickedFallEntlNow" | |||
| text="Jetzt"/> | |||
| </children> | |||
| </HBox>--> | |||
| <DateTimePicker GridPane.rowIndex="2" GridPane.columnIndex="1" fx:id="dtTmEntlassung" /> | |||
| <Label text="Versichertennummer:" GridPane.rowIndex="3"/> | |||
| <TextField fx:id="fallVersichertennummer" GridPane.columnIndex="1" GridPane.rowIndex="3"/> | |||
| <Label text="Einweisender Arzt:" GridPane.rowIndex="4"/> | |||
| <HBox alignment="CENTER_LEFT" spacing="5.0" GridPane.columnIndex="1" GridPane.rowIndex="4"> | |||
| <children> | |||
| @@ -46,11 +32,13 @@ | |||
| <CheckBox fx:id="fallSelbsteinweisung" mnemonicParsing="false" text="Selbsteinweisung"/> | |||
| </children> | |||
| </HBox> | |||
| <Label text="Fallart:" GridPane.rowIndex="5"/> | |||
| <ComboBox fx:id="fallFallart" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="5"/> | |||
| <Label text="Kasse:" GridPane.rowIndex="6"/> | |||
| <ComboBox fx:id="fallKasse" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="6"/> | |||
| <TextField fx:id="fallVersichertennummer" GridPane.columnIndex="1" GridPane.rowIndex="3"/> | |||
| <ComboBox fx:id="fallKasse" prefWidth="250.0" GridPane.columnIndex="1" GridPane.rowIndex="6"/> | |||
| <Label text="Hauptdiagnose:" GridPane.rowIndex="7"/> | |||
| <ComboBox fx:id="fallHauptdiagnose" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="7"/> | |||
| </children> | |||
| @@ -79,7 +67,16 @@ | |||
| <Insets right="5.0"/> | |||
| </HBox.margin> | |||
| </Button> | |||
| <Button fx:id="btnFallCancel" mnemonicParsing="false" onAction="#clickedFallCancel" text="Storno"/> | |||
| <Button fx:id="btnFallSendHl7" mnemonicParsing="false" onAction="#clickedSendHl7" text="Sende HL7"> | |||
| <HBox.margin> | |||
| <Insets left="5.0" right="5.0"/> | |||
| </HBox.margin> | |||
| </Button> | |||
| <Button fx:id="btnFallCancel" mnemonicParsing="false" onAction="#clickedFallCancel" text="Storno"> | |||
| <HBox.margin> | |||
| <Insets left="5.0" right="5.0"/> | |||
| </HBox.margin> | |||
| </Button> | |||
| <Button fx:id="btnFallAbort" cancelButton="true" mnemonicParsing="false" onAction="#clickedFallAbort" | |||
| text="Abbrechen"> | |||
| <HBox.margin> | |||
| @@ -99,8 +96,8 @@ | |||
| <children> | |||
| <Label styleClass="ersteller-label" text="Ersteller: "/> | |||
| <Label styleClass="ersteller-label" text="Erstelldatum:" GridPane.rowIndex="1"/> | |||
| <Label styleClass="ersteller-value" fx:id="fallCreator" text="Doc Holiday" GridPane.columnIndex="1"/> | |||
| <Label styleClass="ersteller-value" fx:id="fallCreateTime" text="12.01.2011 12:50" GridPane.columnIndex="1" | |||
| <Label styleClass="ersteller-value" fx:id="fallCreator" text="" GridPane.columnIndex="1"/> | |||
| <Label styleClass="ersteller-value" fx:id="fallCreateTime" text="" GridPane.columnIndex="1" | |||
| GridPane.rowIndex="1"/> | |||
| </children> | |||
| <columnConstraints> | |||
| @@ -124,8 +121,8 @@ | |||
| <children> | |||
| <Label styleClass="ersteller-label" text="Letzter Bearbeiter"/> | |||
| <Label styleClass="ersteller-label" text="Letzte Änderung:" GridPane.rowIndex="1"/> | |||
| <Label styleClass="ersteller-value" fx:id="fallEditor" text="Dr. House" GridPane.columnIndex="1"/> | |||
| <Label styleClass="ersteller-value" fx:id="fallEditTime" text="11.11.2011 11:11" GridPane.columnIndex="1" | |||
| <Label styleClass="ersteller-value" fx:id="fallEditor" text="" GridPane.columnIndex="1"/> | |||
| <Label styleClass="ersteller-value" fx:id="fallEditTime" text="" GridPane.columnIndex="1" | |||
| GridPane.rowIndex="1"/> | |||
| </children> | |||
| </GridPane> | |||
| @@ -6,8 +6,14 @@ | |||
| <?import javafx.scene.layout.*?> | |||
| <?import java.net.URL?> | |||
| <VBox minHeight="-Infinity" minWidth="-Infinity" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> | |||
| <VBox minHeight="-Infinity" minWidth="-Infinity" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.uniluebeck.mi.projmi6.controller.LogController"> | |||
| <children> | |||
| <ToolBar prefHeight="40.0" prefWidth="200.0"> | |||
| <items> | |||
| <Pane HBox.hgrow="ALWAYS" /> | |||
| <Button fx:id="btnRefresh" text="Liste aktualisieren" onAction="#clickedRefresh"/> | |||
| </items> | |||
| </ToolBar> | |||
| <TableView fx:id="tblLog" VBox.vgrow="ALWAYS"> | |||
| <columns> | |||
| <TableColumn fx:id="colLogIp" editable="false" prefWidth="75.0" text="Ursprungs-IP" /> | |||
| @@ -27,7 +27,9 @@ | |||
| <Button fx:id="btnFallCreate" text="Neuen _Fall erstellen" onAction="#clickedCreateFall"/> | |||
| </items> | |||
| </ToolBar> | |||
| <ListView VBox.vgrow="ALWAYS" fx:id="lvFall" /> | |||
| <ListView VBox.vgrow="ALWAYS" fx:id="lvFall" > | |||
| <placeholder><Label fx:id="lvFallPlaceholder" /></placeholder> | |||
| </ListView> | |||
| </children> | |||
| </VBox> | |||
| <TabPane fx:id="tabPaneFall" prefHeight="200.0" prefWidth="200.0" tabClosingPolicy="UNAVAILABLE"> | |||
| @@ -1,23 +1,22 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <?import java.net.*?> | |||
| <?import javafx.geometry.*?> | |||
| <?import javafx.scene.text.*?> | |||
| <?import javafx.scene.control.*?> | |||
| <?import java.lang.*?> | |||
| <?import javafx.scene.layout.*?> | |||
| <?import java.net.URL?> | |||
| <VBox fx:controller="de.uniluebeck.mi.projmi6.controller.PatientEditorController" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="633.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> | |||
| <VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="633.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.uniluebeck.mi.projmi6.controller.PatientEditorController"> | |||
| <children> | |||
| <GridPane> | |||
| <columnConstraints> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="35.0" prefWidth="100.0" /> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |||
| </columnConstraints> | |||
| <rowConstraints> | |||
| <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |||
| <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/> | |||
| <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |||
| <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |||
| <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |||
| <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |||
| @@ -29,49 +28,60 @@ | |||
| <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |||
| <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |||
| <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |||
| <RowConstraints maxHeight="1.7976931348623157E308" minHeight="10.0" vgrow="SOMETIMES" /> | |||
| </rowConstraints> | |||
| <children> | |||
| <Label text="PatID:" /> | |||
| <Label fx:id="patId" text="xxxx" GridPane.columnIndex="1" /> | |||
| <Label text="Vorname:" GridPane.rowIndex="1" /> | |||
| <TextField fx:id="patVorname" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |||
| <TextField fx:id="patVorname" promptText="Vorname" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |||
| <Label text="Geburtsname:" GridPane.rowIndex="2" /> | |||
| <TextField fx:id="patGeburtsname" GridPane.columnIndex="1" GridPane.rowIndex="2" /> | |||
| <TextField fx:id="patGeburtsname" promptText="Geburtsname" GridPane.columnIndex="1" GridPane.rowIndex="2" /> | |||
| <Label text="Nachname:" GridPane.rowIndex="3" /> | |||
| <TextField fx:id="patNachname" GridPane.columnIndex="1" GridPane.rowIndex="3" /> | |||
| <TextField fx:id="patNachname" promptText="Nachname" GridPane.columnIndex="1" GridPane.rowIndex="3" /> | |||
| <Label text="Straße:" GridPane.rowIndex="4" /> | |||
| <TextField fx:id="patStrasse" GridPane.columnIndex="1" GridPane.rowIndex="4" /> | |||
| <Label text="Straße / Hausnummer:" GridPane.rowIndex="4" /> | |||
| <HBox alignment="CENTER_RIGHT" spacing="5.0" GridPane.columnIndex="1" GridPane.rowIndex="4"> | |||
| <children> | |||
| <TextField fx:id="patStrasse" promptText="Straße" GridPane.columnIndex="1" GridPane.rowIndex="4" HBox.hgrow="ALWAYS" /> | |||
| <TextField fx:id="patHausnummer" promptText="Hausnummer" HBox.hgrow="SOMETIMES" /> | |||
| </children> | |||
| </HBox> | |||
| <Label text="Hausnummer:" GridPane.rowIndex="5" /> | |||
| <TextField fx:id="patHausnummer" GridPane.columnIndex="1" GridPane.rowIndex="5" /> | |||
| <Label text="PLZ / Ort:" GridPane.rowIndex="5" /> | |||
| <HBox alignment="CENTER_RIGHT" spacing="5.0" GridPane.columnIndex="1" GridPane.rowIndex="5"> | |||
| <children> | |||
| <TextField fx:id="patPlz" promptText="PLZ" GridPane.columnIndex="1" GridPane.rowIndex="6" HBox.hgrow="SOMETIMES" /> | |||
| <TextField fx:id="patOrt" promptText="Ort" HBox.hgrow="ALWAYS" /> | |||
| </children> | |||
| </HBox> | |||
| <Label text="PLZ:" GridPane.rowIndex="6" /> | |||
| <TextField fx:id="patPlz" GridPane.columnIndex="1" GridPane.rowIndex="6" /> | |||
| <Label text="Telefonnummer:" GridPane.rowIndex="6" /> | |||
| <TextField fx:id="patTelefonnummer" promptText="Telefonnummer" GridPane.columnIndex="1" GridPane.rowIndex="6" /> | |||
| <Label text="Ort:" GridPane.rowIndex="7" /> | |||
| <TextField fx:id="patOrt" GridPane.columnIndex="1" GridPane.rowIndex="7" /> | |||
| <Label text="Geburtsdatum:" GridPane.rowIndex="8" /> | |||
| <DatePicker fx:id="patGeburtsdatum" GridPane.columnIndex="1" GridPane.rowIndex="8" /> | |||
| <Label text="Geburtsdatum:" GridPane.rowIndex="7" /> | |||
| <DatePicker fx:id="patGeburtsdatum" promptText="Geburtsdatum" GridPane.columnIndex="1" GridPane.rowIndex="7" /> | |||
| <Label text="Familienstand:" GridPane.rowIndex="9" /> | |||
| <ComboBox fx:id="patFamilienstand" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="9" /> | |||
| <Label text="Familienstand:" GridPane.rowIndex="8" /> | |||
| <ComboBox fx:id="patFamilienstand" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="8" /> | |||
| <Label text="Geschlecht:" GridPane.rowIndex="10" /> | |||
| <ComboBox fx:id="patGeschlecht" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="10" /> | |||
| <Label text="Geschlecht:" GridPane.rowIndex="9" /> | |||
| <ComboBox fx:id="patGeschlecht" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="9" /> | |||
| <Label text="Versicherungsnummer:" GridPane.rowIndex="11" /> | |||
| <TextField fx:id="patVersicherungsnummer" GridPane.columnIndex="1" GridPane.rowIndex="11" /> | |||
| <Label text="Versicherungsnummer:" GridPane.rowIndex="10" /> | |||
| <TextField fx:id="patVersicherungsnummer" promptText="Versicherungsnummer" GridPane.columnIndex="1" GridPane.rowIndex="10" /> | |||
| <Label text="Versicherung:" GridPane.rowIndex="12" /> | |||
| <ComboBox fx:id="patVersicherung" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="12" /> | |||
| <Label text="Versicherung:" GridPane.rowIndex="11" /> | |||
| <ComboBox fx:id="patVersicherung" prefWidth="225.0" GridPane.columnIndex="1" GridPane.rowIndex="11" /> | |||
| <Label text="CAVE:" GridPane.rowIndex="13" /> | |||
| <TextArea fx:id="patCave" prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="13" /> | |||
| <Label text="CAVE:" GridPane.rowIndex="12" /> | |||
| <TextArea fx:id="patCave" maxHeight="100.0" prefHeight="56.0" prefWidth="383.0" promptText="CAVE" GridPane.columnIndex="1" GridPane.rowIndex="12"> | |||
| <GridPane.margin> | |||
| <Insets top="5.0" /> | |||
| </GridPane.margin></TextArea> | |||
| </children> | |||
| <VBox.margin> | |||
| @@ -105,8 +115,8 @@ | |||
| <children> | |||
| <Label styleClass="ersteller-label" text="Ersteller: " GridPane.rowIndex="0" /> | |||
| <Label styleClass="ersteller-label" text="Erstelldatum:" GridPane.rowIndex="1" /> | |||
| <Label styleClass="ersteller-value" fx:id="patCreator" GridPane.columnIndex="1" GridPane.rowIndex="0" /> | |||
| <Label styleClass="ersteller-value" fx:id="patCreateTime" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |||
| <Label fx:id="patCreator" styleClass="ersteller-value" GridPane.columnIndex="1" GridPane.rowIndex="0" /> | |||
| <Label fx:id="patCreateTime" styleClass="ersteller-value" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |||
| </children> | |||
| <columnConstraints> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="50.0" /> | |||
| @@ -123,19 +133,19 @@ | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |||
| </columnConstraints> | |||
| <rowConstraints> | |||
| <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |||
| <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |||
| <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |||
| <RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | |||
| </rowConstraints> | |||
| <children> | |||
| <Label styleClass="ersteller-label" text="Letzter Bearbeiter:" GridPane.rowIndex="0" /> | |||
| <Label styleClass="ersteller-label" text="Letzte Änderung:" GridPane.rowIndex="1" /> | |||
| <Label styleClass="ersteller-value" fx:id="patChanger" GridPane.columnIndex="1" GridPane.rowIndex="0" /> | |||
| <Label styleClass="ersteller-value" fx:id="patChangeTime" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |||
| <Label fx:id="patChanger" styleClass="ersteller-value" GridPane.columnIndex="1" GridPane.rowIndex="0" /> | |||
| <Label fx:id="patChangeTime" styleClass="ersteller-value" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |||
| </children> | |||
| </GridPane> | |||
| </children> | |||
| <VBox.margin> | |||
| <Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/> | |||
| <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> | |||
| </VBox.margin> | |||
| </GridPane> | |||
| </children> | |||
| @@ -17,6 +17,8 @@ | |||
| <items> | |||
| <Button fx:id="btnPatCreate" text="Neuen _Patient erstellen" onAction="#clickedCreatePatient" /> | |||
| <Button fx:id="btnPatEdit" text="Patient _bearbeiten" onAction="#clickedEditPatient"/> | |||
| <Pane HBox.hgrow="ALWAYS" /> | |||
| <Button fx:id="btnPatRefresh" text="Liste aktualisieren" onAction="#clickedRefreshPatient"/> | |||
| </items> | |||
| </ToolBar> | |||
| <TableView fx:id="tblPatientOverview" editable="true" tableMenuButtonVisible="true" VBox.vgrow="ALWAYS"> | |||
| @@ -56,9 +58,10 @@ | |||
| <children> | |||
| <ToolBar prefHeight="40.0" prefWidth="200.0"> | |||
| <items> | |||
| <Label text="Station:" /> | |||
| <ComboBox fx:id="cmbStationenFilter" prefWidth="150.0" promptText="Stationen" /> | |||
| <ComboBox fx:id="cmbStationenFilter" prefWidth="250.0" promptText="Station auswählen..." /> | |||
| <ToggleButton fx:id="btnEntlassenePatientenZeigen" mnemonicParsing="false" text="Entlassene Patienten zeigen" /> | |||
| <Pane HBox.hgrow="ALWAYS" /> | |||
| <Button fx:id="btnStatRefresh" text="Liste aktualisieren" onAction="#clickedRefreshStation"/> | |||
| </items> | |||
| </ToolBar> | |||
| <SplitPane prefHeight="160.0" prefWidth="200.0" VBox.vgrow="ALWAYS"> | |||
| @@ -16,22 +16,24 @@ | |||
| <children> | |||
| <ToolBar prefHeight="40.0" prefWidth="200.0"> | |||
| <items> | |||
| <Button mnemonicParsing="false" text="Neuen Aufenthalt erstellen" onAction="#clickedCreateAufenthalt"/> | |||
| <Button mnemonicParsing="false" text="Neuen Aufenthalt erstellen" fx:id="btnStatHistCreate" onAction="#clickedCreateAufenthalt"/> | |||
| </items> | |||
| </ToolBar> | |||
| <TableView prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS" fx:id="tblStationsHistorie"> | |||
| <TableView prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS" fx:id="tblStationsHistorie" > | |||
| <columns> | |||
| <TableColumn prefWidth="75.0" text="Abteilung" fx:id="colStatHistAbteilung"/> | |||
| <TableColumn prefWidth="75.0" text="Station" fx:id="colStatHistStation"/> | |||
| <TableColumn prefWidth="75.0" text="Aufnahme" fx:id="colStatHistAufnahmeDatum"/> | |||
| <TableColumn prefWidth="75.0" text="Entlassung" fx:id="colStatHistEntlassungsDatum"/> | |||
| </columns> | |||
| <columnResizePolicy> | |||
| <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> | |||
| </columnResizePolicy> | |||
| </TableView> | |||
| </children> | |||
| </VBox> | |||
| <VBox> | |||
| <children> | |||
| <GridPane VBox.vgrow="ALWAYS"> | |||
| <GridPane VBox.vgrow="ALWAYS" fx:id="fields" styleClass="fields"> | |||
| <columnConstraints> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/> | |||
| @@ -44,18 +46,24 @@ | |||
| </rowConstraints> | |||
| <children> | |||
| <Label text="Abteilung:"/> | |||
| <ComboBox prefWidth="150.0" GridPane.columnIndex="1" fx:id="cmbAbteilung"/> | |||
| <Label text="Station:" GridPane.rowIndex="1"/> | |||
| <ComboBox prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="1" fx:id="cmbStation"/> | |||
| <Label text="Aufnahmedatum / -Zeit:" GridPane.rowIndex="2" /> | |||
| <DateTimePicker GridPane.columnIndex="1" GridPane.rowIndex="2" fx:id="dtTmAufnahme"/> | |||
| <Label text="Entlassungsdatum/ -Zeit:" GridPane.rowIndex="3"/> | |||
| <DateTimePicker GridPane.columnIndex="1" GridPane.rowIndex="3" fx:id="dtTmEntlassung"/> | |||
| <ComboBox prefWidth="150.0" GridPane.columnIndex="1"/> | |||
| <ComboBox prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="1"/> | |||
| </children> | |||
| </GridPane> | |||
| <HBox alignment="CENTER_RIGHT"> | |||
| <children> | |||
| <Button mnemonicParsing="false" text="Bearbeiten" onAction="#clickedEdit" fx:id="btnStatHistEdit"/> | |||
| <Button mnemonicParsing="false" text="Abbrechen" onAction="#clickedAbort" fx:id="btnStatHistAbort"/> | |||
| <Button mnemonicParsing="false" text="Speichern" onAction="#clickedSave" fx:id="btnStatHistSave"/> | |||
| <Button mnemonicParsing="false" text="Entfernen" onAction="#clickedDelete" fx:id="btnStatHistDelete"/> | |||
| <Button disable="true" mnemonicParsing="false" text="Eintrag entfernen" fx:id="btnStatHistCancel" onAction="#clickedCancel"/> | |||
| </children> | |||
| </HBox> | |||
| @@ -65,10 +73,10 @@ | |||
| <Label styleClass="ersteller-label" text="Erstelldatum:" GridPane.rowIndex="1"/> | |||
| <Label styleClass="ersteller-label" text="Letzter Bearbeiter:" GridPane.rowIndex="2"/> | |||
| <Label styleClass="ersteller-label" text="Letzte Änderung:" GridPane.rowIndex="3"/> | |||
| <Label styleClass="ersteller-value" GridPane.columnIndex="1" GridPane.rowIndex="0" fx:id="statHistCreator" text="a"/> | |||
| <Label styleClass="ersteller-value" GridPane.columnIndex="1" GridPane.rowIndex="1" fx:id="statHistCreateTime" text="b"/> | |||
| <Label styleClass="ersteller-value" GridPane.columnIndex="1" GridPane.rowIndex="2" fx:id="statHistEditor" text="c"/> | |||
| <Label styleClass="ersteller-value" GridPane.columnIndex="1" GridPane.rowIndex="3" fx:id="statHistEditTime" text="d"/> | |||
| <Label styleClass="ersteller-value" GridPane.columnIndex="1" GridPane.rowIndex="0" fx:id="statHistCreator" text=""/> | |||
| <Label styleClass="ersteller-value" GridPane.columnIndex="1" GridPane.rowIndex="1" fx:id="statHistCreateTime" text=""/> | |||
| <Label styleClass="ersteller-value" GridPane.columnIndex="1" GridPane.rowIndex="2" fx:id="statHistEditor" text=""/> | |||
| <Label styleClass="ersteller-value" GridPane.columnIndex="1" GridPane.rowIndex="3" fx:id="statHistEditTime" text=""/> | |||
| </children> | |||
| <columnConstraints> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="50.0"/> | |||
| @@ -4,4 +4,55 @@ | |||
| .ersteller-value { | |||
| /* -fx-text-fill: red; */ | |||
| } | |||
| } | |||
| DateTimePicker .text-field{ | |||
| -fx-background-color:transparent; | |||
| } | |||
| .fields:disabled{ | |||
| -fx-opacity: 1; | |||
| } | |||
| .fields:disabled HBox { | |||
| -fx-opacity: 1; | |||
| } | |||
| .fields:disabled .text-field{ | |||
| -fx-text-fill: black; | |||
| -fx-background-color: transparent; | |||
| -fx-opacity: 1; | |||
| } | |||
| .fields:disabled .label{ | |||
| -fx-opacity: 1; | |||
| } | |||
| .fields:disabled ComboBox{ | |||
| -fx-opacity: 1; | |||
| -fx-background-color: transparent; | |||
| -fx-text-fill: black; | |||
| } | |||
| .fields:disabled .list-cell{ | |||
| -fx-opacity: 1; | |||
| -fx-background-color: transparent; | |||
| -fx-text-fill: black; | |||
| } | |||
| .fields:disabled .time-picker { | |||
| -fx-background-color: transparent; | |||
| } | |||
| .fields:disabled .arrow-button{ | |||
| -fx-opacity: 0; | |||
| } | |||
| .fields:disabled .arrow{ | |||
| -fx-opacity: 0; | |||
| } | |||
| .fields:disabled .date-picker { | |||
| -fx-opacity: 1; | |||
| -fx-background-color: transparent; | |||
| } | |||
| .fields:disabled .now-button { | |||
| visibility: hidden; | |||
| } | |||
| @@ -20,7 +20,7 @@ | |||
| </VBox> | |||
| <VBox prefHeight="200.0" prefWidth="100.0"> | |||
| <children> | |||
| <GridPane vgap="5.0"> | |||
| <GridPane vgap="5.0" styleClass="fields" fx:id="fields"> | |||
| <columnConstraints> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="40.0" prefWidth="100.0" /> | |||
| <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> | |||
| @@ -31,24 +31,20 @@ | |||
| <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> | |||
| </rowConstraints> | |||
| <children> | |||
| <Label text="OPS-Code" /> | |||
| <Label text="OPS-Code:" /> | |||
| <ComboBox fx:id="untsOpsCode" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1" /> | |||
| <Label text="Durchführender Arzt" GridPane.rowIndex="1" /> | |||
| <Label text="Untersuchungszeitpunkt" GridPane.rowIndex="2" /> | |||
| <ComboBox fx:id="untsArzt" maxWidth="1.7976931348623157E308" promptText="aktueller Arzt is default" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |||
| <!--<HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="2"> | |||
| <children> | |||
| <DatePicker fx:id="untsDatum" prefWidth="150.0" /> | |||
| <TextField fx:id="untsZeit" prefColumnCount="5" promptText="HH:MM" /> | |||
| <Button fx:id="btnUntsNow" maxWidth="1.7976931348623157E308" mnemonicParsing="false" onAction="#clickedUntsNow" text="Jetzt" HBox.hgrow="ALWAYS" /> | |||
| </children> | |||
| </HBox>--> | |||
| <Label text="Durchführender Arzt:" GridPane.rowIndex="1" /> | |||
| <ComboBox fx:id="untsArzt" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |||
| <Label text="Untersuchungszeitpunkt:" GridPane.rowIndex="2" /> | |||
| <DateTimePicker fx:id="dtTmUntersuchungszeitpunkt" GridPane.columnIndex="1" GridPane.rowIndex="2" /> | |||
| </children> | |||
| </GridPane> | |||
| <HBox alignment="TOP_RIGHT" prefHeight="100.0" prefWidth="200.0" spacing="5.0" VBox.vgrow="ALWAYS"> | |||
| <children> | |||
| <Button fx:id="btnUntsCancel" mnemonicParsing="false" onAction="#clickedUntsAbort" text="Storno" /> | |||
| <Button fx:id="btnUntsCancel" mnemonicParsing="false" onAction="#clickedUntsCancel" text="Storno" /> | |||
| <Button fx:id="btnUntsAbort" mnemonicParsing="false" onAction="#clickedUntsAbort" text="Abbrechen" /> | |||
| <Button fx:id="btnUntsSave" mnemonicParsing="false" onAction="#clickedUntsSave" text="Speichern" /> | |||
| </children> | |||
| <padding> | |||
| @@ -71,10 +67,10 @@ | |||
| <Label styleClass="ersteller-label" text="Erstelldatum:" GridPane.columnIndex="0" GridPane.rowIndex="1" /> | |||
| <Label styleClass="ersteller-label" text="Letzter Bearbeiter:" GridPane.columnIndex="0" GridPane.rowIndex="2" /> | |||
| <Label styleClass="ersteller-label" text="Letzte Änderung:" GridPane.columnIndex="0" GridPane.rowIndex="3" /> | |||
| <Label styleClass="ersteller-value" fx:id="untsCreator" text="Dr. Haha" GridPane.columnIndex="1" GridPane.rowIndex="0" /> | |||
| <Label styleClass="ersteller-value" fx:id="untsCreateTime" text="10.10.2013 09:00" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |||
| <Label styleClass="ersteller-value" fx:id="untsChanger" text="Dr. Haha" GridPane.columnIndex="1" GridPane.rowIndex="2" /> | |||
| <Label styleClass="ersteller-value" fx:id="untsChangeTime" text="10.10.2013 09:00" GridPane.columnIndex="1" GridPane.rowIndex="3" /> | |||
| <Label styleClass="ersteller-value" fx:id="untsCreator" text="" GridPane.columnIndex="1" GridPane.rowIndex="0" /> | |||
| <Label styleClass="ersteller-value" fx:id="untsCreateTime" text="" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | |||
| <Label styleClass="ersteller-value" fx:id="untsChanger" text="" GridPane.columnIndex="1" GridPane.rowIndex="2" /> | |||
| <Label styleClass="ersteller-value" fx:id="untsChangeTime" text="" GridPane.columnIndex="1" GridPane.rowIndex="3" /> | |||
| </children> | |||
| </GridPane> | |||
| </children> | |||