Skip to content

Commit 578024e

Browse files
committed
Update mGAP Query
1 parent fb2e3a4 commit 578024e

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

mGAP/resources/queries/mGAP/subjectsSource.query.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<metadata>
33
<tables xmlns="http://labkey.org/data/xml">
44
<table tableName="" tableDbType="TABLE">
5+
<tableTitle>mGAP Subject/Demographics Source Data</tableTitle>
56
<pkColumnName>subjectName</pkColumnName>
67
</table>
78
</tables>

mGAP/resources/queries/mGAP/subjectsSource.sql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ SELECT
1010
WHEN s.Id IS NOT NULL THEN 'ONPRC'
1111
ELSE NULL END as center,
1212
d.status as status,
13-
m.subjectname as originalId
13+
m.subjectname as originalId,
14+
p1.externalAlias as sire,
15+
coalesce(s.Id.parents.sire, d.sire) as originalSire,
16+
p2.externalAlias as dam,
17+
coalesce(s.Id.parents.dam, d.dam) as originalDam,
1418

1519
FROM mgap.animalMapping m
1620
LEFT JOIN "/Internal/PMR/".study.demographics s ON (m.subjectname = s.Id)
1721
LEFT JOIN mgap.demographics d ON (m.subjectname = d.subjectname)
22+
LEFT JOIN mgap.animalMapping p1 ON (p1.subjectname = coalesce(s.Id.parents.sire, d.sire))
23+
LEFT JOIN mgap.animalMapping p2 ON (p2.subjectname = coalesce(s.Id.parents.dam, d.dam))
1824
WHERE (s.Id IS NOT NULL OR d.subjectname IS NOT NULL)

mGAP/resources/views/mgapDataDashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
name: 'Subject Information Synced to mGAP',
101101
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {
102102
schemaName: 'mgap',
103-
queryName: 'subjectDatasetsSource'
103+
queryName: 'subjectsSource'
104104
})
105105
}]
106106
},{

0 commit comments

Comments
 (0)