Advertisement
jeniferfleurant

mother and child with pcr

Sep 14th, 2018
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.73 KB | None | 0 0
  1. SELECT patient.patient_code as mother_code, ddr, dpa, positive_child, children_eid_result, office FROM
  2. tracking_motherbasicinfo
  3. left join caris_db.view_eid_snapshot_linked_children_grouped_by_mother on view_eid_snapshot_linked_children_grouped_by_mother.id_patient_mother = tracking_motherbasicinfo.id_patient
  4. left join patient on tracking_motherbasicinfo.id_patient = patient.id
  5. left join tracking_pregnancy on tracking_pregnancy.id_patient_mother = view_eid_snapshot_linked_children_grouped_by_mother.id_patient_mother
  6. left join lookup_hospital on concat(lookup_hospital.city_code,'/',lookup_hospital.hospital_code) = left(patient_code,8)
  7. where view_eid_snapshot_linked_children_grouped_by_mother.id_patient_mother!=0
  8. and dpa>='2017-08-01';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement