BMS-HOSxP Community

HOSxP => รายงานตัวชี้วัด 66 ตัวของกระทรวงสาธารณสุข => ข้อความที่เริ่มโดย: manoi ที่ เมษายน 02, 2013, 14:50:46 PM

หัวข้อ: 7.ร้อยละของหญิงตั้งครรภ์ได้รับการฝากครรภ์ครบ 5 ครั้งตามเกณฑ์
เริ่มหัวข้อโดย: manoi ที่ เมษายน 02, 2013, 14:50:46 PM
ที่มา : บัญชี 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'