| @@ -14,7 +14,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; | ||||
| @@ -24,6 +23,14 @@ import java.sql.SQLException; | |||||
| public class FallController { | public class FallController { | ||||
| /** | |||||
| * A property to the case which data this controller manages. | |||||
| */ | |||||
| private final SimpleObjectProperty<Fall> fallProperty = new SimpleObjectProperty<>(); | |||||
| /** | |||||
| * Controllers current state. | |||||
| */ | |||||
| private final SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW); | |||||
| private MainController mainController; | private MainController mainController; | ||||
| @FXML | @FXML | ||||
| private DateTimePicker dtTmAufnahme, dtTmEntlassung; | private DateTimePicker dtTmAufnahme, dtTmEntlassung; | ||||
| @@ -46,16 +53,6 @@ public class FallController { | |||||
| @FXML | @FXML | ||||
| private GridPane fallFields; | private GridPane fallFields; | ||||
| /** | |||||
| * A property to the case which data this controller manages. | |||||
| */ | |||||
| private final SimpleObjectProperty<Fall> fallProperty = new SimpleObjectProperty<>(); | |||||
| /** | |||||
| * Controllers current state. | |||||
| */ | |||||
| private final SimpleObjectProperty<State> state = new SimpleObjectProperty<>(State.VIEW); | |||||
| /** | /** | ||||
| * Contstructor. | * Contstructor. | ||||
| @@ -89,13 +86,6 @@ public class FallController { | |||||
| } | } | ||||
| /** | /** | ||||
| * State definitions. | |||||
| */ | |||||
| public enum State { | |||||
| CREATE, EDIT, VIEW | |||||
| } | |||||
| /** | |||||
| * Getter for the {@link #stateProperty()}. | * Getter for the {@link #stateProperty()}. | ||||
| */ | */ | ||||
| public State getState() { | public State getState() { | ||||
| @@ -195,7 +185,6 @@ public class FallController { | |||||
| btnFallSendHl7.visibleProperty().bind(btnFallSendHl7.managedProperty()); | btnFallSendHl7.visibleProperty().bind(btnFallSendHl7.managedProperty()); | ||||
| } | } | ||||
| /** | /** | ||||
| * EventHandler for the {@link #btnFallSendHl7} button. | * EventHandler for the {@link #btnFallSendHl7} button. | ||||
| */ | */ | ||||
| @@ -229,7 +218,6 @@ public class FallController { | |||||
| editFall(); | editFall(); | ||||
| } | } | ||||
| /** | /** | ||||
| * EventHandler for the {@link #btnFallCancel}. | * EventHandler for the {@link #btnFallCancel}. | ||||
| */ | */ | ||||
| @@ -255,7 +243,6 @@ public class FallController { | |||||
| copyFallDataIntoField(fallProperty.get()); | copyFallDataIntoField(fallProperty.get()); | ||||
| } | } | ||||
| /** | /** | ||||
| * EventHandler for the {@link #btnFallSave} button. | * EventHandler for the {@link #btnFallSave} button. | ||||
| */ | */ | ||||
| @@ -273,7 +260,7 @@ public class FallController { | |||||
| } | } | ||||
| try { | try { | ||||
| HL7Sender.createMessageADT_A01(fall); | HL7Sender.createMessageADT_A01(fall); | ||||
| }catch(IOException | HL7Exception | SQLException e){ | |||||
| } catch (IOException | HL7Exception | SQLException e) { | |||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| } | } | ||||
| } else { | } else { | ||||
| @@ -309,7 +296,6 @@ public class FallController { | |||||
| fallVersichertennummer.setText(patient.getVersichertennummer()); | fallVersichertennummer.setText(patient.getVersichertennummer()); | ||||
| } | } | ||||
| /** | /** | ||||
| * Clears the TextFields. | * Clears the TextFields. | ||||
| */ | */ | ||||
| @@ -389,7 +375,6 @@ public class FallController { | |||||
| fallEditor.setText(Integer.toString(fall.getBearbeiter())); | fallEditor.setText(Integer.toString(fall.getBearbeiter())); | ||||
| fallEinweisenderArzt.setText(fall.getEinweisenderArzt()); | fallEinweisenderArzt.setText(fall.getEinweisenderArzt()); | ||||
| fallSelbsteinweisung.setSelected(fall.getSelbsteinweisung()); | fallSelbsteinweisung.setSelected(fall.getSelbsteinweisung()); | ||||
| @@ -401,7 +386,6 @@ public class FallController { | |||||
| fallFallart.setValue(fall.getFallArt()); | fallFallart.setValue(fall.getFallArt()); | ||||
| } | } | ||||
| /** | /** | ||||
| * 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 | ||||
| @@ -415,7 +399,7 @@ public class FallController { | |||||
| for (Diagnose diagnose : fallHauptdiagnose.getItems()) { | for (Diagnose diagnose : fallHauptdiagnose.getItems()) { | ||||
| System.out.println(diagnose.getDiagID() + "=" + fall.getHauptdiagnoseId()); | System.out.println(diagnose.getDiagID() + "=" + fall.getHauptdiagnoseId()); | ||||
| if (diagnose.getDiagID() == fall.getHauptdiagnoseId()) { | |||||
| if (diagnose.getDiagID().equalsIgnoreCase(fall.getHauptdiagnoseId())) { | |||||
| fallHauptdiagnose.getSelectionModel().select(diagnose); | fallHauptdiagnose.getSelectionModel().select(diagnose); | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -423,5 +407,13 @@ public class FallController { | |||||
| } | } | ||||
| /** | |||||
| * State definitions. | |||||
| */ | |||||
| public enum State { | |||||
| CREATE, EDIT, VIEW | |||||
| } | |||||
| } | } | ||||
| @@ -483,7 +483,7 @@ public class DBHandler { | |||||
| } | } | ||||
| if (rs.getInt("hauptdiagnose") != 0) { | if (rs.getInt("hauptdiagnose") != 0) { | ||||
| fall.setHauptDiagnose(getDiagnose(rs.getInt("hauptdiagnose"), fall)); | fall.setHauptDiagnose(getDiagnose(rs.getInt("hauptdiagnose"), fall)); | ||||
| fall.setHauptdiagnoseId(rs.getInt("hauptdiagnose")); | |||||
| fall.setHauptdiagnoseId(rs.getString("hauptdiagnose")); | |||||
| } | } | ||||
| if (rs.getString("versichertennummer") != null) { | if (rs.getString("versichertennummer") != null) { | ||||
| fall.setVersichertenNummer(rs.getString("versichertennummer")); | fall.setVersichertenNummer(rs.getString("versichertennummer")); | ||||
| @@ -540,8 +540,8 @@ public class DBHandler { | |||||
| statement.setString(5, null); | statement.setString(5, null); | ||||
| } | } | ||||
| statement.setBoolean(6, fall.getSelbsteinweisung()); // Selbsteinweisung | statement.setBoolean(6, fall.getSelbsteinweisung()); // Selbsteinweisung | ||||
| if (fall.getHauptdiagnoseId() != 0) { | |||||
| statement.setInt(7, fall.getHauptdiagnoseId()); // Hauptdiagnose | |||||
| if (fall.getHauptdiagnoseId() != null) { | |||||
| statement.setString(7, fall.getHauptdiagnoseId()); // Hauptdiagnose | |||||
| } else { | } else { | ||||
| statement.setTimestamp(7, null); | statement.setTimestamp(7, null); | ||||
| } | } | ||||
| @@ -611,10 +611,10 @@ public class DBHandler { | |||||
| private static Diagnose getDiagnose(ResultSet rs) throws SQLException { | private static Diagnose getDiagnose(ResultSet rs) throws SQLException { | ||||
| Diagnose diagnose = new Diagnose(); | Diagnose diagnose = new Diagnose(); | ||||
| diagnose.setDiagID(rs.getInt("diagid")); | |||||
| diagnose.setDiagID(rs.getString("diagid")); | |||||
| diagnose.setFreiText(rs.getString("freitext")); | diagnose.setFreiText(rs.getString("freitext")); | ||||
| diagnose.setArzt(new Mitarbeiter(rs.getInt("arzt"))); | diagnose.setArzt(new Mitarbeiter(rs.getInt("arzt"))); | ||||
| diagnose.setDiagArt(DiagArt.parseInt(rs.getInt("diagart"))); | |||||
| diagnose.setDiagArt(DiagArt.parseString(rs.getString("diagart"))); | |||||
| setVersionInformation(diagnose, rs); | setVersionInformation(diagnose, rs); | ||||
| diagnose.setIcd10code(getIcd10Code(rs.getString("icd10code"), rs.getInt("icd10version"))); | diagnose.setIcd10code(getIcd10Code(rs.getString("icd10code"), rs.getInt("icd10version"))); | ||||
| return diagnose; | return diagnose; | ||||
| @@ -905,7 +905,7 @@ public class DBHandler { | |||||
| public static void setDiagnose(Diagnose diagnose) throws SQLException { | public static void setDiagnose(Diagnose diagnose) throws SQLException { | ||||
| PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_DIAGNOSE); | PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_DIAGNOSE); | ||||
| statement.setInt(1, diagnose.getArzt().getMitarbID()); // `Arzt` | statement.setInt(1, diagnose.getArzt().getMitarbID()); // `Arzt` | ||||
| statement.setInt(2, diagnose.getDiagArt().id()); // `DiagArt` | |||||
| statement.setString(2, diagnose.getDiagArt().id()); // `DiagArt` | |||||
| statement.setInt(3, diagnose.getErsteller()); // `Ersteller` | statement.setInt(3, diagnose.getErsteller()); // `Ersteller` | ||||
| statement.setString(4, diagnose.getFreiText()); // `Freitext` | statement.setString(4, diagnose.getFreiText()); // `Freitext` | ||||
| statement.setString(5, diagnose.getIcd10code().getCode()); // `ICD10Code` | statement.setString(5, diagnose.getIcd10code().getCode()); // `ICD10Code` | ||||
| @@ -177,17 +177,7 @@ public class HL7Receiver<T extends AbstractMessage> implements ReceivingApplicat | |||||
| diagnose.setArzt(mitarbeiter); | diagnose.setArzt(mitarbeiter); | ||||
| // (DG1-6) // TODO: Enum umstellen? Neeee... | // (DG1-6) // TODO: Enum umstellen? Neeee... | ||||
| String diagart = dg1.getDiagnosisType().encode(); | String diagart = dg1.getDiagnosisType().encode(); | ||||
| switch (diagart) { | |||||
| case "A": | |||||
| diagnose.setDiagArt(DiagArt.EINWEISUNG); | |||||
| break; | |||||
| case "F": | |||||
| diagnose.setDiagArt(DiagArt.ENTLASSUNG); | |||||
| break; | |||||
| case "W": | |||||
| default: | |||||
| diagnose.setDiagArt(DiagArt.VERDACHT); | |||||
| } | |||||
| diagnose.setDiagID(DiagArt.parseString(diagart).id()); | |||||
| diagnose.setFreiText(dg1.getDiagnosisDescription().encode()); | diagnose.setFreiText(dg1.getDiagnosisDescription().encode()); | ||||
| diagnosen.add(diagnose); | diagnosen.add(diagnose); | ||||
| @@ -86,7 +86,7 @@ public class HL7Sender { | |||||
| xcn.getFamilyName().getSurname().setValue(arzt.getNachname()); | xcn.getFamilyName().getSurname().setValue(arzt.getNachname()); | ||||
| xcn.getPrefixEgDR().setValue(arzt.getTitel()); | xcn.getPrefixEgDR().setValue(arzt.getTitel()); | ||||
| dg1.getDg14_DiagnosisDescription().parse(diagnose.getFreiText()); | dg1.getDg14_DiagnosisDescription().parse(diagnose.getFreiText()); | ||||
| dg1.getDg16_DiagnosisType().parse(diagnose.getDiagArt().toString()); | |||||
| dg1.getDg16_DiagnosisType().parse(diagnose.getDiagArt().id()); | |||||
| i++; | i++; | ||||
| } | } | ||||
| sendMessage(adt); | sendMessage(adt); | ||||
| @@ -5,41 +5,44 @@ package de.uniluebeck.mi.projmi6.model; | |||||
| */ | */ | ||||
| public enum DiagArt { | public enum DiagArt { | ||||
| VERDACHT(1, "Verdacht"), | |||||
| EINWEISUNG(2, "Einweisung"), | |||||
| OPDIAG(3, "OP-Diag"), | |||||
| ENTLASSUNG(4, "Entlassung"); | |||||
| private final int id; | |||||
| A("A", "Aufnahmediagnose / Admitting"), | |||||
| AD("AD", "Aufnahmediagnose"), | |||||
| BD("BD", "Behandlungsdiagnose"), | |||||
| ED("ED", "Einweisungsdiagnose"), | |||||
| EL("EL", "Entlassungsdiagnose"), | |||||
| F("F", "Final"), | |||||
| ND("ND", "Nachfolgediagnose"), | |||||
| NO("NO", "Nachfolgediagnose Operation"), | |||||
| NU("NU", "Nachfolgediagnose, Arbeitsunfähigkeit"), | |||||
| UD("UD", "Überweisungsdiagnose"), | |||||
| VO("VO", "Präoperative Diagnose"), | |||||
| W("W", "Working"), | |||||
| ZD("ZD", "Neben- / Zusatzdiagnose"), | |||||
| U("U", "Unknown"); | |||||
| private final String id; | |||||
| private final String diagArt; | private final String diagArt; | ||||
| DiagArt(int id, String diagArt) { | |||||
| DiagArt(String id, String diagArt) { | |||||
| this.id = id; | this.id = id; | ||||
| this.diagArt = diagArt; | this.diagArt = diagArt; | ||||
| } | } | ||||
| public static DiagArt parseInt(final int id) { | |||||
| switch (id) { | |||||
| case 1: | |||||
| return VERDACHT; | |||||
| case 2: | |||||
| return EINWEISUNG; | |||||
| case 3: | |||||
| return OPDIAG; | |||||
| case 4: | |||||
| return ENTLASSUNG; | |||||
| default: | |||||
| return VERDACHT; | |||||
| public static DiagArt parseString(String s) { | |||||
| for (DiagArt diagart : DiagArt.values()) { | |||||
| if (diagart.id.equalsIgnoreCase(s)) { | |||||
| return diagart; | |||||
| } | |||||
| } | } | ||||
| } | |||||
| public int id() { | |||||
| return id; | |||||
| return U; | |||||
| } | } | ||||
| @Override | @Override | ||||
| public String toString() { | public String toString() { | ||||
| return diagArt; | return diagArt; | ||||
| } | } | ||||
| public String id() { | |||||
| return id; | |||||
| } | |||||
| } | } | ||||
| @@ -1,48 +0,0 @@ | |||||
| package de.uniluebeck.mi.projmi6.model; | |||||
| /** | |||||
| * Created by nils on 24.11.2015. | |||||
| */ | |||||
| public enum DiagArt2 { | |||||
| A("A", "Aufnahmediagnose / Admitting"), | |||||
| AD("AD", "Aufnahmediagnose"), | |||||
| BD("BD", "Behandlungsdiagnose"), | |||||
| ED("ED", "Einweisungsdiagnose"), | |||||
| EL("EL", "Entlassungsdiagnose"), | |||||
| F("F", "Final"), | |||||
| ND("ND", "Nachfolgediagnose"), | |||||
| NO("NO", "Nachfolgediagnose Operation"), | |||||
| NU("NU", "Nachfolgediagnose, Arbeitsunfähigkeit"), | |||||
| UD("UD", "Überweisungsdiagnose"), | |||||
| VO("VO", "Präoperative Diagnose"), | |||||
| W("W", "Working"), | |||||
| ZD("ZD", "Neben- / Zusatzdiagnose"), | |||||
| U("U", "Unknown"); | |||||
| private final String id; | |||||
| private final String diagArt; | |||||
| DiagArt2(String id, String diagArt) { | |||||
| this.id = id; | |||||
| this.diagArt = diagArt; | |||||
| } | |||||
| public static DiagArt2 parseString(String s) { | |||||
| for (DiagArt2 diagart2 : DiagArt2.values()) { | |||||
| if (diagart2.id.equalsIgnoreCase(s)) { | |||||
| return diagart2; | |||||
| } | |||||
| } | |||||
| return U; | |||||
| } | |||||
| @Override | |||||
| public String toString() { | |||||
| return diagArt; | |||||
| } | |||||
| public String id() { | |||||
| return id; | |||||
| } | |||||
| } | |||||
| @@ -8,17 +8,17 @@ import javafx.beans.property.SimpleStringProperty; | |||||
| public class Diagnose extends Version { | public class Diagnose extends Version { | ||||
| private Fall fall; | private Fall fall; | ||||
| //ICDCODE | //ICDCODE | ||||
| private int diagID; | |||||
| private String diagID; | |||||
| private Icd10Code icd10code; | private Icd10Code icd10code; | ||||
| private Mitarbeiter arzt; | private Mitarbeiter arzt; | ||||
| private SimpleStringProperty freiText = new SimpleStringProperty(this, "freiText"); | private SimpleStringProperty freiText = new SimpleStringProperty(this, "freiText"); | ||||
| private DiagArt diagArt; | private DiagArt diagArt; | ||||
| public int getDiagID() { | |||||
| public String getDiagID() { | |||||
| return diagID; | return diagID; | ||||
| } | } | ||||
| public void setDiagID(int diagID) { | |||||
| public void setDiagID(String diagID) { | |||||
| this.diagID = diagID; | this.diagID = diagID; | ||||
| } | } | ||||
| @@ -15,7 +15,7 @@ public class Fall extends Version { | |||||
| private Kasse kasse; | private Kasse kasse; | ||||
| private Diagnose hauptDiagnose; | private Diagnose hauptDiagnose; | ||||
| private SimpleIntegerProperty hauptdiagnoseId = new SimpleIntegerProperty(this, "hauptdiagnoseId"); | |||||
| private SimpleStringProperty hauptdiagnoseId = new SimpleStringProperty(this, "hauptdiagnoseId"); | |||||
| private SimpleStringProperty einweisenderArzt = new SimpleStringProperty(this, "einweiser"); | private SimpleStringProperty einweisenderArzt = new SimpleStringProperty(this, "einweiser"); | ||||
| @@ -37,15 +37,15 @@ public class Fall extends Version { | |||||
| } | } | ||||
| public int getHauptdiagnoseId() { | |||||
| public String getHauptdiagnoseId() { | |||||
| return hauptdiagnoseId.get(); | return hauptdiagnoseId.get(); | ||||
| } | } | ||||
| public void setHauptdiagnoseId(int hauptdiagnoseId) { | |||||
| public void setHauptdiagnoseId(String hauptdiagnoseId) { | |||||
| this.hauptdiagnoseId.set(hauptdiagnoseId); | this.hauptdiagnoseId.set(hauptdiagnoseId); | ||||
| } | } | ||||
| public SimpleIntegerProperty hauptdiagnoseIdProperty() { | |||||
| public SimpleStringProperty hauptdiagnoseIdProperty() { | |||||
| return hauptdiagnoseId; | return hauptdiagnoseId; | ||||
| } | } | ||||