|
|
|
@@ -23,7 +23,9 @@ import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
* Manages all HL7 sending tasks. This includes: creating a message, sending the message, |
|
|
|
* Created by taschi on 22.11.15. |
|
|
|
* |
|
|
|
*/ |
|
|
|
public class HL7Sender { |
|
|
|
|
|
|
|
@@ -32,7 +34,7 @@ public class HL7Sender { |
|
|
|
* |
|
|
|
* |
|
|
|
* @param fall to create the message from this content. patient and diagnosis are linked to fall |
|
|
|
* @throws Exception |
|
|
|
* @throws HL7Exception, IOException, SQLException |
|
|
|
*/ |
|
|
|
public static void createMessageADT_A01(Fall fall) throws HL7Exception, IOException, SQLException { |
|
|
|
Patient patient = fall.getPatient(); |
|
|
|
@@ -93,7 +95,7 @@ public class HL7Sender { |
|
|
|
|
|
|
|
/** |
|
|
|
* Sending message handler. Calls function to send current message |
|
|
|
* @param message |
|
|
|
* @param message to send |
|
|
|
* @throws HL7Exception |
|
|
|
*/ |
|
|
|
private static void sendMessage(Message message) throws HL7Exception { |
|
|
|
@@ -126,7 +128,7 @@ public class HL7Sender { |
|
|
|
HL7LogEntry responseEntry = new HL7LogEntry(); |
|
|
|
|
|
|
|
messageEntry.setMessage(message.encode()); |
|
|
|
messageEntry.setSource("127.0.0.1:1234"); // TODO: Kann man den lokal genutzen Port raus finden? |
|
|
|
messageEntry.setSource("127.0.0.1:1234"); |
|
|
|
messageEntry.setDirection(HL7LogEntry.Direction.OUT); |
|
|
|
messageEntry.setTimestamp(LocalDateTime.now()); |
|
|
|
messageEntry.setTimestamp(HL7Utils.parseLocalDateTime(adt_a01.getMSH().getDateTimeOfMessage().getTime())); |
|
|
|
|