| @@ -1,7 +1,6 @@ | |||||
| package de.uniluebeck.mi.projmi6.controller; | package de.uniluebeck.mi.projmi6.controller; | ||||
| import com.sun.prism.shader.Solid_Color_AlphaTest_Loader; | |||||
| import de.uniluebeck.mi.projmi6.db.DBHandler; | import de.uniluebeck.mi.projmi6.db.DBHandler; | ||||
| import de.uniluebeck.mi.projmi6.model.DiagArt; | import de.uniluebeck.mi.projmi6.model.DiagArt; | ||||
| import de.uniluebeck.mi.projmi6.model.Diagnose; | import de.uniluebeck.mi.projmi6.model.Diagnose; | ||||
| @@ -12,7 +11,6 @@ import javafx.beans.property.ReadOnlyObjectProperty; | |||||
| import javafx.beans.property.SimpleObjectProperty; | import javafx.beans.property.SimpleObjectProperty; | ||||
| import javafx.collections.FXCollections; | import javafx.collections.FXCollections; | ||||
| import javafx.collections.ObservableList; | import javafx.collections.ObservableList; | ||||
| import javafx.event.ActionEvent; | |||||
| import javafx.fxml.FXML; | import javafx.fxml.FXML; | ||||
| import javafx.scene.control.*; | import javafx.scene.control.*; | ||||
| import javafx.scene.layout.GridPane; | import javafx.scene.layout.GridPane; | ||||
| @@ -21,7 +19,7 @@ import javafx.scene.layout.GridPane; | |||||
| * Controller that mantains the diagnosis assigned to a case in the UI. | * Controller that mantains the diagnosis assigned to a case in the UI. | ||||
| * | * | ||||
| * @author Johannes | * @author Johannes | ||||
| * Created by 631806 on 12.11.15. | |||||
| * Created by 631806 on 12.11.15. | |||||
| */ | */ | ||||
| public class DiagnoseController { | public class DiagnoseController { | ||||
| @@ -40,7 +38,7 @@ public class DiagnoseController { | |||||
| private final SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW); | private final SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW); | ||||
| @FXML | @FXML | ||||
| private Button btnDiagAbort, btnDiagEdit, btnDiagSave,btnDiagCreate, btnDiagCancel; | |||||
| private Button btnDiagAbort, btnDiagEdit, btnDiagSave, btnDiagCreate, btnDiagCancel; | |||||
| @FXML | @FXML | ||||
| private final MainController mainController; | private final MainController mainController; | ||||
| @@ -62,6 +60,7 @@ public class DiagnoseController { | |||||
| /** | /** | ||||
| * Contructor. | * Contructor. | ||||
| * | |||||
| * @param mainController The main controller that creates this instance. | * @param mainController The main controller that creates this instance. | ||||
| */ | */ | ||||
| public DiagnoseController(MainController mainController) { | public DiagnoseController(MainController mainController) { | ||||
| @@ -70,6 +69,7 @@ public class DiagnoseController { | |||||
| /** | /** | ||||
| * Getter for the {@link #diagnosenProperty()}. | * Getter for the {@link #diagnosenProperty()}. | ||||
| * | |||||
| * @return The list of diagnosis shown in the GUI. Might be null. | * @return The list of diagnosis shown in the GUI. Might be null. | ||||
| */ | */ | ||||
| public ObservableList<Diagnose> getDiagnosen() { | public ObservableList<Diagnose> getDiagnosen() { | ||||
| @@ -79,6 +79,7 @@ public class DiagnoseController { | |||||
| /** | /** | ||||
| * Setter for the {@link #diagnosenProperty()}. | * Setter for the {@link #diagnosenProperty()}. | ||||
| * | |||||
| * @param diagnosen A observable list of diagnosis to be set. | * @param diagnosen A observable list of diagnosis to be set. | ||||
| */ | */ | ||||
| public void setDiagnosen(ObservableList<Diagnose> diagnosen) { | public void setDiagnosen(ObservableList<Diagnose> diagnosen) { | ||||
| @@ -87,6 +88,7 @@ public class DiagnoseController { | |||||
| /** | /** | ||||
| * The diagnosis in this controller. | * The diagnosis in this controller. | ||||
| * | |||||
| * @return A simple object property. | * @return A simple object property. | ||||
| */ | */ | ||||
| public SimpleObjectProperty<ObservableList<Diagnose>> diagnosenProperty() { | public SimpleObjectProperty<ObservableList<Diagnose>> diagnosenProperty() { | ||||
| @@ -95,6 +97,7 @@ public class DiagnoseController { | |||||
| /** | /** | ||||
| * Getter for the state of this controller | * Getter for the state of this controller | ||||
| * | |||||
| * @return State.VIEW, State.EDIT or State.CREATE | * @return State.VIEW, State.EDIT or State.CREATE | ||||
| */ | */ | ||||
| public State getState() { | public State getState() { | ||||
| @@ -103,7 +106,6 @@ public class DiagnoseController { | |||||
| /** | /** | ||||
| * A property for the controllers state. | * A property for the controllers state. | ||||
| * @return | |||||
| */ | */ | ||||
| public ReadOnlyObjectProperty<State> stateProperty() { | public ReadOnlyObjectProperty<State> stateProperty() { | ||||
| return state; | return state; | ||||
| @@ -140,7 +142,7 @@ public class DiagnoseController { | |||||
| //React on state changes. | //React on state changes. | ||||
| state.addListener((observable, oldValue, newValue) -> { | state.addListener((observable, oldValue, newValue) -> { | ||||
| if(newValue == State.VIEW){ | |||||
| if (newValue == State.VIEW) { | |||||
| mainController.unlockFromEdit(); | mainController.unlockFromEdit(); | ||||
| Diagnose diagnose = diagnoseList.getSelectionModel().getSelectedItem(); | Diagnose diagnose = diagnoseList.getSelectionModel().getSelectedItem(); | ||||
| if (diagnose == null) { | if (diagnose == null) { | ||||
| @@ -148,9 +150,9 @@ public class DiagnoseController { | |||||
| } else { | } else { | ||||
| copyDiagnoseDataIntoFields(diagnose); | copyDiagnoseDataIntoFields(diagnose); | ||||
| } | } | ||||
| }else{ | |||||
| } else { | |||||
| mainController.lockForEdit(MainController.TabName.DIAGNOSE); | mainController.lockForEdit(MainController.TabName.DIAGNOSE); | ||||
| if(newValue==State.CREATE){ | |||||
| if (newValue == State.CREATE) { | |||||
| clearFields(); | clearFields(); | ||||
| diagDiagnoseArzt.setValue(mainController.getCurrentMitarbeiter()); | diagDiagnoseArzt.setValue(mainController.getCurrentMitarbeiter()); | ||||
| } | } | ||||
| @@ -227,9 +229,6 @@ public class DiagnoseController { | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| } | } | ||||
| } else { | |||||
| //Update diagnosis in db | |||||
| } | } | ||||
| mainController.refreshCaseData(); | mainController.refreshCaseData(); | ||||
| state.set(State.VIEW); | state.set(State.VIEW); | ||||
| @@ -237,12 +236,13 @@ public class DiagnoseController { | |||||
| /** | /** | ||||
| * Copy the object data into the fields. | * Copy the object data into the fields. | ||||
| * | |||||
| * @param diagnose The object with the data. | * @param diagnose The object with the data. | ||||
| */ | */ | ||||
| private void copyDiagnoseDataIntoFields(Diagnose diagnose) { | private void copyDiagnoseDataIntoFields(Diagnose diagnose) { | ||||
| //Find the DiagnoseArzt by id. | //Find the DiagnoseArzt by id. | ||||
| for(Mitarbeiter current: diagDiagnoseArzt.getItems()){ | |||||
| if(current.getMitarbID() == diagnose.getMitarbid()){ | |||||
| for (Mitarbeiter current : diagDiagnoseArzt.getItems()) { | |||||
| if (current.getMitarbID() == diagnose.getMitarbid()) { | |||||
| diagDiagnoseArzt.setValue(current); | diagDiagnoseArzt.setValue(current); | ||||
| break; | break; | ||||
| } | } | ||||
| @@ -260,6 +260,7 @@ public class DiagnoseController { | |||||
| /** | /** | ||||
| * Copy the data from the ComboBoxes into data model object | * Copy the data from the ComboBoxes into data model object | ||||
| * | |||||
| * @param diagnose The object to copy the data into | * @param diagnose The object to copy the data into | ||||
| */ | */ | ||||
| private void copyFieldDataIntoDiagnose(Diagnose diagnose) { | private void copyFieldDataIntoDiagnose(Diagnose diagnose) { | ||||
| @@ -20,7 +20,8 @@ import java.sql.SQLException; | |||||
| /** | /** | ||||
| * The controller that controls the detailed case data view. | * The controller that controls the detailed case data view. | ||||
| * @author Johannes | |||||
| * | |||||
| * @author Johannes | |||||
| */ | */ | ||||
| public class FallController { | public class FallController { | ||||
| @@ -57,6 +58,7 @@ public class FallController { | |||||
| /** | /** | ||||
| * Contstructor. | * Contstructor. | ||||
| * | |||||
| * @param mainController The main controller that creats this instance | * @param mainController The main controller that creats this instance | ||||
| */ | */ | ||||
| public FallController(MainController mainController) { | public FallController(MainController mainController) { | ||||
| @@ -73,6 +75,7 @@ public class FallController { | |||||
| /** | /** | ||||
| * Setter for the {@link #fallProperty()} | * Setter for the {@link #fallProperty()} | ||||
| * | |||||
| * @param fall | * @param fall | ||||
| */ | */ | ||||
| public void setFall(Fall fall) { | public void setFall(Fall fall) { | ||||
| @@ -102,6 +105,7 @@ public class FallController { | |||||
| /** | /** | ||||
| * For showing the main diagnosis, the Controller also needs a pointer to the list of case diagnosis. | * For showing the main diagnosis, the Controller also needs a pointer to the list of case diagnosis. | ||||
| * | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| public ObjectProperty<ObservableList<Diagnose>> diagnosenProperty() { | public ObjectProperty<ObservableList<Diagnose>> diagnosenProperty() { | ||||
| @@ -117,6 +121,7 @@ public class FallController { | |||||
| /** | /** | ||||
| * Setter for the diagnosis in the main diagnosis combo box. | * Setter for the diagnosis in the main diagnosis combo box. | ||||
| * | |||||
| * @see #diagnosenProperty() | * @see #diagnosenProperty() | ||||
| */ | */ | ||||
| public void setDiagnosen(ObservableList<Diagnose> list) { | public void setDiagnosen(ObservableList<Diagnose> list) { | ||||
| @@ -221,18 +226,18 @@ public class FallController { | |||||
| /** | /** | ||||
| * Validate the data entered by the user. | * Validate the data entered by the user. | ||||
| */ | */ | ||||
| private boolean validateData(Fall fall){ | |||||
| if(fall.getAufnahmeDatum()!= null && fall.getEntlassungsDatum() != null | |||||
| && fall.getAufnahmeDatum().isAfter(fall.getEntlassungsDatum())){ | |||||
| private boolean validateData(Fall fall) { | |||||
| if (fall.getAufnahmeDatum() != null && fall.getEntlassungsDatum() != null | |||||
| && fall.getAufnahmeDatum().isAfter(fall.getEntlassungsDatum())) { | |||||
| showMessage("Aufnahmedatum lieght hinter Entlassungsdatum", "Der Patient muss aufgenommen worden sein, ehe " + | showMessage("Aufnahmedatum lieght hinter Entlassungsdatum", "Der Patient muss aufgenommen worden sein, ehe " + | ||||
| "er wieder entlassen worden sein kann."); | "er wieder entlassen worden sein kann."); | ||||
| return false; | return false; | ||||
| } | } | ||||
| if(fall.getKasse()==null || fall.getVersichertenNummer().isEmpty()){ | |||||
| if (fall.getKasse() == null || fall.getVersichertenNummer().isEmpty()) { | |||||
| showMessage("Fall hat keine Kasse/Versicherungsnummer", "An den Fall m\u00fcssen Abrechnungsinfos angeh\u00e4ngt werden!"); | showMessage("Fall hat keine Kasse/Versicherungsnummer", "An den Fall m\u00fcssen Abrechnungsinfos angeh\u00e4ngt werden!"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| if(fall.getFallArt()==null){ | |||||
| if (fall.getFallArt() == null) { | |||||
| showMessage("Es ist keine Fallart ausgew\u00e4hlt!", "Bitte eine Fallart ausw\u00e4hlen!"); | showMessage("Es ist keine Fallart ausgew\u00e4hlt!", "Bitte eine Fallart ausw\u00e4hlen!"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -288,7 +293,7 @@ public class FallController { | |||||
| if (this.state.get() == State.CREATE) { | if (this.state.get() == State.CREATE) { | ||||
| Fall fall = new Fall(); | Fall fall = new Fall(); | ||||
| copyFieldDataIntoFall(fall); | copyFieldDataIntoFall(fall); | ||||
| if(!validateData(fall)){ | |||||
| if (!validateData(fall)) { | |||||
| return; | return; | ||||
| } | } | ||||
| try { | try { | ||||
| @@ -306,7 +311,7 @@ public class FallController { | |||||
| mainController.refreshCasesFromDb(mainController.getPatientTablesController().getSelectedPatient()); | mainController.refreshCasesFromDb(mainController.getPatientTablesController().getSelectedPatient()); | ||||
| } else { //Update / edit | } else { //Update / edit | ||||
| copyFieldDataIntoFall(fallProperty.get()); | copyFieldDataIntoFall(fallProperty.get()); | ||||
| if(!validateData(fallProperty.get())){ | |||||
| if (!validateData(fallProperty.get())) { | |||||
| return; | return; | ||||
| } | } | ||||
| try { | try { | ||||
| @@ -372,6 +377,7 @@ public class FallController { | |||||
| /** | /** | ||||
| * Copy the text entered in the views into a Fall object. | * Copy the text entered in the views into a Fall object. | ||||
| * | |||||
| * @param fall The object for copying the data into. | * @param fall The object for copying the data into. | ||||
| */ | */ | ||||
| private void copyFieldDataIntoFall(Fall fall) { | private void copyFieldDataIntoFall(Fall fall) { | ||||
| @@ -399,6 +405,7 @@ public class FallController { | |||||
| /** | /** | ||||
| * Set the field values in the view to the value of the {@link Fall} object. | * Set the field values in the view to the value of the {@link Fall} object. | ||||
| * | |||||
| * @param fall The object whose data will be copied. | * @param fall The object whose data will be copied. | ||||
| */ | */ | ||||
| private void copyFallDataIntoField(Fall fall) { | private void copyFallDataIntoField(Fall fall) { | ||||
| @@ -431,6 +438,7 @@ public class FallController { | |||||
| /** | /** | ||||
| * This method sets the main diagnosis in the ComboBox | * This method sets the main diagnosis in the ComboBox | ||||
| * | |||||
| * @param fall The case whose main diagnosis will be picked | * @param fall The case whose main diagnosis will be picked | ||||
| */ | */ | ||||
| private void copyHauptdiagnoseToComboBox(Fall fall) { | private void copyHauptdiagnoseToComboBox(Fall fall) { | ||||
| @@ -458,5 +466,4 @@ public class FallController { | |||||
| } | } | ||||
| } | } | ||||
| @@ -15,10 +15,11 @@ import java.util.List; | |||||
| /** | /** | ||||
| * Controller for the HL7 Log Tab. | * Controller for the HL7 Log Tab. | ||||
| * | |||||
| * <p> | |||||
| * The log data is stored in the MySQL DB. The controller handles loading and showing of the data. | * The log data is stored in the MySQL DB. The controller handles loading and showing of the data. | ||||
| * | |||||
| * <p> | |||||
| * Created by Johannes on 19.11.15. | * Created by Johannes on 19.11.15. | ||||
| * | |||||
| * @author Johannes | * @author Johannes | ||||
| */ | */ | ||||
| public class LogController { | public class LogController { | ||||
| @@ -46,6 +47,7 @@ public class LogController { | |||||
| /** | /** | ||||
| * Constructor. Instance is created by the main controller. | * Constructor. Instance is created by the main controller. | ||||
| * | |||||
| * @param mainController The main controller instance that creates this controller instance | * @param mainController The main controller instance that creates this controller instance | ||||
| */ | */ | ||||
| public LogController(MainController mainController) { | public LogController(MainController mainController) { | ||||
| @@ -60,6 +62,7 @@ public class LogController { | |||||
| initColumns(); | initColumns(); | ||||
| refreshLogFromDb(); | refreshLogFromDb(); | ||||
| } | } | ||||
| /** | /** | ||||
| * Init cell value factories for the table columns | * Init cell value factories for the table columns | ||||
| */ | */ | ||||
| @@ -71,27 +74,27 @@ public class LogController { | |||||
| //Change cell factory cuz we need scrollable fields | //Change cell factory cuz we need scrollable fields | ||||
| colLogMessage.setCellFactory(column -> | colLogMessage.setCellFactory(column -> | ||||
| new TableCell<HL7LogEntry, String>() { | |||||
| private TextArea textArea = new TextArea(); | |||||
| { | |||||
| textArea.setEditable(false); | |||||
| textArea.setPrefRowCount(5); | |||||
| } | |||||
| @Override | |||||
| protected void updateItem(String item, boolean empty) { | |||||
| super.updateItem(item, empty); | |||||
| this.setText(null); | |||||
| if (item == null || empty) { | |||||
| this.setGraphic(null); | |||||
| return; | |||||
| new TableCell<HL7LogEntry, String>() { | |||||
| private TextArea textArea = new TextArea(); | |||||
| { | |||||
| textArea.setEditable(false); | |||||
| textArea.setPrefRowCount(5); | |||||
| } | |||||
| @Override | |||||
| protected void updateItem(String item, boolean empty) { | |||||
| super.updateItem(item, empty); | |||||
| this.setText(null); | |||||
| if (item == null || empty) { | |||||
| this.setGraphic(null); | |||||
| return; | |||||
| } | |||||
| textArea.setText(item); | |||||
| textArea.setWrapText(true); | |||||
| this.setGraphic(textArea); | |||||
| } | } | ||||
| textArea.setText(item); | |||||
| textArea.setWrapText(true); | |||||
| this.setGraphic(textArea); | |||||
| } | |||||
| }); | |||||
| }); | |||||
| } | } | ||||
| @@ -3,7 +3,6 @@ package de.uniluebeck.mi.projmi6.controller; | |||||
| import de.uniluebeck.mi.projmi6.db.DBHandler; | import de.uniluebeck.mi.projmi6.db.DBHandler; | ||||
| import de.uniluebeck.mi.projmi6.model.*; | import de.uniluebeck.mi.projmi6.model.*; | ||||
| import javafx.beans.property.ReadOnlyObjectProperty; | import javafx.beans.property.ReadOnlyObjectProperty; | ||||
| import javafx.beans.property.SimpleObjectProperty; | |||||
| import javafx.collections.FXCollections; | import javafx.collections.FXCollections; | ||||
| import javafx.collections.ObservableList; | import javafx.collections.ObservableList; | ||||
| import javafx.collections.transformation.FilteredList; | import javafx.collections.transformation.FilteredList; | ||||
| @@ -213,8 +212,9 @@ public class MainController { | |||||
| /** | /** | ||||
| * Opens a patient and specific case in the window. | * Opens a patient and specific case in the window. | ||||
| * | |||||
| * @param patient The patient to be shown. | * @param patient The patient to be shown. | ||||
| * @param fallId The case number of the patient. | |||||
| * @param fallId The case number of the patient. | |||||
| */ | */ | ||||
| public void selectPatientAndFallId(Patient patient, int fallId) { | public void selectPatientAndFallId(Patient patient, int fallId) { | ||||
| if (patientTablesController.getSelectedPatient() == patient | if (patientTablesController.getSelectedPatient() == patient | ||||
| @@ -228,7 +228,8 @@ public class MainController { | |||||
| } | } | ||||
| /** | /** | ||||
| * Opens a specific case by id. | |||||
| * Opens a specific case by id. | |||||
| * | |||||
| * @param id The case id | * @param id The case id | ||||
| */ | */ | ||||
| private void selectFallById(int id) { | private void selectFallById(int id) { | ||||
| @@ -247,6 +248,7 @@ public class MainController { | |||||
| /** | /** | ||||
| * Starts a task that loads all cases for the given patient and displays them | * Starts a task that loads all cases for the given patient and displays them | ||||
| * Stops other running tasks if necessary. | * Stops other running tasks if necessary. | ||||
| * | |||||
| * @param patient The patient whose cases will be loaded. | * @param patient The patient whose cases will be loaded. | ||||
| */ | */ | ||||
| public void refreshCasesFromDb(Patient patient) { | public void refreshCasesFromDb(Patient patient) { | ||||
| @@ -332,7 +334,6 @@ public class MainController { | |||||
| }); | }); | ||||
| tabPaneFall.setDisable(false); | tabPaneFall.setDisable(false); | ||||
| tabFallDiagnose.setDisable(true); | tabFallDiagnose.setDisable(true); | ||||
| tabFallStationsHistorie.setDisable(true); | tabFallStationsHistorie.setDisable(true); | ||||
| @@ -344,7 +345,7 @@ public class MainController { | |||||
| /** | /** | ||||
| * Setup the list view of the patient's cases. | * Setup the list view of the patient's cases. | ||||
| */ | */ | ||||
| private void initCaseListView(){ | |||||
| private void initCaseListView() { | |||||
| lvFall.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); | lvFall.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); | ||||
| fallController.fallProperty().bind(lvFall.getSelectionModel().selectedItemProperty()); | fallController.fallProperty().bind(lvFall.getSelectionModel().selectedItemProperty()); | ||||
| @@ -384,6 +385,7 @@ public class MainController { | |||||
| /** | /** | ||||
| * Loads all the data that belongs to a specific case (diagnosis, ward history, examinations) | * Loads all the data that belongs to a specific case (diagnosis, ward history, examinations) | ||||
| * and sets the data in the correlating controllers. | * and sets the data in the correlating controllers. | ||||
| * | |||||
| * @param fall The case whose correlationg data will be loaded | * @param fall The case whose correlationg data will be loaded | ||||
| */ | */ | ||||
| private void refreshCaseData(Fall fall) { | private void refreshCaseData(Fall fall) { | ||||
| @@ -410,7 +412,6 @@ public class MainController { | |||||
| } | } | ||||
| loadCaseData = new Task<Void>() { | loadCaseData = new Task<Void>() { | ||||
| List<Untersuchung> untersuchungList; | List<Untersuchung> untersuchungList; | ||||
| List<Diagnose> diagnoseList; | List<Diagnose> diagnoseList; | ||||
| @@ -499,6 +500,7 @@ public class MainController { | |||||
| /** | /** | ||||
| * Prevents the user from changing the patient/case and tab while editing case data. | * Prevents the user from changing the patient/case and tab while editing case data. | ||||
| * | |||||
| * @param exclude The case data tab that should be excluded from disabling. | * @param exclude The case data tab that should be excluded from disabling. | ||||
| */ | */ | ||||
| public void lockForEdit(TabName exclude) { | public void lockForEdit(TabName exclude) { | ||||
| @@ -16,6 +16,7 @@ import java.io.IOException; | |||||
| /** | /** | ||||
| * This controller controlls the small message icon at the bottom of the application's main window. | * This controller controlls the small message icon at the bottom of the application's main window. | ||||
| * | |||||
| * @author Johannes | * @author Johannes | ||||
| */ | */ | ||||
| public class MessageController { | public class MessageController { | ||||
| @@ -37,6 +38,7 @@ public class MessageController { | |||||
| /** | /** | ||||
| * Constructor | * Constructor | ||||
| * | |||||
| * @param mainController The controller that creates this instance | * @param mainController The controller that creates this instance | ||||
| */ | */ | ||||
| public MessageController(MainController mainController) { | public MessageController(MainController mainController) { | ||||
| @@ -61,6 +63,7 @@ public class MessageController { | |||||
| /** | /** | ||||
| * Opens a window that shows all the unread messages. | * Opens a window that shows all the unread messages. | ||||
| * | |||||
| * @see de.uniluebeck.mi.projmi6.controller.MessageListController | * @see de.uniluebeck.mi.projmi6.controller.MessageListController | ||||
| */ | */ | ||||
| private void showMessageList() { | private void showMessageList() { | ||||
| @@ -94,6 +97,7 @@ public class MessageController { | |||||
| /** | /** | ||||
| * Adds a message to the list of unread messages that is controlled by this controller | * Adds a message to the list of unread messages that is controlled by this controller | ||||
| * | |||||
| * @param message The message that will be added. | * @param message The message that will be added. | ||||
| */ | */ | ||||
| public void addMessage(HL7Message message) { | public void addMessage(HL7Message message) { | ||||
| @@ -9,12 +9,14 @@ import javafx.scene.control.Button; | |||||
| import javafx.scene.control.ListView; | import javafx.scene.control.ListView; | ||||
| import javafx.stage.Modality; | import javafx.stage.Modality; | ||||
| import javafx.stage.Stage; | import javafx.stage.Stage; | ||||
| /** | /** | ||||
| * The Controller that manages the list of unseen HL7 messages. | * The Controller that manages the list of unseen HL7 messages. | ||||
| * At the moment, the list is opened in its own window. | * At the moment, the list is opened in its own window. | ||||
| * | |||||
| * <p> | |||||
| * Created by Johannes on 21/11/2015. | * Created by Johannes on 21/11/2015. | ||||
| * @author Johannes | |||||
| * | |||||
| * @author Johannes | |||||
| */ | */ | ||||
| public class MessageListController { | public class MessageListController { | ||||
| private final SimpleListProperty<HL7Message> messages; | private final SimpleListProperty<HL7Message> messages; | ||||
| @@ -28,7 +30,8 @@ public class MessageListController { | |||||
| /** | /** | ||||
| * Contstructor. | * Contstructor. | ||||
| * @param messages The list of messages that will be shown in this window. Elements might become deleted. | |||||
| * | |||||
| * @param messages The list of messages that will be shown in this window. Elements might become deleted. | |||||
| * @param mainController The main controller. Necessary to switch the patient and case. | * @param mainController The main controller. Necessary to switch the patient and case. | ||||
| */ | */ | ||||
| public MessageListController(SimpleListProperty<HL7Message> messages, MainController mainController) { | public MessageListController(SimpleListProperty<HL7Message> messages, MainController mainController) { | ||||
| @@ -70,7 +73,6 @@ public class MessageListController { | |||||
| /** | /** | ||||
| * EventHandler for {@link #btnShow}. | * EventHandler for {@link #btnShow}. | ||||
| * Opens patient and case regarding the HL7 message, or shows a error text for the message. | * Opens patient and case regarding the HL7 message, or shows a error text for the message. | ||||
| * | |||||
| */ | */ | ||||
| @FXML | @FXML | ||||
| private void clickedShow() { | private void clickedShow() { | ||||
| @@ -8,7 +8,6 @@ import de.uniluebeck.mi.projmi6.db.DBHandler; | |||||
| import de.uniluebeck.mi.projmi6.model.Kasse; | import de.uniluebeck.mi.projmi6.model.Kasse; | ||||
| import de.uniluebeck.mi.projmi6.model.Patient; | import de.uniluebeck.mi.projmi6.model.Patient; | ||||
| import javafx.collections.FXCollections; | import javafx.collections.FXCollections; | ||||
| import javafx.event.ActionEvent; | |||||
| import javafx.fxml.FXML; | import javafx.fxml.FXML; | ||||
| import javafx.scene.control.*; | import javafx.scene.control.*; | ||||
| import javafx.stage.Stage; | import javafx.stage.Stage; | ||||
| @@ -55,6 +54,7 @@ public class PatientEditorController { | |||||
| /** | /** | ||||
| * The constructor. | * The constructor. | ||||
| * | |||||
| * @param mainController | * @param mainController | ||||
| */ | */ | ||||
| public PatientEditorController(MainController mainController) { | public PatientEditorController(MainController mainController) { | ||||
| @@ -74,6 +74,7 @@ public class PatientEditorController { | |||||
| /** | /** | ||||
| * Sets the patient that is shown in this view. | * Sets the patient that is shown in this view. | ||||
| * | |||||
| * @param patient The patient to be edited, or null if a new patient shall be created. | * @param patient The patient to be edited, or null if a new patient shall be created. | ||||
| */ | */ | ||||
| public void setPatient(Patient patient) { | public void setPatient(Patient patient) { | ||||
| @@ -117,7 +118,8 @@ public class PatientEditorController { | |||||
| /** | /** | ||||
| * Shows alert dialog if data is invalid | * Shows alert dialog if data is invalid | ||||
| * @param title the alert's header text. | |||||
| * | |||||
| * @param title the alert's header text. | |||||
| * @param message the alert's content text. | * @param message the alert's content text. | ||||
| */ | */ | ||||
| private void showMessage(String title, String message) { | private void showMessage(String title, String message) { | ||||
| @@ -153,6 +155,7 @@ public class PatientEditorController { | |||||
| /** | /** | ||||
| * Validates the data in the fields. Makes alerts if data not valid. | * Validates the data in the fields. Makes alerts if data not valid. | ||||
| * | |||||
| * @return true if data is valid, false otherwise. | * @return true if data is valid, false otherwise. | ||||
| */ | */ | ||||
| private boolean validateData() { | private boolean validateData() { | ||||
| @@ -161,19 +164,19 @@ public class PatientEditorController { | |||||
| "Postleitzahlen m\u00fcssen aus exakt 5 Ziffern bestehen!"); | "Postleitzahlen m\u00fcssen aus exakt 5 Ziffern bestehen!"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| if(patNachname.getText()==null || patNachname.getText().isEmpty()){ | |||||
| if (patNachname.getText() == null || patNachname.getText().isEmpty()) { | |||||
| showMessage("Nachname ist leer", "Es muss ein Nachname eingegeben werden!"); | showMessage("Nachname ist leer", "Es muss ein Nachname eingegeben werden!"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| if(patVorname.getText()==null || patVorname.getText().isEmpty()){ | |||||
| if (patVorname.getText() == null || patVorname.getText().isEmpty()) { | |||||
| showMessage("Vorname ist leer", "Es muss ein Vorname eingegeben werden!"); | showMessage("Vorname ist leer", "Es muss ein Vorname eingegeben werden!"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| if(patGeburtsdatum.getValue()==null || patGeburtsdatum.getValue().isAfter(LocalDate.now().plusMonths(1))){ | |||||
| if (patGeburtsdatum.getValue() == null || patGeburtsdatum.getValue().isAfter(LocalDate.now().plusMonths(1))) { | |||||
| showMessage("Geburtsdatum ist ung\u00fcltig", "Das Geburtsdatum ist nicht gesetzt oder liegt zuweit in der Zukunft!"); | showMessage("Geburtsdatum ist ung\u00fcltig", "Das Geburtsdatum ist nicht gesetzt oder liegt zuweit in der Zukunft!"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| if(patVersicherung.getValue()==null){ | |||||
| if (patVersicherung.getValue() == null) { | |||||
| showMessage("Es ist keine Kasse ausgew\u00e4hlt!", "Bitte eine Kassse aus der List w\u00e4hle"); | showMessage("Es ist keine Kasse ausgew\u00e4hlt!", "Bitte eine Kassse aus der List w\u00e4hle"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -46,7 +46,7 @@ public class PatientTablesController { | |||||
| @FXML | @FXML | ||||
| private TableView<Patient> tblPatientOverview; | private TableView<Patient> tblPatientOverview; | ||||
| @FXML | @FXML | ||||
| private TableColumn<Patient, String> colPatPatId, colPatGeburtsname, colPatNachname, colPatVorname, colPatStrasse, | |||||
| private TableColumn<Patient, String> colPatPatId, colPatGeburtsname, colPatNachname, colPatVorname, colPatStrasse, | |||||
| colPatPlz, colPatOrt, colPatCave; | colPatPlz, colPatOrt, colPatCave; | ||||
| @FXML | @FXML | ||||
| private TableColumn<Patient, LocalDate> colPatGebDatum; | private TableColumn<Patient, LocalDate> colPatGebDatum; | ||||
| @@ -83,6 +83,7 @@ public class PatientTablesController { | |||||
| /** | /** | ||||
| * Constructor. | * Constructor. | ||||
| * | |||||
| * @param mainController The controller that creates this instance | * @param mainController The controller that creates this instance | ||||
| */ | */ | ||||
| public PatientTablesController(MainController mainController) { | public PatientTablesController(MainController mainController) { | ||||
| @@ -204,6 +205,7 @@ public class PatientTablesController { | |||||
| /** | /** | ||||
| * Opens a window for editing the given patient. | * Opens a window for editing the given patient. | ||||
| * | |||||
| * @param patient The patient that should be opened for editing. | * @param patient The patient that should be opened for editing. | ||||
| */ | */ | ||||
| private void showEditWindow(Patient patient) { | private void showEditWindow(Patient patient) { | ||||
| @@ -20,14 +20,14 @@ import javafx.stage.Modality; | |||||
| import java.sql.SQLException; | import java.sql.SQLException; | ||||
| import java.time.LocalDate; | import java.time.LocalDate; | ||||
| import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
| import java.util.Collections; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
| /** | /** | ||||
| * The controller class for the hospital ward history. | * The controller class for the hospital ward history. | ||||
| * | |||||
| * @author Johannes | * @author Johannes | ||||
| * Created by Johannes on 12.11.15. | |||||
| * Created by Johannes on 12.11.15. | |||||
| */ | */ | ||||
| public class StationsHistorieController { | public class StationsHistorieController { | ||||
| @@ -38,7 +38,7 @@ public class StationsHistorieController { | |||||
| @FXML | @FXML | ||||
| private TableView<StationsHistorie> tblStationsHistorie; | private TableView<StationsHistorie> tblStationsHistorie; | ||||
| @FXML | @FXML | ||||
| private Button btnStatHistSave, btnStatHistCreate, btnStatHistEdit, btnStatHistDelete, btnStatHistAbort; | |||||
| private Button btnStatHistSave, btnStatHistCreate, btnStatHistEdit, btnStatHistDelete, btnStatHistAbort; | |||||
| @FXML | @FXML | ||||
| private Label statHistCreator, statHistCreateTime, statHistEditor, statHistEditTime; | private Label statHistCreator, statHistCreateTime, statHistEditor, statHistEditTime; | ||||
| @FXML | @FXML | ||||
| @@ -69,6 +69,7 @@ public class StationsHistorieController { | |||||
| /** | /** | ||||
| * Constructor | * Constructor | ||||
| * | |||||
| * @param mainController | * @param mainController | ||||
| */ | */ | ||||
| public StationsHistorieController(MainController mainController) { | public StationsHistorieController(MainController mainController) { | ||||
| @@ -86,6 +87,7 @@ public class StationsHistorieController { | |||||
| /** | /** | ||||
| * Getter for the {@link #stateProperty()} | * Getter for the {@link #stateProperty()} | ||||
| * | |||||
| * @return The stateProperty's value. | * @return The stateProperty's value. | ||||
| */ | */ | ||||
| public State getState() { | public State getState() { | ||||
| @@ -271,6 +273,7 @@ public class StationsHistorieController { | |||||
| /** | /** | ||||
| * A getter for {@link #stationsHistorieProperty()} | * A getter for {@link #stationsHistorieProperty()} | ||||
| * | |||||
| * @return The value of that property. | * @return The value of that property. | ||||
| */ | */ | ||||
| public ObservableList<StationsHistorie> getStationsHistorie() { | public ObservableList<StationsHistorie> getStationsHistorie() { | ||||
| @@ -279,6 +282,7 @@ public class StationsHistorieController { | |||||
| /** | /** | ||||
| * Setter for the {@link #stationsHistorieProperty()} | * Setter for the {@link #stationsHistorieProperty()} | ||||
| * | |||||
| * @param stationsHistorie The value to be set. | * @param stationsHistorie The value to be set. | ||||
| */ | */ | ||||
| public void setStationsHistorie(ObservableList<StationsHistorie> stationsHistorie) { | public void setStationsHistorie(ObservableList<StationsHistorie> stationsHistorie) { | ||||
| @@ -287,6 +291,7 @@ public class StationsHistorieController { | |||||
| /** | /** | ||||
| * The list that will be shown in the TableView. | * The list that will be shown in the TableView. | ||||
| * | |||||
| * @return A property to that list. | * @return A property to that list. | ||||
| */ | */ | ||||
| public SimpleObjectProperty<ObservableList<StationsHistorie>> stationsHistorieProperty() { | public SimpleObjectProperty<ObservableList<StationsHistorie>> stationsHistorieProperty() { | ||||
| @@ -334,19 +339,20 @@ public class StationsHistorieController { | |||||
| statHistCreator.setText(Integer.toString(stationsHistorie.getErsteller())); | statHistCreator.setText(Integer.toString(stationsHistorie.getErsteller())); | ||||
| if (stationsHistorie.getErstellDatumZeit() != null) { | if (stationsHistorie.getErstellDatumZeit() != null) { | ||||
| statHistCreateTime.setText(stationsHistorie.getErstellDatumZeit().toString()); | statHistCreateTime.setText(stationsHistorie.getErstellDatumZeit().toString()); | ||||
| }else{ | |||||
| } else { | |||||
| statHistCreateTime.setText(""); | statHistCreateTime.setText(""); | ||||
| } | } | ||||
| statHistEditor.setText(Integer.toString(stationsHistorie.getBearbeiter())); | statHistEditor.setText(Integer.toString(stationsHistorie.getBearbeiter())); | ||||
| if (stationsHistorie.getBearbeitetDatumZeit() != null) { | if (stationsHistorie.getBearbeitetDatumZeit() != null) { | ||||
| statHistEditTime.setText(stationsHistorie.getBearbeitetDatumZeit().toString()); | statHistEditTime.setText(stationsHistorie.getBearbeitetDatumZeit().toString()); | ||||
| }else{ | |||||
| } else { | |||||
| statHistEditTime.setText(""); | statHistEditTime.setText(""); | ||||
| } | } | ||||
| } | } | ||||
| /** | /** | ||||
| * Copies the data entered in the fields into {@link de.uniluebeck.mi.projmi6.model.StationsHistorie} objects. | * Copies the data entered in the fields into {@link de.uniluebeck.mi.projmi6.model.StationsHistorie} objects. | ||||
| * | |||||
| * @param stationsHistorie The object in which the data will be copied | * @param stationsHistorie The object in which the data will be copied | ||||
| */ | */ | ||||
| private void copyFieldDataIntoStationsHistorie(StationsHistorie stationsHistorie) { | private void copyFieldDataIntoStationsHistorie(StationsHistorie stationsHistorie) { | ||||
| @@ -365,7 +371,8 @@ public class StationsHistorieController { | |||||
| /** | /** | ||||
| * Helper method for {@link #validateData(StationsHistorie)}. Opens a error window. | * Helper method for {@link #validateData(StationsHistorie)}. Opens a error window. | ||||
| * @param title The Alerts header text | |||||
| * | |||||
| * @param title The Alerts header text | |||||
| * @param message The Alerts contents text | * @param message The Alerts contents text | ||||
| */ | */ | ||||
| private void showMessage(String title, String message) { | private void showMessage(String title, String message) { | ||||
| @@ -380,6 +387,7 @@ public class StationsHistorieController { | |||||
| /** | /** | ||||
| * Checks the StationsHistorie and makes error alerts if necessary. | * Checks the StationsHistorie and makes error alerts if necessary. | ||||
| * | |||||
| * @param stationsHistorie The StationsHistorie that should be validated, | * @param stationsHistorie The StationsHistorie that should be validated, | ||||
| * @return true if data is valid, false otherwise. | * @return true if data is valid, false otherwise. | ||||
| */ | */ | ||||
| @@ -1,24 +1,24 @@ | |||||
| /** | /** | ||||
| * This package contains the FXML Controller classes. | * This package contains the FXML Controller classes. | ||||
| * | |||||
| * <p> | |||||
| * There is the {@link de.uniluebeck.mi.projmi6.controller.MainController}, that creates instances of these nested controller classes: | * There is the {@link de.uniluebeck.mi.projmi6.controller.MainController}, that creates instances of these nested controller classes: | ||||
| * <ul> | * <ul> | ||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.DiagnoseController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.FallController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.LogController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.PatientTablesController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.MessageController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.SettingsController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.StationsHistorieController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.UntersuchungenController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.DiagnoseController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.FallController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.LogController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.PatientTablesController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.MessageController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.SettingsController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.StationsHistorieController}</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.UntersuchungenController}</li> | |||||
| * </ul> | * </ul> | ||||
| * The main controller has an {@link de.uniluebeck.mi.projmi6.controller.MainController#getControllerFactory()} for | * The main controller has an {@link de.uniluebeck.mi.projmi6.controller.MainController#getControllerFactory()} for | ||||
| * the FXMLLoader. | * the FXMLLoader. | ||||
| * | |||||
| * <p> | |||||
| * There are also two other controller classes, that aren't directly maintained by the FXMLLoader | * There are also two other controller classes, that aren't directly maintained by the FXMLLoader | ||||
| * <ul> | * <ul> | ||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.PatientEditorController} for the edit/create patient window</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.MessageListController} for the window of unseen HL7 messages</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.PatientEditorController} for the edit/create patient window</li> | |||||
| * <li>{@link de.uniluebeck.mi.projmi6.controller.MessageListController} for the window of unseen HL7 messages</li> | |||||
| * </ul> | * </ul> | ||||
| */ | */ | ||||
| package de.uniluebeck.mi.projmi6.controller; | package de.uniluebeck.mi.projmi6.controller; | ||||
| @@ -8,7 +8,7 @@ import java.sql.SQLException; | |||||
| * MySQL Connection Factory. | * MySQL Connection Factory. | ||||
| */ | */ | ||||
| public class MySqlConnectionFactory { | public class MySqlConnectionFactory { | ||||
| public static final String URL = "jdbc:mysql://141.83.20.84:3306/pmiw15g06_v01"; | |||||
| public static final String URL = "jdbc:mysql://localhost:3306/pmiw15g06_v01"; | |||||
| public static final String USER = "pmiw15g06"; | public static final String USER = "pmiw15g06"; | ||||
| public static final String PASS = "AX3yQSYJSH43PrSz"; | public static final String PASS = "AX3yQSYJSH43PrSz"; | ||||
| public static final String DRIVER = "com.mysql.jdbc.Driver"; | public static final String DRIVER = "com.mysql.jdbc.Driver"; | ||||