jeniferfleurant

# Enfants PCR positifs, abandonné, pas sur ARV

Sep 5th, 2016
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.77 KB | None | 0 0
  1. select count(*) from (
  2. select * from (select id_patient as id from tracking_infant where  eid_pcr_program=1 and (positive_pcr_1!='0000-00-00' or positive_pcr_2!='0000-00-00'
  3. or comments like '%Added via bulk upload%'
  4. )
  5. ) a
  6. union  
  7. select id_patient as id from testing_specimen where pcr_result=1
  8. union  select id_patient as id from testing_result where result=1
  9.   ) r
  10. where id not in (select id from patient where linked_to_id_patient!=0)
  11. #patient positive abandoned
  12. and id in (select id_patient from tracking_infant where is_abandoned=1 and is_dead!=1)
  13.  
  14. # on arv
  15. and id not in (select id_patient from tracking_regime where id_arv!=0
  16.  UNION select * from (select id_patient from tracking_followup where on_arv=1) f)
  17.  and id in (select id_patient from tracking_infant)
Advertisement
Add Comment
Please, Sign In to add comment