We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 065177a + d91de89 commit da8d64bCopy full SHA for da8d64b
1 file changed
onprc_ehr/resources/queries/study/pregnancyGestation.sql
@@ -26,5 +26,6 @@ INNER JOIN ehr_lookups.species p on (m.Id.DataSet.demographics.species = p.commo
26
And m.date in (select max(s.date) AS d from study.pregnancyConfirmation s where s.id = m.id)
27
And m.Id.DataSet.demographics.calculated_status.code = 'Alive'
28
And p.Gestation is not null
29
-And m.outcome.birthDate is null
+And m.outcome.birthDate is null And (Select count(*) from ehr.snomed_tags stg where stg.code.code = 'F-30980' And stg.id = m.id
30
+ And stg.date >= m.date ) = 0
31
And m.gestation_days is not null
0 commit comments