diff --git a/onprc_ehr/resources/queries/study/parentageSummary.sql b/onprc_ehr/resources/queries/study/parentageSummary.sql index d410bee51..404799898 100644 --- a/onprc_ehr/resources/queries/study/parentageSummary.sql +++ b/onprc_ehr/resources/queries/study/parentageSummary.sql @@ -15,7 +15,6 @@ */ SELECT p.Id, - p.date, p.parent, p.relationship, p.method @@ -27,23 +26,20 @@ UNION SELECT b.Id, - b.date, b.dam, 'Dam' as relationship, 'Observed' as method FROM study.birth b WHERE b.dam is not null and b.qcstate.publicdata = true -And 'dam' not in (select k.relationship from study.parentage k where k.Id = b.Id and k.enddate is null) + UNION SELECT a.Id, - a.date, a.sire, 'Sire' as relationship, 'Observed' as method FROM study.birth a WHERE a.sire is not null and a.qcstate.publicdata = true - And 'sire' not in (select k.relationship from study.parentage k where k.Id = a.Id and k.enddate is null) \ No newline at end of file