You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PASS (the person with id 203 exists in the Person table)
PASS (the same person, with no death date, also exists in the Death table)
FAIL! somehow, the lookup function finds no person_id with a missing death date in the Death table, even though the previous test found it just fine.
I took a closer look at the automatically generated SQL queries, and discovered that in test case 2, death_date = NULL gets correctly translated into IS NULL;
however, in test case 3 it becomes = NULL, which fails.
Here are the test case 2 & 3 SQL queries in full:
INSERT INTO omopcdm.test_results SELECT 203 AS id, 'Missing death date' AS description, 'Expect death' AS test, CASE WHEN (SELECT COUNT(*) FROM omopcdm.death WHERE person_id = '203' AND death_date IS NULL) = 0 THEN 'FAIL' ELSE 'PASS' END AS status;
INSERT INTO omopcdm.test_results SELECT 203 AS id, 'Missing death date' AS description, 'Expect person' AS test, CASE WHEN (SELECT COUNT(*) FROM omopcdm.person WHERE person_id = (SELECT person_id FROM omopcdm.death WHERE death_date = NULL)) = 0 THEN 'FAIL' ELSE 'PASS' END AS status;
The text was updated successfully, but these errors were encountered:
Given these test cases:
expect_person(person_id = 203)
expect_death(person_id = 203, death_date = NULL)
expect_person( lookup_death('person_id', death_date = NULL) )
I get the following results:
PASS
(the person with id 203 exists in the Person table)PASS
(the same person, with no death date, also exists in the Death table)FAIL
! somehow, the lookup function finds no person_id with a missing death date in the Death table, even though the previous test found it just fine.I took a closer look at the automatically generated SQL queries, and discovered that in test case 2,
death_date = NULL
gets correctly translated intoIS NULL
;however, in test case 3 it becomes
= NULL
, which fails.Here are the test case 2 & 3 SQL queries in full:
INSERT INTO omopcdm.test_results SELECT 203 AS id, 'Missing death date' AS description, 'Expect death' AS test, CASE WHEN (SELECT COUNT(*) FROM omopcdm.death WHERE person_id = '203' AND death_date IS NULL) = 0 THEN 'FAIL' ELSE 'PASS' END AS status;
INSERT INTO omopcdm.test_results SELECT 203 AS id, 'Missing death date' AS description, 'Expect person' AS test, CASE WHEN (SELECT COUNT(*) FROM omopcdm.person WHERE person_id = (SELECT person_id FROM omopcdm.death WHERE death_date = NULL)) = 0 THEN 'FAIL' ELSE 'PASS' END AS status;
The text was updated successfully, but these errors were encountered: