| @@ -1,6 +1,7 @@ | |||
| package de.uniluebeck.mi.projmi6; | |||
| 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.OpsCode; | |||
| import javafx.application.Application; | |||
| @@ -47,6 +48,10 @@ public class Main extends Application { | |||
| new OpsCode("876-3", "Darmspiegelung", 20) | |||
| )); | |||
| mainController.setKassen(FXCollections.observableArrayList( | |||
| new Kasse(2, "TK", "Strasse 2", false) | |||
| )); | |||
| Mitarbeiter mitarbeiter = new Mitarbeiter(); | |||
| mainController.setMitarbeiter(FXCollections.observableArrayList( | |||
| mitarbeiter | |||
| @@ -23,6 +23,9 @@ public class MainController { | |||
| 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<>(); | |||
| public ObservableList<Mitarbeiter> getMitarbeiter() { | |||
| return mitarbeiter.get(); | |||
| @@ -36,8 +39,6 @@ public class MainController { | |||
| this.mitarbeiter.set(mitarbeiter); | |||
| } | |||
| private SimpleObjectProperty<ObservableList<Mitarbeiter>> mitarbeiter = new SimpleObjectProperty<>(); | |||
| public ObservableList<Kasse> getKassen() { | |||
| return kassen.get(); | |||
| } | |||
| @@ -50,7 +51,6 @@ public class MainController { | |||
| this.kassen.set(kassen); | |||
| } | |||
| private SimpleObjectProperty<ObservableList<Kasse>> kassen = new SimpleObjectProperty<>(); | |||
| private int parallelTaskCount = 0; | |||
| @@ -62,8 +62,11 @@ public class MainController { | |||
| private ProgressIndicator progressIndicator; | |||
| @FXML | |||
| private Button btnFallCreate; | |||
| @FXML | |||
| private SplitPane fallOverview; | |||
| private Callback<Class<?>, Object> controllerFactory = clazz -> { | |||
| if(clazz.equals(MainController.class)) { | |||
| return this; | |||
| @@ -170,6 +173,8 @@ public class MainController { | |||
| private void initialize(){ | |||
| fallOverview.disableProperty().bind(patientTablesController.selectedPatientProperty().isNull()); | |||
| cmbUserChoose.itemsProperty().bind(this.mitarbeiterProperty()); | |||
| } | |||
| } | |||
| @@ -3,6 +3,7 @@ package de.uniluebeck.mi.projmi6.controller; | |||
| /** | |||
| * Created by 631806 on 12.11.15. | |||
| */ | |||
| import de.uniluebeck.mi.projmi6.model.Kasse; | |||
| import de.uniluebeck.mi.projmi6.model.Patient; | |||
| import javafx.collections.FXCollections; | |||
| import javafx.fxml.FXML; | |||
| @@ -17,6 +18,7 @@ public class PatientEditorController { | |||
| */ | |||
| private Patient patient = null; | |||
| private MainController mainController; | |||
| @FXML | |||
| private Label patChangeTime; | |||
| @@ -57,7 +59,7 @@ public class PatientEditorController { | |||
| @FXML | |||
| private TextField patVersicherungsnummer; | |||
| @FXML | |||
| private ComboBox<?> patVersicherung; | |||
| private ComboBox<Kasse> patVersicherung; | |||
| @FXML | |||
| private TextArea patCave; | |||
| @@ -72,10 +74,17 @@ public class PatientEditorController { | |||
| 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; | |||
| } | |||
| public void setPatient(Patient patient){ | |||
| this.patient = patient; | |||
| if(patient==null){ | |||
| @@ -3,6 +3,7 @@ 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 javafx.beans.binding.Bindings; | |||
| import javafx.beans.binding.ObjectBinding; | |||
| @@ -23,6 +24,7 @@ import javafx.stage.Stage; | |||
| import java.io.IOException; | |||
| import java.rmi.server.ExportException; | |||
| import java.sql.SQLException; | |||
| import java.time.LocalDate; | |||
| /** | |||
| @@ -133,20 +135,13 @@ public class PatientTablesController{ | |||
| 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); | |||
| @@ -183,12 +178,15 @@ public class PatientTablesController{ | |||
| 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{ | |||
| root = fxmlLoader.load(); | |||
| }catch (IOException e){ | |||
| e.printStackTrace(); | |||
| return; | |||
| } | |||
| Stage stage = new Stage(); | |||
| @@ -200,7 +198,6 @@ public class PatientTablesController{ | |||
| stage.initModality(Modality.WINDOW_MODAL); | |||
| stage.initOwner(btnPatEdit.getScene().getWindow()); | |||
| PatientEditorController patientEditorController = (PatientEditorController)fxmlLoader.getController(); | |||
| patientEditorController.setPatient(patient); | |||
| stage.show(); | |||
| } | |||
| @@ -15,7 +15,7 @@ public class DBHandler { | |||
| 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; | |||
| ResultSet rs = null; | |||
| statement = MySqlConnFactory.getConnection().createStatement(); | |||
| @@ -12,6 +12,18 @@ public class Kasse { | |||
| private SimpleStringProperty name = new SimpleStringProperty(this, "name"); | |||
| 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() { | |||
| return adresse.get(); | |||
| } | |||
| @@ -59,4 +71,9 @@ public class Kasse { | |||
| public void setPrivat(boolean 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" /> | |||
| </items> | |||
| </ToolBar> | |||
| <ListView VBox.vgrow="ALWAYS" fx:id="lvFall" /> | |||
| </children> | |||
| </VBox> | |||
| <TabPane prefHeight="200.0" prefWidth="200.0" tabClosingPolicy="UNAVAILABLE"> | |||