Skip to content

Commit b320081

Browse files
committed
Expand ETL/presentation of SIV data
1 parent 98ec981 commit b320081

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

SivStudies/resources/queries/study/demographicsChallengeAndArt.query.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<columnTitle>Infection Date</columnTitle>
2323
</column>
2424
<column columnName="artInitiationDate">
25-
<columnTitle>ART Initiation (WPI)</columnTitle>
25+
<columnTitle>ART Initiation (DPI)</columnTitle>
2626
</column>
2727
</columns>
2828
<titleColumn>allInfections</titleColumn>

SivStudies/src/org/labkey/sivstudies/etl/PerformManualIdrStepsTask.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.apache.xmlbeans.XmlException;
44
import org.jetbrains.annotations.NotNull;
5+
import org.labkey.api.collections.CaseInsensitiveHashMap;
56
import org.labkey.api.data.CompareType;
67
import org.labkey.api.data.SimpleFilter;
78
import org.labkey.api.data.TableInfo;
@@ -158,8 +159,8 @@ private void updateChallengeAnchorDates(PipelineJob pipelineJob) throws Pipeline
158159
TableInfo ad = QueryService.get().getUserSchema(_containerUser.getUser(), _containerUser.getContainer(), "studies").getTable("subjectAnchorDates");
159160

160161
Map<String, Set<Date>> existingRecords = new HashMap<>();
161-
new TableSelector(ad, PageFlowUtil.set("Id", "date", "rowid"), new SimpleFilter(FieldKey.fromString("eventLabel"), "SIV Infection"), null).forEachResults(rs -> {
162-
String id = rs.getString(FieldKey.fromString("Id"));
162+
new TableSelector(ad, PageFlowUtil.set("subjectId", "date", "rowid"), new SimpleFilter(FieldKey.fromString("eventLabel"), "SIV Infection"), null).forEachResults(rs -> {
163+
String id = rs.getString(FieldKey.fromString("subjectId"));
163164
if (!existingRecords.containsKey(id))
164165
{
165166
existingRecords.put(id, new HashSet<>());
@@ -183,7 +184,7 @@ private void updateChallengeAnchorDates(PipelineJob pipelineJob) throws Pipeline
183184
if (!existingRecords.containsKey(id) | !existingRecords.get(id).contains(date))
184185
{
185186
toInsert.add(Map.of(
186-
"Id", id,
187+
"subjectId", id,
187188
"date", date,
188189
"category", "SIV Infection",
189190
"sourceRecord", rs.getString(FieldKey.fromString("objectId"))
@@ -212,12 +213,12 @@ private void updateChallengeAnchorDates(PipelineJob pipelineJob) throws Pipeline
212213
}
213214

214215
final List<Map<String, Object>> toDelete = new ArrayList<>();
215-
new TableSelector(ad, PageFlowUtil.set("Id", "date", "rowid"), new SimpleFilter(FieldKey.fromString("eventLabel"), "SIV Infection"), null).forEachResults(rs -> {
216-
String id = rs.getString(FieldKey.fromString("Id"));
216+
new TableSelector(ad, PageFlowUtil.set("subjectId", "date", "rowid"), new SimpleFilter(FieldKey.fromString("eventLabel"), "SIV Infection"), null).forEachResults(rs -> {
217+
String id = rs.getString(FieldKey.fromString("subjectId"));
217218
Date date = rs.getDate(FieldKey.fromString("date"));
218219
if (!sourceRecords.containsKey(id) | !sourceRecords.get(id).contains(date))
219220
{
220-
toDelete.add(Map.of("rowId", rs.getInt(FieldKey.fromString("rowId"))));
221+
toDelete.add(new CaseInsensitiveHashMap<>(Map.of("rowid", rs.getInt(FieldKey.fromString("rowId")))));
221222
}
222223
});
223224

0 commit comments

Comments
 (0)