Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private void processSet(String assayType, Map<Integer, List<Map<String, Object>>
}
catch (Exception e)
{
_log.error(e);
_log.error(e.getMessage(), e);
throw new IllegalArgumentException(e.getMessage());
}
}
Expand Down
2 changes: 1 addition & 1 deletion SivStudies/resources/queries/study/assignment.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<fkDbSchema>studies</fkDbSchema>
<fkTable>studyCohorts</fkTable>
<fkColumnName>rowId</fkColumnName>
<fkDisplayColumnName>labelOrName</fkDisplayColumnName>
<fkDisplayColumnName>studyAndCohort</fkDisplayColumnName>
</fk>
</column>
<column columnName="description">
Expand Down
12 changes: 12 additions & 0 deletions SivStudies/resources/queries/study/duplicatePVLs.query.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="duplicatePVLs" tableDbType="NOT_IN_DB">
<tableTitle>Duplicate PVLs</tableTitle>
<columns>

</columns>
</table>
</tables>
</metadata>
</query>
21 changes: 21 additions & 0 deletions SivStudies/resources/queries/study/duplicatePVLs.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
SELECT
t.Id,
t.date,
t.sampleType,
t.assayType,
t.target,
t.result,
t.resultOORIndicator,
t.dataSource,
t.lsid,
t.created,
v.maxLsid,
CASE WHEN t.lsid = v.maxLsid THEN TRUE ELSE FALSE END as isMostRecent

FROM study.viralLoads t
INNER JOIN (
SELECT v.Id, v.date, v.sampleType, v.assayType, max(v.lsid) as maxLsid
FROM study.viralLoads v
GROUP BY v.Id, v.date, v.sampleType, v.assayType
HAVING count(*) > 1
) v ON (v.Id = t.Id AND v.date = t.date AND v.sampleType = t.sampleType AND v.assayType = t.assayType)
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ private void pruneSivChallenges(PipelineJob pipelineJob) throws PipelineJobExcep
private static final Pattern mir126_RE = Pattern.compile("miR[- ]{0,1}126", Pattern.CASE_INSENSITIVE);
private static final Pattern mir142_RE = Pattern.compile("miR[- ]{0,1}142", Pattern.CASE_INSENSITIVE);
private static final Pattern mir126_142_RE = Pattern.compile("miR[- ]{0,1}142[ ,-]{1,2}126", Pattern.CASE_INSENSITIVE);
private static final Pattern pp71_RE = Pattern.compile("pp71", Pattern.CASE_INSENSITIVE);

private void updateVaccineInformation(PipelineJob pipelineJob) throws PipelineJobException
{
Expand Down Expand Up @@ -133,6 +134,10 @@ else if (treatment.contains("RhCMV") && treatment.contains("d186-189"))
{
updatedRow.put("backbone", "68-1 d186-189");
}
else if (treatment.contains("RhCMV") && treatment.contains("pp71"))
{
updatedRow.put("backbone", "68-1 delta-pp71");
}
}

if (treatment.toUpperCase().contains("MOCK"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public String getEmailSubject(Container c)
idsMissingFromDemographics(c, u, msg);
missingArtRecord(c, u, msg);
missingAnchorDates(c, u, msg);
duplicatePVLs(c, u, msg);

if (!msg.isEmpty())
{
Expand Down Expand Up @@ -128,7 +129,7 @@ private void genericQueryCheck(Container c, User u, StringBuilder msg, String sc
if (count > 0)
{
msg.append("<b>WARNING: There are ").append(count).append(" " + message + "</b><br>\n");
msg.append("<p><a href='").append(getExecuteQueryUrl(c, schemaName, queryName, null)).append("'>Click here to view them</a><br>\n\n");
msg.append("<p><a href='").append(getExecuteQueryUrl(c, schemaName, queryName, null, filter)).append("'>Click here to view them</a><br>\n\n");
msg.append("<hr>\n\n");
}
}
Expand Down Expand Up @@ -161,7 +162,7 @@ private void missingArtRecord(Container c, User u, StringBuilder msg)
SimpleFilter filter = new SimpleFilter(FieldKey.fromString("projects/studyDescription"), "ART", CompareType.CONTAINS);
filter.addCondition(FieldKey.fromString("projects/studyDescription"), "No ART", CompareType.DOES_NOT_CONTAIN);
filter.addCondition(FieldKey.fromString("sivART/artInitiationDPI"), null, CompareType.ISBLANK);
genericQueryCheck(c, u, msg, "study", s.getSubjectNounSingular(), "IDs assigned to an ART study without a record of ART", filter);
genericQueryCheck(c, u, msg, "study", "demographics", "IDs assigned to an ART study without a record of ART", filter);
}

private void missingAnchorDates(Container c, User u, StringBuilder msg)
Expand All @@ -175,6 +176,17 @@ private void missingAnchorDates(Container c, User u, StringBuilder msg)
genericQueryCheck(c, u, msg, "study", "missingAnchorDates", "records missing from the anchor dates table");
}

private void duplicatePVLs(Container c, User u, StringBuilder msg)
{
Study s = StudyService.get().getStudy(getTargetContainer(c));
if (s == null)
{
return;
}

genericQueryCheck(c, u, msg, "study", "duplicatePVLs", "duplicate PVL records");
}

protected Container getTargetContainer(Container c)
{
return c.isWorkbookOrTab() ? c.getParent() : c;
Expand Down
2 changes: 1 addition & 1 deletion mGAP/src/org/labkey/mgap/mGAPController.java
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ public boolean handlePost(Object o, BindException errors) throws Exception
}
catch (Exception e)
{
_log.error(e);
_log.error(e.getMessage(), e);
throw e;
}

Expand Down
Loading