Browse Source

Merge remote-tracking branch 'origin/master'

master
Johannes Oehm 10 years ago
parent
commit
44e2cc1ac2
8 changed files with 77 additions and 129 deletions
  1. +18
    -26
      src/main/java/de/uniluebeck/mi/projmi6/controller/FallController.java
  2. +6
    -6
      src/main/java/de/uniluebeck/mi/projmi6/db/DBHandler.java
  3. +1
    -11
      src/main/java/de/uniluebeck/mi/projmi6/hapi/HL7Receiver.java
  4. +18
    -7
      src/main/java/de/uniluebeck/mi/projmi6/hapi/HL7Sender.java
  5. +27
    -24
      src/main/java/de/uniluebeck/mi/projmi6/model/DiagArt.java
  6. +0
    -48
      src/main/java/de/uniluebeck/mi/projmi6/model/DiagArt2.java
  7. +3
    -3
      src/main/java/de/uniluebeck/mi/projmi6/model/Diagnose.java
  8. +4
    -4
      src/main/java/de/uniluebeck/mi/projmi6/model/Fall.java

+ 18
- 26
src/main/java/de/uniluebeck/mi/projmi6/controller/FallController.java View File

@@ -14,7 +14,6 @@ import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import javafx.scene.layout.GridPane;
@@ -24,6 +23,14 @@ import java.sql.SQLException;

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;
@FXML
private DateTimePicker dtTmAufnahme, dtTmEntlassung;
@@ -46,16 +53,6 @@ public class FallController {
@FXML
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.
@@ -89,13 +86,6 @@ public class FallController {
}

/**
* State definitions.
*/
public enum State {
CREATE, EDIT, VIEW
}

/**
* Getter for the {@link #stateProperty()}.
*/
public State getState() {
@@ -195,7 +185,6 @@ public class FallController {
btnFallSendHl7.visibleProperty().bind(btnFallSendHl7.managedProperty());
}


/**
* EventHandler for the {@link #btnFallSendHl7} button.
*/
@@ -229,7 +218,6 @@ public class FallController {
editFall();
}


/**
* EventHandler for the {@link #btnFallCancel}.
*/
@@ -255,7 +243,6 @@ public class FallController {
copyFallDataIntoField(fallProperty.get());
}


/**
* EventHandler for the {@link #btnFallSave} button.
*/
@@ -273,7 +260,7 @@ public class FallController {
}
try {
HL7Sender.createMessageADT_A01(fall);
}catch(IOException | HL7Exception | SQLException e){
} catch (IOException | HL7Exception | SQLException e) {
e.printStackTrace();
}
} else {
@@ -310,7 +297,6 @@ public class FallController {
fallVersichertennummer.setText(patient.getVersichertennummer());
}


/**
* Clears the TextFields.
*/
@@ -390,7 +376,6 @@ public class FallController {
fallEditor.setText(Integer.toString(fall.getBearbeiter()));



fallEinweisenderArzt.setText(fall.getEinweisenderArzt());
fallSelbsteinweisung.setSelected(fall.getSelbsteinweisung());

@@ -402,7 +387,6 @@ public class FallController {
fallFallart.setValue(fall.getFallArt());
}


/**
* This method sets the main diagnosis in the ComboBox
* @param fall The case whose main diagnosis will be picked
@@ -416,7 +400,7 @@ public class FallController {

for (Diagnose diagnose : fallHauptdiagnose.getItems()) {
System.out.println(diagnose.getDiagID() + "=" + fall.getHauptdiagnoseId());
if (diagnose.getDiagID() == fall.getHauptdiagnoseId()) {
if (diagnose.getDiagID().equalsIgnoreCase(fall.getHauptdiagnoseId())) {
fallHauptdiagnose.getSelectionModel().select(diagnose);
return;
}
@@ -424,5 +408,13 @@ public class FallController {
}


/**
* State definitions.
*/
public enum State {
CREATE, EDIT, VIEW
}



}

+ 6
- 6
src/main/java/de/uniluebeck/mi/projmi6/db/DBHandler.java View File

@@ -483,7 +483,7 @@ public class DBHandler {
}
if (rs.getInt("hauptdiagnose") != 0) {
fall.setHauptDiagnose(getDiagnose(rs.getInt("hauptdiagnose"), fall));
fall.setHauptdiagnoseId(rs.getInt("hauptdiagnose"));
fall.setHauptdiagnoseId(rs.getString("hauptdiagnose"));
}
if (rs.getString("versichertennummer") != null) {
fall.setVersichertenNummer(rs.getString("versichertennummer"));
@@ -540,8 +540,8 @@ public class DBHandler {
statement.setString(5, null);
}
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 {
statement.setTimestamp(7, null);
}
@@ -611,10 +611,10 @@ public class DBHandler {
private static Diagnose getDiagnose(ResultSet rs) throws SQLException {
Diagnose diagnose = new Diagnose();

diagnose.setDiagID(rs.getInt("diagid"));
diagnose.setDiagID(rs.getString("diagid"));
diagnose.setFreiText(rs.getString("freitext"));
diagnose.setArzt(new Mitarbeiter(rs.getInt("arzt")));
diagnose.setDiagArt(DiagArt.parseInt(rs.getInt("diagart")));
diagnose.setDiagArt(DiagArt.parseString(rs.getString("diagart")));
setVersionInformation(diagnose, rs);
diagnose.setIcd10code(getIcd10Code(rs.getString("icd10code"), rs.getInt("icd10version")));
return diagnose;
@@ -905,7 +905,7 @@ public class DBHandler {
public static void setDiagnose(Diagnose diagnose) throws SQLException {
PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_DIAGNOSE);
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.setString(4, diagnose.getFreiText()); // `Freitext`
statement.setString(5, diagnose.getIcd10code().getCode()); // `ICD10Code`


+ 1
- 11
src/main/java/de/uniluebeck/mi/projmi6/hapi/HL7Receiver.java View File

@@ -177,17 +177,7 @@ public class HL7Receiver<T extends AbstractMessage> implements ReceivingApplicat
diagnose.setArzt(mitarbeiter);
// (DG1-6) // TODO: Enum umstellen? Neeee...
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());

diagnosen.add(diagnose);


+ 18
- 7
src/main/java/de/uniluebeck/mi/projmi6/hapi/HL7Sender.java View File

@@ -28,17 +28,17 @@ import java.util.List;
public class HL7Sender {

/**
* erstellt eine ADT_A0 nachricht, welche anschließend an die OPS Gruppe verschickt werden soll.
* TODO Mit OPS Gruppe absprechen, welche Informationen sie auf jeden Fall benötigen und Code entsprechend anpassen.
* generates an ADT_A05 message for data exchange with OPS group
*
* @param fall nach dem Erstellen eines neuen Falls wird diese Methode aufgerufen um Hl7 Nachricht zu erzeugen
*
* @param fall to create the message from this content. patient and diagnosis are linked to fall
* @throws Exception
*/
public static void createMessageADT_A01(Fall fall) throws HL7Exception, IOException, SQLException {
Patient patient = fall.getPatient();
ADT_A01 adt = new ADT_A01();

//default MSH Values (Sets Segments: 1,2,7,9,11
//default MSH Values (Sets Segments: 1,2,7,9,10,11
adt.initQuickstart("ADT", "A01", "P");

//MSH Segment:
@@ -47,7 +47,6 @@ public class HL7Sender {
mshSegment.getMsh5_ReceivingApplication().getNamespaceID().parse("OPS Gruppe von Maurice und Torben");
mshSegment.getMsh12_VersionID().getVersionID().parse("2.5.1");
mshSegment.getMsh15_AcceptAcknowledgmentType().parse("AL");
//TODO check ob segment 10 gesetzt wurde

//EVN Segment:
EVN evnSegment = adt.getEVN();
@@ -69,7 +68,7 @@ public class HL7Sender {
pidSegment.getPid13_PhoneNumberHome(0).getTelephoneNumber().parse(patient.getTelefon());
pidSegment.getPid16_MaritalStatus().getAlternateIdentifier().parse(patient.getFamilienstand().toString());

//Diagnosen
//Diagnosen (DG1 Segmente des PV1 Segments
List<Diagnose> diagnosen = DBHandler.getDiagnosenByFall(fall);
PV1 pv1Segment = adt.getPV1();
pv1Segment.getPv12_PatientClass().parse("U");
@@ -86,18 +85,30 @@ public class HL7Sender {
xcn.getFamilyName().getSurname().setValue(arzt.getNachname());
xcn.getPrefixEgDR().setValue(arzt.getTitel());
dg1.getDg14_DiagnosisDescription().parse(diagnose.getFreiText());
dg1.getDg16_DiagnosisType().parse(diagnose.getDiagArt().toString());
dg1.getDg16_DiagnosisType().parse(diagnose.getDiagArt().id());
i++;
}
sendMessage(adt);
}

/**
* Sending message handler. Calls function to send current message
* @param message
* @throws HL7Exception
*/
private static void sendMessage(Message message) throws HL7Exception {
if (message instanceof ADT_A01) {
sendMessageADT_A01(message);
}
}

/**
* sends an ADT_A01 message and waits ca 5 seconds for an ACK. If no ACK occurs it sends the message ONLY 5 times again
* if after 5 times no ack occurs log message
* write log historie in database
* @param message you want to send
* @throws HL7Exception
*/
private static void sendMessageADT_A01(Message message) throws HL7Exception {
ADT_A01 adt_a01 = (ADT_A01) message;
HapiContext context = new DefaultHapiContext();


+ 27
- 24
src/main/java/de/uniluebeck/mi/projmi6/model/DiagArt.java View File

@@ -5,41 +5,44 @@ package de.uniluebeck.mi.projmi6.model;
*/
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;

DiagArt(int id, String diagArt) {
DiagArt(String id, String diagArt) {
this.id = id;
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
public String toString() {
return diagArt;
}

public String id() {
return id;
}
}

+ 0
- 48
src/main/java/de/uniluebeck/mi/projmi6/model/DiagArt2.java View File

@@ -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;
}
}

+ 3
- 3
src/main/java/de/uniluebeck/mi/projmi6/model/Diagnose.java View File

@@ -8,17 +8,17 @@ import javafx.beans.property.SimpleStringProperty;
public class Diagnose extends Version {
private Fall fall;
//ICDCODE
private int diagID;
private String diagID;
private Icd10Code icd10code;
private Mitarbeiter arzt;
private SimpleStringProperty freiText = new SimpleStringProperty(this, "freiText");
private DiagArt diagArt;

public int getDiagID() {
public String getDiagID() {
return diagID;
}

public void setDiagID(int diagID) {
public void setDiagID(String diagID) {
this.diagID = diagID;
}



+ 4
- 4
src/main/java/de/uniluebeck/mi/projmi6/model/Fall.java View File

@@ -15,7 +15,7 @@ public class Fall extends Version {
private Kasse kasse;
private Diagnose hauptDiagnose;

private SimpleIntegerProperty hauptdiagnoseId = new SimpleIntegerProperty(this, "hauptdiagnoseId");
private SimpleStringProperty hauptdiagnoseId = new SimpleStringProperty(this, "hauptdiagnoseId");

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();
}

public void setHauptdiagnoseId(int hauptdiagnoseId) {
public void setHauptdiagnoseId(String hauptdiagnoseId) {
this.hauptdiagnoseId.set(hauptdiagnoseId);
}

public SimpleIntegerProperty hauptdiagnoseIdProperty() {
public SimpleStringProperty hauptdiagnoseIdProperty() {
return hauptdiagnoseId;
}



Loading…
Cancel
Save