|
|
|
@@ -97,7 +97,7 @@ public class DBHandler { |
|
|
|
"`LetzterBearbeiter`," + |
|
|
|
"`Ersteller`)" + |
|
|
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?)"; |
|
|
|
private static final String UPDATE_UNTERSUCHUNG = "UPDATE `untersuchung`" + |
|
|
|
private static final String UPDATE_UNTERSUCHUNG = "UPDATE `untersuchung` " + |
|
|
|
"SET `DurchfuehrenderArzt`=?," + |
|
|
|
"`FallID`=?," + |
|
|
|
"`OPSCode`=?," + |
|
|
|
@@ -122,6 +122,21 @@ public class DBHandler { |
|
|
|
"INNER JOIN fall f ON s.fallid = f.fallid " + |
|
|
|
"INNER JOIN patient p ON f.patientid = p.id " + |
|
|
|
"WHERE s.station = ?"; |
|
|
|
private static final String INSERT_STATHISTENTRY = "INSERT INTO `stationshistorie`" + |
|
|
|
"(`Aufnahmedatum`," + |
|
|
|
"`Entlassungsdatum`," + |
|
|
|
"`FallID`," + |
|
|
|
"`LetzterBearbeiter`," + |
|
|
|
"`Station`," + |
|
|
|
"`Ersteller`)" + |
|
|
|
"VALUES (?, ?, ?, ?, ?, ?)"; |
|
|
|
private static final String UPDATE_STATHISTENTRY = "UPDATE `stationshistorie` " + |
|
|
|
"SET `Aufnahmedatum`=?," + |
|
|
|
"`Entlassungsdatum`=?," + |
|
|
|
"`FallID`=?," + |
|
|
|
"`LetzterBearbeiter`=?," + |
|
|
|
"`Station`=? " + |
|
|
|
"WHERE `StatHistID`=?"; |
|
|
|
|
|
|
|
/** |
|
|
|
* Gibt alle {@link Patient} aus der DB zurueck. |
|
|
|
@@ -308,6 +323,34 @@ public class DBHandler { |
|
|
|
return historie; |
|
|
|
} |
|
|
|
|
|
|
|
public static void setStationsHistorie(StationsHistorie hist, boolean isUpdate) throws SQLException { |
|
|
|
PreparedStatement statement; |
|
|
|
if (isUpdate) { |
|
|
|
statement = MySqlConnectionFactory.getConnection().prepareStatement(UPDATE_STATHISTENTRY); |
|
|
|
} else { |
|
|
|
statement = MySqlConnectionFactory.getConnection().prepareStatement(INSERT_STATHISTENTRY); |
|
|
|
} |
|
|
|
|
|
|
|
if (hist.getAufnahmeDatum() != null) { |
|
|
|
statement.setTimestamp(1, Timestamp.valueOf(hist.getAufnahmeDatum())); // `Aufnahmedatum` |
|
|
|
} |
|
|
|
if (hist.getEntlassungsDatum() != null) { |
|
|
|
statement.setTimestamp(2, Timestamp.valueOf(hist.getEntlassungsDatum())); // `Entlassungsdatum` |
|
|
|
} |
|
|
|
statement.setInt(3, hist.getFallID()); // `FallID` |
|
|
|
statement.setInt(4, hist.getBearbeiter()); // `LetzterBearbeiter` |
|
|
|
statement.setString(5, hist.getStationKey()); // `Station` |
|
|
|
|
|
|
|
|
|
|
|
if (isUpdate) { |
|
|
|
statement.setInt(6, hist.getStatHistID()); // `StatHistID` |
|
|
|
statement.executeUpdate(); |
|
|
|
} else { |
|
|
|
statement.setInt(6, hist.getErsteller()); // `Ersteller` |
|
|
|
statement.execute(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private static StationsHistorie getStationsHistorie(ResultSet rs) throws SQLException { |
|
|
|
StationsHistorie hist = new StationsHistorie(); |
|
|
|
|
|
|
|
|