ผู้เขียน หัวข้อ: 7.ร้อยละของหญิงตั้งครรภ์ได้รับการฝากครรภ์ครบ 5 ครั้งตามเกณฑ์  (อ่าน 6479 ครั้ง)

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

ออฟไลน์ manoi

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

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

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_service where
person_anc_service.person_anc_id = p1.person_anc_id and
person_anc_service.anc_service_number = 1 and person_anc_service.pa_week <= 12)

and p1.person_anc_id in (select person_anc_id from person_anc_service where
person_anc_service.person_anc_id = p1.person_anc_id and
person_anc_service.anc_service_number = 2 and person_anc_service.pa_week between 16 and 20)

and p1.person_anc_id in (select person_anc_id from person_anc_service where
person_anc_service.person_anc_id = p1.person_anc_id and
person_anc_service.anc_service_number = 3 and person_anc_service.pa_week between 24 and 28)

and p1.person_anc_id in (select person_anc_id from person_anc_service where
person_anc_service.person_anc_id = p1.person_anc_id and
person_anc_service.anc_service_number = 4 and person_anc_service.pa_week between 30 and 34)


and p1.person_anc_id in (select person_anc_id from person_anc_service where
person_anc_service.person_anc_id = p1.person_anc_id and
person_anc_service.anc_service_number = 5 and person_anc_service.pa_week between 36 and 40)

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


ข้อมูล B จำนวนหญิงคลอดในรอบ 6 เดือน หรือ 12 เดือน (กำหนดโดยใช้วันที่คลอด labor_date นะครับ และกำหนด labor_hospcode = รหัส 5 หลักของหน่วยบริการตัวเองครับ)

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:00:31 PM โดย manoi »
HOSxP Project Manager / Cheif Developer / BMS MD