Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions WNPRC_EHR/src/org/labkey/wnprc_ehr/WNPRC_EHRController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2057,19 +2057,17 @@ private List<Map<String, Object>> getWaterAmountRecord (String objectId) throws
columns.add(FieldKey.fromString("taskid"));
columns.add(FieldKey.fromString("date"));


SimpleFilter filter = new SimpleFilter(FieldKey.fromString("objectid"), objectId);
QueryHelper waterOrderQuery = new QueryHelper(getContainer(), getUser(), "study","waterAmount");
Results rs = waterOrderQuery.select(columns, filter);

List<Map<String, Object>> woRows = new ArrayList<>();
while (rs.next())
try (Results rs = waterOrderQuery.select(columns, filter))
{
woRows.add(rs.getRowMap());
List<Map<String, Object>> woRows = new ArrayList<>();
while (rs.next())
{
woRows.add(rs.getRowMap());
}
return woRows;
}
rs.close();
return woRows;

}

/* TODO: This is an API to clean up an inconsistency in the performed by column of study.obs dataset. Once the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,12 @@ private String getBehaviorString(TableInfo behaviorCodesTableInfo, Map<String, O
String behaviorCode = behaviorCodesArray[i] != null ? behaviorCodesArray[i].trim() : null;
filter.addCondition(FieldKey.fromString("value"), behaviorCode, CompareType.EQUAL);
TableSelector behaviorCodesTableSelector = new TableSelector(behaviorCodesTableInfo, filter, null);
Results results = behaviorCodesTableSelector.getResults();
if (results.next()) {
behaviorTitles.append((String) results.getRowMap().get("title"));
if (i + 1 < behaviorCodesArray.length) {
behaviorTitles.append(", ");
try (Results results = behaviorCodesTableSelector.getResults()) {
if (results.next()) {
behaviorTitles.append((String) results.getRowMap().get("title"));
if (i + 1 < behaviorCodesArray.length) {
behaviorTitles.append(", ");
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,12 @@
import java.io.FileReader;
import java.math.BigDecimal;
import java.nio.file.Paths;
import java.sql.Array;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -255,6 +254,12 @@ public void sendNotification(Notification currentNotification, User currentUser,
String notificationLogName = currentNotification.getName();
String emailBody = currentNotification.getMessageBodyHTML(currentContainer, currentUser);

if (emailBody == null)
{
_log.info(notificationLogName + ": Empty email body, nothing to send");
return;
}

//Logs email notification attempt.
_log.info(notificationLogName + ": sending email...");

Expand Down
Loading