Why?:
Every new patient added, by no matter user, must be owned or, at least, co-owned by Admin.
Check:
select ui.internal_id
from public.users_individuals ui
where ui."user" <> 'Admin'
except
select ui.internal_id
from public.users_individuals ui
where ui."user" = 'Admin' ;
Solution:
insert into public.users_individuals ("user", internal_id)
select 'Admin', phenopolis_id from (
select i.phenopolis_id from phenopolis.individual i
except
select ui.internal_id from public.users_individuals ui
) as foo
;
Fix applied for Dev_DB on 02/Apr/21, 120 rows added. Despite it was caused by an issue in the backend api creating patients during tests, there are 9 latent cases in Prod_DB to be fixed.
Why?: Every new patient added, by no matter user, must be owned or, at least, co-owned by
Admin
.Check:
Solution: