浏览代码

Replace \r witth \n in HL7 log entries.

master
父节点
当前提交
631ea55b01
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. +3
    -3
      src/main/java/de/uniluebeck/mi/projmi6/db/DBHandler.java

+ 3
- 3
src/main/java/de/uniluebeck/mi/projmi6/db/DBHandler.java 查看文件

@@ -928,7 +928,7 @@ public class DBHandler {
*/ */
public static void setHL7Nachricht(String hl7msg, LocalDateTime timestamp, String source) throws SQLException { public static void setHL7Nachricht(String hl7msg, LocalDateTime timestamp, String source) throws SQLException {
PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_HL7NACHRICHT); PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_HL7NACHRICHT);
statement.setString(1, hl7msg);
statement.setString(1, hl7msg.replaceAll("\r", "\n"));
statement.setTimestamp(2, Timestamp.valueOf(timestamp)); statement.setTimestamp(2, Timestamp.valueOf(timestamp));
statement.setString(3, source); statement.setString(3, source);
statement.execute(); statement.execute();
@@ -971,7 +971,7 @@ public class DBHandler {
*/ */
public static void setHL7LogEntry(HL7LogEntry entry) throws SQLException { public static void setHL7LogEntry(HL7LogEntry entry) throws SQLException {
PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_HL7NACHRICHT_); PreparedStatement statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_HL7NACHRICHT_);
statement.setString(1, entry.getMessage());
statement.setString(1, entry.getMessage().replaceAll("\r", "\n"));
statement.setTimestamp(2, Timestamp.valueOf(entry.getTimestamp())); statement.setTimestamp(2, Timestamp.valueOf(entry.getTimestamp()));
statement.setString(3, entry.getSource()); statement.setString(3, entry.getSource());
statement.setString(4, entry.getDirection().toString()); statement.setString(4, entry.getDirection().toString());
@@ -980,7 +980,7 @@ public class DBHandler {


private static HL7LogEntry getHL7LogEntry(ResultSet rs) throws SQLException { private static HL7LogEntry getHL7LogEntry(ResultSet rs) throws SQLException {
HL7LogEntry entry = new HL7LogEntry(rs.getInt("msgid")); HL7LogEntry entry = new HL7LogEntry(rs.getInt("msgid"));
entry.setMessage(rs.getString("hl7msg"));
entry.setMessage(rs.getString("hl7msg").replaceAll("\r", "\n"));
entry.setTimestamp(rs.getTimestamp("timestamp").toLocalDateTime()); entry.setTimestamp(rs.getTimestamp("timestamp").toLocalDateTime());
entry.setSource(rs.getString("source")); entry.setSource(rs.getString("source"));
entry.setDirection(HL7LogEntry.Direction.parseDirection(rs.getString("direction"))); entry.setDirection(HL7LogEntry.Direction.parseDirection(rs.getString("direction")));


正在加载...
取消
保存