Skip to content

Commit 5c7c8bf

Browse files
authored
25.7 fb parentage reports (#1601)
* Modified Parentage report on both the Clinical Snapshot, and Parentage tab * Modified Parentage reporting on the Clinical Snapshot reports. * Modified Parentage reporting process. * Modified Parentage reports to include source of data. * Modified Offspring reporting to include surrogate mom.
1 parent 395e85c commit 5c7c8bf

4 files changed

Lines changed: 52 additions & 6 deletions

File tree

onprc_ehr/resources/queries/study/parentageSummary.query.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
<table tableName="parentageSummary" tableDbType="TABLE">
55
<tableTitle>Parentage Summary</tableTitle>
66
<columns>
7+
<column columnName="Id">
8+
<columnTitle>Id</columnTitle>
9+
</column>
10+
<column columnName="date">
11+
<columnTitle>Date</columnTitle>
12+
</column>
713
<column columnName="parent">
814
<columnTitle>Parent</columnTitle>
915
<fk>
@@ -18,6 +24,12 @@
1824
<column columnName="method">
1925
<columnTitle>Method</columnTitle>
2026
</column>
27+
<column columnName="remark">
28+
<columnTitle>Comments</columnTitle>
29+
</column>
30+
<column columnName="source">
31+
<columnTitle>Data Source</columnTitle>
32+
</column>
2133
</columns>
2234
</table>
2335
</tables>

onprc_ehr/resources/queries/study/parentageSummary.sql

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ SELECT
1818
p.date,
1919
p.parent,
2020
p.relationship,
21-
p.method
21+
p.method,
22+
p.remark,
23+
'Parentage' as source
2224

2325
FROM study.parentage p
2426
WHERE p.qcstate.publicdata = true and p.enddate is null
27+
And p.date in (select max(t.date) from study.parentage t where p.Id = t.Id And p.parent = t.parent
28+
And p.relationship =t.relationship And p.method = t.method And t.enddate is null and p.enddate is null and t.qcstate.publicdata = true)
2529

2630
UNION
2731

@@ -30,20 +34,23 @@ SELECT
3034
b.date,
3135
b.dam,
3236
'Dam' as relationship,
33-
'Observed' as method
37+
'Observed' as method,
38+
null as remark,
39+
'Birth' as source
3440

3541
FROM study.birth b
3642
WHERE b.dam is not null and b.qcstate.publicdata = true
37-
And 'dam' not in (select k.relationship from study.parentage k where k.Id = b.Id and k.enddate is null)
43+
3844
UNION
3945

4046
SELECT
4147
a.Id,
42-
a.date,
48+
a.date,
4349
a.sire,
4450
'Sire' as relationship,
45-
'Observed' as method
51+
'Observed' as method,
52+
null as remark,
53+
'Birth' as source
4654

4755
FROM study.birth a
4856
WHERE a.sire is not null and a.qcstate.publicdata = true
49-
And 'sire' not in (select k.relationship from study.parentage k where k.Id = a.Id and k.enddate is null)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
2+
<columns>
3+
<column name="Id"/>
4+
<column name="parent"/>
5+
<column name="relationship"/>
6+
<column name="method"/>
7+
<column name="remark"/>
8+
<column name="source"/>
9+
</columns>
10+
<sorts>
11+
<sort column="date" descending="true"/>
12+
</sorts>
13+
</customView>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
2+
<columns>
3+
<column name="Id"/>
4+
<column name="date"/>
5+
<column name="parent"/>
6+
<column name="relationship"/>
7+
<column name="method"/>
8+
<column name="remark"/>
9+
<column name="source"/>
10+
</columns>
11+
<sorts>
12+
<sort column="date" descending="true"/>
13+
</sorts>
14+
</customView>

0 commit comments

Comments
 (0)