| @@ -1,6 +1,7 @@ | |||||
| package de.uniluebeck.mi.projmi6; | package de.uniluebeck.mi.projmi6; | ||||
| import de.uniluebeck.mi.projmi6.controller.MainController; | import de.uniluebeck.mi.projmi6.controller.MainController; | ||||
| import de.uniluebeck.mi.projmi6.model.Kasse; | |||||
| import de.uniluebeck.mi.projmi6.model.Mitarbeiter; | import de.uniluebeck.mi.projmi6.model.Mitarbeiter; | ||||
| import de.uniluebeck.mi.projmi6.model.OpsCode; | import de.uniluebeck.mi.projmi6.model.OpsCode; | ||||
| import javafx.application.Application; | import javafx.application.Application; | ||||
| @@ -47,6 +48,10 @@ public class Main extends Application { | |||||
| new OpsCode("876-3", "Darmspiegelung", 20) | new OpsCode("876-3", "Darmspiegelung", 20) | ||||
| )); | )); | ||||
| mainController.setKassen(FXCollections.observableArrayList( | |||||
| new Kasse(2, "TK", "Strasse 2", false) | |||||
| )); | |||||
| Mitarbeiter mitarbeiter = new Mitarbeiter(); | Mitarbeiter mitarbeiter = new Mitarbeiter(); | ||||
| mainController.setMitarbeiter(FXCollections.observableArrayList( | mainController.setMitarbeiter(FXCollections.observableArrayList( | ||||
| mitarbeiter | mitarbeiter | ||||
| @@ -23,6 +23,9 @@ public class MainController { | |||||
| private SimpleObjectProperty<ObservableList<OpsCode>> opsCodes = new SimpleObjectProperty<>(); | private SimpleObjectProperty<ObservableList<OpsCode>> opsCodes = new SimpleObjectProperty<>(); | ||||
| private SimpleObjectProperty<ObservableList<Icd10Code>> icd10Codes = new SimpleObjectProperty<>(); | private SimpleObjectProperty<ObservableList<Icd10Code>> icd10Codes = new SimpleObjectProperty<>(); | ||||
| private SimpleObjectProperty<ObservableList<Mitarbeiter>> mitarbeiter = new SimpleObjectProperty<>(); | |||||
| private SimpleObjectProperty<ObservableList<Kasse>> kassen = new SimpleObjectProperty<>(); | |||||
| public ObservableList<Mitarbeiter> getMitarbeiter() { | public ObservableList<Mitarbeiter> getMitarbeiter() { | ||||
| return mitarbeiter.get(); | return mitarbeiter.get(); | ||||
| @@ -36,8 +39,6 @@ public class MainController { | |||||
| this.mitarbeiter.set(mitarbeiter); | this.mitarbeiter.set(mitarbeiter); | ||||
| } | } | ||||
| private SimpleObjectProperty<ObservableList<Mitarbeiter>> mitarbeiter = new SimpleObjectProperty<>(); | |||||
| public ObservableList<Kasse> getKassen() { | public ObservableList<Kasse> getKassen() { | ||||
| return kassen.get(); | return kassen.get(); | ||||
| } | } | ||||
| @@ -50,7 +51,6 @@ public class MainController { | |||||
| this.kassen.set(kassen); | this.kassen.set(kassen); | ||||
| } | } | ||||
| private SimpleObjectProperty<ObservableList<Kasse>> kassen = new SimpleObjectProperty<>(); | |||||
| private int parallelTaskCount = 0; | private int parallelTaskCount = 0; | ||||
| @@ -62,8 +62,11 @@ public class MainController { | |||||
| private ProgressIndicator progressIndicator; | private ProgressIndicator progressIndicator; | ||||
| @FXML | @FXML | ||||
| private Button btnFallCreate; | private Button btnFallCreate; | ||||
| @FXML | @FXML | ||||
| private SplitPane fallOverview; | private SplitPane fallOverview; | ||||
| private Callback<Class<?>, Object> controllerFactory = clazz -> { | private Callback<Class<?>, Object> controllerFactory = clazz -> { | ||||
| if(clazz.equals(MainController.class)) { | if(clazz.equals(MainController.class)) { | ||||
| return this; | return this; | ||||
| @@ -170,6 +173,8 @@ public class MainController { | |||||
| private void initialize(){ | private void initialize(){ | ||||
| fallOverview.disableProperty().bind(patientTablesController.selectedPatientProperty().isNull()); | fallOverview.disableProperty().bind(patientTablesController.selectedPatientProperty().isNull()); | ||||
| cmbUserChoose.itemsProperty().bind(this.mitarbeiterProperty()); | cmbUserChoose.itemsProperty().bind(this.mitarbeiterProperty()); | ||||
| } | } | ||||
| } | } | ||||
| @@ -3,6 +3,7 @@ package de.uniluebeck.mi.projmi6.controller; | |||||
| /** | /** | ||||
| * Created by 631806 on 12.11.15. | * Created by 631806 on 12.11.15. | ||||
| */ | */ | ||||
| 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.fxml.FXML; | import javafx.fxml.FXML; | ||||
| @@ -17,6 +18,7 @@ public class PatientEditorController { | |||||
| */ | */ | ||||
| private Patient patient = null; | private Patient patient = null; | ||||
| private MainController mainController; | |||||
| @FXML | @FXML | ||||
| private Label patChangeTime; | private Label patChangeTime; | ||||
| @@ -57,7 +59,7 @@ public class PatientEditorController { | |||||
| @FXML | @FXML | ||||
| private TextField patVersicherungsnummer; | private TextField patVersicherungsnummer; | ||||
| @FXML | @FXML | ||||
| private ComboBox<?> patVersicherung; | |||||
| private ComboBox<Kasse> patVersicherung; | |||||
| @FXML | @FXML | ||||
| private TextArea patCave; | private TextArea patCave; | ||||
| @@ -72,10 +74,17 @@ public class PatientEditorController { | |||||
| public void initialize(){ | public void initialize(){ | ||||
| patGeschlecht.setItems(FXCollections.observableArrayList(Patient.Geschlecht.values())); | patGeschlecht.setItems(FXCollections.observableArrayList(Patient.Geschlecht.values())); | ||||
| patFamilienstand.setItems(FXCollections.observableArrayList(Patient.Familienstand.values())); | patFamilienstand.setItems(FXCollections.observableArrayList(Patient.Familienstand.values())); | ||||
| patVersicherung.setItems(mainController.getKassen()); | |||||
| } | |||||
| public PatientEditorController(MainController mainController){ | |||||
| this.mainController = mainController; | |||||
| } | } | ||||
| public void setPatient(Patient patient){ | public void setPatient(Patient patient){ | ||||
| this.patient = patient; | this.patient = patient; | ||||
| if(patient==null){ | if(patient==null){ | ||||
| @@ -3,6 +3,7 @@ package de.uniluebeck.mi.projmi6.controller; | |||||
| /** | /** | ||||
| * Created by Johannes on 12.11.15. | * 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.Patient; | ||||
| import javafx.beans.binding.Bindings; | import javafx.beans.binding.Bindings; | ||||
| import javafx.beans.binding.ObjectBinding; | import javafx.beans.binding.ObjectBinding; | ||||
| @@ -23,6 +24,7 @@ import javafx.stage.Stage; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.rmi.server.ExportException; | import java.rmi.server.ExportException; | ||||
| import java.sql.SQLException; | |||||
| import java.time.LocalDate; | import java.time.LocalDate; | ||||
| /** | /** | ||||
| @@ -133,20 +135,13 @@ public class PatientTablesController{ | |||||
| lblTableStationEmpty.setText("Daten werden geladen..."); | lblTableStationEmpty.setText("Daten werden geladen..."); | ||||
| ObservableList<Patient> patientList = FXCollections.<Patient>observableArrayList(); | |||||
| Patient patient = new Patient(); | |||||
| patient.setPatID(1337); | |||||
| patient.setNachname("Mustermann"); | |||||
| patient.setVorname("Max"); | |||||
| patient.setGeburtsdatum(LocalDate.of(1990, 12, 12)); | |||||
| patient.setStrasse("Beckergrube"); | |||||
| patient.setHausnummer("20"); | |||||
| patient.setPlz("23552"); | |||||
| patient.setOrt("Luebeck"); | |||||
| patient.setCave("voellig langweilig"); | |||||
| ObservableList<Patient> patientList = null; | |||||
| try { | |||||
| patientList = FXCollections.<Patient>observableArrayList(DBHandler.getAllPatients()); | |||||
| } catch (SQLException e) { | |||||
| e.printStackTrace(); | |||||
| } | |||||
| patientList.add(patient); | |||||
| tblPatientOverview.setItems(patientList); | tblPatientOverview.setItems(patientList); | ||||
| @@ -183,12 +178,15 @@ public class PatientTablesController{ | |||||
| private void showEditWindow(Patient patient){ | private void showEditWindow(Patient patient){ | ||||
| FXMLLoader fxmlLoader = new FXMLLoader(); | FXMLLoader fxmlLoader = new FXMLLoader(); | ||||
| fxmlLoader.setLocation(getClass().getClassLoader().getResource("patient_edit.fxml")); | fxmlLoader.setLocation(getClass().getClassLoader().getResource("patient_edit.fxml")); | ||||
| PatientEditorController patientEditorController = new PatientEditorController(mainController); | |||||
| fxmlLoader.setControllerFactory(clazz -> patientEditorController); | |||||
| Parent root = null; | Parent root = null; | ||||
| try{ | try{ | ||||
| root = fxmlLoader.load(); | root = fxmlLoader.load(); | ||||
| }catch (IOException e){ | }catch (IOException e){ | ||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| return; | |||||
| } | } | ||||
| Stage stage = new Stage(); | Stage stage = new Stage(); | ||||
| @@ -200,7 +198,6 @@ public class PatientTablesController{ | |||||
| stage.initModality(Modality.WINDOW_MODAL); | stage.initModality(Modality.WINDOW_MODAL); | ||||
| stage.initOwner(btnPatEdit.getScene().getWindow()); | stage.initOwner(btnPatEdit.getScene().getWindow()); | ||||
| PatientEditorController patientEditorController = (PatientEditorController)fxmlLoader.getController(); | |||||
| patientEditorController.setPatient(patient); | patientEditorController.setPatient(patient); | ||||
| stage.show(); | stage.show(); | ||||
| } | } | ||||
| @@ -15,7 +15,7 @@ public class DBHandler { | |||||
| public static final String SELECT_ALL_PATIENTS = "SELECT * FROM `patient`"; | public static final String SELECT_ALL_PATIENTS = "SELECT * FROM `patient`"; | ||||
| public List<Patient> getAllPatients() throws SQLException { | |||||
| public static List<Patient> getAllPatients() throws SQLException { | |||||
| Statement statement = null; | Statement statement = null; | ||||
| ResultSet rs = null; | ResultSet rs = null; | ||||
| statement = MySqlConnFactory.getConnection().createStatement(); | statement = MySqlConnFactory.getConnection().createStatement(); | ||||
| @@ -12,6 +12,18 @@ public class Kasse { | |||||
| private SimpleStringProperty name = new SimpleStringProperty(this, "name"); | private SimpleStringProperty name = new SimpleStringProperty(this, "name"); | ||||
| private SimpleBooleanProperty privat = new SimpleBooleanProperty(this, "privat"); | private SimpleBooleanProperty privat = new SimpleBooleanProperty(this, "privat"); | ||||
| public Kasse(){ | |||||
| } | |||||
| public Kasse(int id, String name, String adresse, boolean privat){ | |||||
| kassenID.set(id); | |||||
| this.name.set(name); | |||||
| this.adresse.set(adresse); | |||||
| this.privat.set(privat); | |||||
| } | |||||
| public String getAdresse() { | public String getAdresse() { | ||||
| return adresse.get(); | return adresse.get(); | ||||
| } | } | ||||
| @@ -59,4 +71,9 @@ public class Kasse { | |||||
| public void setPrivat(boolean privat) { | public void setPrivat(boolean privat) { | ||||
| this.privat.set(privat); | this.privat.set(privat); | ||||
| } | } | ||||
| @Override | |||||
| public String toString() { | |||||
| return getName() + " (" +(getPrivat()?"privat":"gesetzlich")+")" ; | |||||
| } | |||||
| } | } | ||||
| @@ -27,6 +27,7 @@ | |||||
| <Button fx:id="btnFallCreate" text="Neuen _Fall erstellen" /> | <Button fx:id="btnFallCreate" text="Neuen _Fall erstellen" /> | ||||
| </items> | </items> | ||||
| </ToolBar> | </ToolBar> | ||||
| <ListView VBox.vgrow="ALWAYS" fx:id="lvFall" /> | |||||
| </children> | </children> | ||||
| </VBox> | </VBox> | ||||
| <TabPane prefHeight="200.0" prefWidth="200.0" tabClosingPolicy="UNAVAILABLE"> | <TabPane prefHeight="200.0" prefWidth="200.0" tabClosingPolicy="UNAVAILABLE"> | ||||