Skip to content

Commit 6845650

Browse files
committed
Add SIV calculated fields
1 parent 91be6e1 commit 6845650

5 files changed

Lines changed: 51 additions & 0 deletions

File tree

SivStudies/resources/queries/study/demographics/Expanded.qview.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<column name="projects/allStudies"/>
1010
<column name="projects/categories"/>
1111
<column name="immunizations/immunizations"/>
12+
<column name="sivART/allInfections"/>
13+
<column name="sivART/allART"/>
1214
<column name="outcomes/outcomes"/>
1315
</columns>
1416
<sorts>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<query xmlns="http://labkey.org/data/xml/query">
2+
<metadata>
3+
<tables xmlns="http://labkey.org/data/xml">
4+
<table tableName="" tableDbType="NOT_IN_DB">
5+
<tableTitle>SIV/ART Summary</tableTitle>
6+
<columns>
7+
<column columnName="Id">
8+
<isKeyField>true</isKeyField>
9+
<isHidden>true</isHidden>
10+
</column>
11+
<column columnName="allInfections">
12+
<columnTitle>SIV Infection</columnTitle>
13+
</column>
14+
<column columnName="allART">
15+
<columnTitle>ART</columnTitle>
16+
</column>
17+
</columns>
18+
<titleColumn>allInfections</titleColumn>
19+
</table>
20+
</tables>
21+
</metadata>
22+
</query>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
SELECT
2+
t.Id,
3+
group_concat(DISTINCT CASE
4+
WHEN t.category = 'SIV Infection' THEN (cast(month(t.date) as varchar) || '-' || cast(dayofmonth(t.date) as varchar) || '-' || cast(year(t.date) as varchar) || ' (' || t.treatment || ')')
5+
ELSE NULL
6+
END, char(10)) as allInfections,
7+
group_concat(DISTINCT CASE
8+
WHEN t.category = 'ART' THEN (cast(month(t.date) as varchar) || '-' || cast(dayofmonth(t.date) as varchar) || '-' || cast(year(t.date) as varchar) || ' (' || t.treatment || ')')
9+
ELSE NULL
10+
END, char(10)) as allART,
11+
12+
FROM study.treatments t
13+
GROUP BY t.Id
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script type="text/javascript" nonce="<%=scriptNonce%>">
2+
// NOTE: this is intended to be set as the study participant view through the UI.
3+
// Loading ClientDependencies is a pain through that mechanism, so this just redirects
4+
Ext4.onReady(function (){
5+
window.location = LABKEY.ActionURL.buildURL('laboratory', 'dataBrowser', null, {subjectId: LABKEY.ActionURL.getParameter('participantId')});
6+
});
7+
</script>

SivStudies/src/org/labkey/sivstudies/query/SivStudiesCustomizer.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,13 @@ private void appendDemographicsColumns(AbstractTableInfo parentTable)
249249
colInfo.setLabel("Outcomes");
250250
parentTable.addColumn(colInfo);
251251
}
252+
253+
if (parentTable.getColumn("sivART") == null)
254+
{
255+
BaseColumnInfo colInfo = getWrappedIdCol(parentTable.getUserSchema(), "demographicsChallengeAndArt", parentTable, "sivART");
256+
colInfo.setLabel("SIV/ART Dates");
257+
parentTable.addColumn(colInfo);
258+
}
252259
}
253260

254261
private void appendPvlColumns(DatasetTable ds, String subjectColName, String dateColName)

0 commit comments

Comments
 (0)