| @@ -26,25 +26,14 @@ import javafx.scene.layout.GridPane; | |||
| public class DiagnoseController { | |||
| private final SimpleObjectProperty<ObservableList<Diagnose>> diagnosen = new SimpleObjectProperty<>(); | |||
| /** | |||
| * Controller state definitions | |||
| */ | |||
| public enum State { | |||
| CREATE, EDIT, VIEW | |||
| } | |||
| /** | |||
| * Current controllers state | |||
| */ | |||
| private final SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW); | |||
| @FXML | |||
| private Button btnDiagAbort, btnDiagEdit, btnDiagSave, btnDiagCreate, btnDiagCancel; | |||
| @FXML | |||
| private final MainController mainController; | |||
| @FXML | |||
| private Button btnDiagAbort, btnDiagEdit, btnDiagSave, btnDiagCreate, btnDiagCancel; | |||
| @FXML | |||
| private ListView<Diagnose> diagnoseList; | |||
| @FXML | |||
| @@ -78,7 +67,6 @@ public class DiagnoseController { | |||
| return diagnosen.get(); | |||
| } | |||
| /** | |||
| * Setter for the {@link #diagnosenProperty()}. | |||
| * | |||
| @@ -129,7 +117,7 @@ public class DiagnoseController { | |||
| diagDiagnoseArt.setItems(FXCollections.observableArrayList(DiagArt.values())); | |||
| FilteredList<Mitarbeiter> mitarbeiterFilteredList = new FilteredList<Mitarbeiter>(mainController.getStammdaten().getMitarbeiter()); | |||
| mitarbeiterFilteredList.setPredicate(m -> !m.getNachname().equalsIgnoreCase("SYSTEM")); | |||
| mitarbeiterFilteredList.setPredicate(m -> (!m.getNachname().equalsIgnoreCase("SYSTEM") && !m.getNachname().equalsIgnoreCase("EXTERN"))); | |||
| diagDiagnoseArzt.setItems(mitarbeiterFilteredList); | |||
| diagnoseList.itemsProperty().bind(diagnosen); | |||
| @@ -168,7 +156,6 @@ public class DiagnoseController { | |||
| } | |||
| /** | |||
| * Alert dialog when the data entered is invalid. | |||
| */ | |||
| @@ -181,20 +168,19 @@ public class DiagnoseController { | |||
| alert.showAndWait(); | |||
| } | |||
| /** | |||
| * Checks if doctor, icd10-code and Diagnoseart are set. | |||
| */ | |||
| private boolean validateData(Diagnose diagnose){ | |||
| if(diagnose.getArzt()==null){ | |||
| showMessage("Arzt nicht angegeben!","Bitte den Arzt, der die Diagnose erstellt hat, aus der List ausw\u00e4hlen!"); | |||
| private boolean validateData(Diagnose diagnose) { | |||
| if (diagnose.getArzt() == null) { | |||
| showMessage("Arzt nicht angegeben!", "Bitte den Arzt, der die Diagnose erstellt hat, aus der List ausw\u00e4hlen!"); | |||
| return false; | |||
| } | |||
| if(diagnose.getDiagArt()==null){ | |||
| if (diagnose.getDiagArt() == null) { | |||
| showMessage("Diagnoseart nicht angegeben!", "Bitte die Art der Diagnose angeben!"); | |||
| return false; | |||
| } | |||
| if(diagnose.getIcd10code()==null){ | |||
| if (diagnose.getIcd10code() == null) { | |||
| showMessage("Die Diagnose hat keinen ICD-10-Code!", "Bitte einen ICD-10-Code angeben!"); | |||
| return false; | |||
| } | |||
| @@ -202,13 +188,12 @@ public class DiagnoseController { | |||
| return true; | |||
| } | |||
| /** | |||
| * Bind button visibility to application state. | |||
| */ | |||
| private void initButtons() { | |||
| btnDiagCreate.disableProperty().bind(mainController.fallProperty().isNull().or(Bindings.createBooleanBinding( | |||
| ()->mainController.getFall()!= null && mainController.getFall().getStorniert(), mainController.fallProperty()))); | |||
| () -> mainController.getFall() != null && mainController.getFall().getStorniert(), mainController.fallProperty()))); | |||
| btnDiagEdit.disableProperty().bind(diagnoseList.getSelectionModel().selectedItemProperty().isNull()); | |||
| @@ -266,7 +251,7 @@ public class DiagnoseController { | |||
| //Create new diagnosis | |||
| Diagnose diagnose = new Diagnose(); | |||
| copyFieldDataIntoDiagnose(diagnose); | |||
| if(!validateData(diagnose)){ | |||
| if (!validateData(diagnose)) { | |||
| return; | |||
| } | |||
| try { | |||
| @@ -336,4 +321,11 @@ public class DiagnoseController { | |||
| diagChangeTime.setText(""); | |||
| } | |||
| /** | |||
| * Controller state definitions | |||
| */ | |||
| public enum State { | |||
| CREATE, EDIT, VIEW | |||
| } | |||
| } | |||
| @@ -6,7 +6,6 @@ import de.uniluebeck.mi.projmi6.db.DBHandler; | |||
| import de.uniluebeck.mi.projmi6.hapi.HL7Sender; | |||
| import de.uniluebeck.mi.projmi6.model.*; | |||
| import de.uniluebeck.mi.projmi6.view.DateTimePicker; | |||
| import javafx.beans.binding.Bindings; | |||
| import javafx.beans.property.ObjectProperty; | |||
| import javafx.beans.property.ReadOnlyObjectProperty; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| @@ -458,7 +457,6 @@ public class FallController { | |||
| } | |||
| for (Diagnose diagnose : fallHauptdiagnose.getItems()) { | |||
| System.out.println(diagnose.getDiagID() + "=" + fall.getHauptdiagnoseId()); | |||
| if (diagnose.getDiagID().equalsIgnoreCase(fall.getHauptdiagnoseId())) { | |||
| fallHauptdiagnose.getSelectionModel().select(diagnose); | |||
| return; | |||
| @@ -318,7 +318,7 @@ public class MainController { | |||
| //Init user data. | |||
| FilteredList<Mitarbeiter> mitarbeiterFilteredList = new FilteredList<Mitarbeiter>(this.getStammdaten().getMitarbeiter()); | |||
| mitarbeiterFilteredList.setPredicate(m -> !m.getNachname().equalsIgnoreCase("SYSTEM")); | |||
| mitarbeiterFilteredList.setPredicate(m -> (!m.getNachname().equalsIgnoreCase("SYSTEM") && !m.getNachname().equalsIgnoreCase("EXTERN"))); | |||
| cmbUserChoose.setItems(mitarbeiterFilteredList); | |||
| cmbUserChoose.getSelectionModel().select(0); | |||
| @@ -36,6 +36,9 @@ public class PatientTablesController { | |||
| private final MainController mainController; | |||
| private final ObservableList<StationsUebersichtsItem> stationsUebersicht = FXCollections.observableArrayList(); | |||
| private final FilteredList<StationsUebersichtsItem> stationsUebersichtsItemFilteredList = new FilteredList<StationsUebersichtsItem>(stationsUebersicht, | |||
| item -> item.getStationEntlassung() == null || item.getStationEntlassung().isAfter(LocalDate.now())); | |||
| /** | |||
| * The placeholder labels in case the TableViews are empty | |||
| */ | |||
| @@ -50,10 +53,8 @@ public class PatientTablesController { | |||
| colPatPlz, colPatOrt, colPatCave; | |||
| @FXML | |||
| private TableColumn<Patient, LocalDate> colPatGebDatum; | |||
| @FXML | |||
| private ToggleButton btnEntlassenePatientenZeigen; | |||
| @FXML | |||
| private Button btnStatRefresh; | |||
| @FXML | |||
| @@ -66,17 +67,10 @@ public class PatientTablesController { | |||
| private TableColumn<StationsUebersichtsItem, String> colStatFullName; | |||
| @FXML | |||
| private TableColumn<StationsUebersichtsItem, LocalDate> colStatGebDatum, colStatAufnahmedatum, colStatEntlassungsdatum; | |||
| @FXML | |||
| private TabPane patientOverviewTabPane; | |||
| @FXML | |||
| private Tab stationOverviewTab, patientOverviewTab; | |||
| private final ObservableList<StationsUebersichtsItem> stationsUebersicht = FXCollections.observableArrayList(); | |||
| private final FilteredList<StationsUebersichtsItem> stationsUebersichtsItemFilteredList = new FilteredList<StationsUebersichtsItem>(stationsUebersicht, | |||
| item -> item.getStationEntlassung() == null || item.getStationEntlassung().isAfter(LocalDate.now())); | |||
| private Task loadStationsHistorieTask = null; | |||
| private Task loadPatientTask = null; | |||
| private ObjectBinding<Patient> patientObjectBinding = null; | |||
| @@ -247,8 +241,7 @@ public class PatientTablesController { | |||
| * Start the db request for loading every patient in the MySQL database. | |||
| */ | |||
| public void updatePatientsFromDb() { | |||
| if (this.loadPatientTask != null && this.loadPatientTask.isRunning()) { | |||
| System.out.println("Patienten werden bereits geladen."); | |||
| if (loadPatientTask != null && loadPatientTask.isRunning()) { | |||
| return; | |||
| } | |||
| @@ -5,7 +5,6 @@ package de.uniluebeck.mi.projmi6.controller; | |||
| */ | |||
| import de.uniluebeck.mi.projmi6.db.DBHandler; | |||
| import de.uniluebeck.mi.projmi6.model.Diagnose; | |||
| import de.uniluebeck.mi.projmi6.model.Mitarbeiter; | |||
| import de.uniluebeck.mi.projmi6.model.OpsCode; | |||
| import de.uniluebeck.mi.projmi6.model.Untersuchung; | |||
| @@ -114,7 +113,7 @@ public class UntersuchungenController { | |||
| new SelectKeyComboBoxListener(untsOpsCode); | |||
| FilteredList<Mitarbeiter> mitarbeiterFilteredList = new FilteredList<Mitarbeiter>(mainController.getStammdaten().getMitarbeiter()); | |||
| mitarbeiterFilteredList.setPredicate(m -> !m.getNachname().equalsIgnoreCase("SYSTEM")); | |||
| mitarbeiterFilteredList.setPredicate(m -> (!m.getNachname().equalsIgnoreCase("SYSTEM") && !m.getNachname().equalsIgnoreCase("EXTERN"))); | |||
| untsArzt.setItems(mitarbeiterFilteredList); | |||
| } | |||
| @@ -26,18 +26,6 @@ public class HL7Utils { | |||
| return null; | |||
| } | |||
| public static String parseIcd10Code(String icd10code) { | |||
| return removeWhitespaces(icd10code).substring(0, 5); | |||
| } | |||
| public static String parseOpsCode(String opscode) { | |||
| return removeWhitespaces(opscode).substring(0, 7); | |||
| } | |||
| private static String removeWhitespaces(String s) { | |||
| return s.replaceAll("\\s", ""); | |||
| } | |||
| public static void logHL7MessageToDatabase(HL7LogEntry entry) { | |||
| try { | |||
| DBHandler.setHL7LogEntry(entry); | |||