ผู้เขียน หัวข้อ: 9. ร้อยละของหญิงหลังคลอดได้รับการดูแลครบ 3 ครั้งตามเกณฑ์  (อ่าน 5532 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ manoi

  • Hero Member
  • *****
  • กระทู้: 8,669
  • Respect: +170
    • ดูรายละเอียด
    • HOSxP Community Center
ที่มา บัญชี 2

ข้อมูล A จำนวนมารดาหลังคลอดได้รับการดูแลครบ 3 ครั้งตามเกณฑ์ ในเวลาที่กำหนด


select count(distinct p1.person_anc_id) from person_anc p1,person p2
where p1.person_id = p2.person_id

and p1.person_anc_id in (select person_anc_id from person_anc_preg_care where
person_anc_preg_care.person_anc_id = p1.person_anc_id and
person_anc_preg_care.preg_care_number = 1 and datediff(person_anc_preg_care.care_date,p1.labor_date) <= 7)

and p1.person_anc_id in (select person_anc_id from person_anc_preg_care where
person_anc_preg_care.person_anc_id = p1.person_anc_id and
person_anc_preg_care.preg_care_number = 2 and datediff(person_anc_preg_care.care_date,p1.labor_date) between 8 and 15 )

and p1.person_anc_id in (select person_anc_id from person_anc_preg_care where
person_anc_preg_care.person_anc_id = p1.person_anc_id and
person_anc_preg_care.preg_care_number = 3 and datediff(person_anc_preg_care.care_date,p1.labor_date) between 16 and 42 )

and p1.labor_date between 'yyyy-mm-dd1' and 'yyyy-mm-dd2'
and p1.labor_hospcode = 'xxxxx'


ข้อมูล B จำนวนมารดาที่คลอดในช่วงเวลาเดียวกัน


select count(distinct p1.person_anc_id) from person_anc p1,person p2
where p1.person_id = p2.person_id

and p1.labor_date between 'yyyy-mm-dd1' and 'yyyy-mm-dd2'
and p1.labor_hospcode = 'xxxxx'


« แก้ไขครั้งสุดท้าย: เมษายน 02, 2013, 15:25:39 PM โดย manoi »
HOSxP Project Manager / Cheif Developer / BMS MD