select count(*) from ( select * from (select id_patient as id from tracking_infant where eid_pcr_program=1 ) a union select id_patient as id from testing_specimen union select id_patient as id from testing_result union select id_patient as id from testing_mereenfant ) r where id not in (select id from patient where linked_to_id_patient!=0)
Comments