BMS-HOSxP Community
HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: pongnk213 ที่ มีนาคม 05, 2012, 07:46:01 AM
-
รบกวนช่วยดูรายงานให้ด้วยนะครับ ลองมาหลายวัน ยังไม่ได้ครับ
ผลใช้คำสั่งนี้แล้วข้อมูลออกมาไม่ได้แยกออกเป็นรายหมู่บ้าน
ผมต้องการให้ผลการคัดกรองจากกลุ่มเป้าหมายออกเป็นรายหมู่ครับ
เป็นรายงานคัดกรองภาวะซึมเศร้าในโรคเรื้อรัง แยกรายหมู่บ้าน ที่คัดกรองหน้า one stop service hosxp_pcu
ขอบคุณครับ
Value := GetSQLintegerData('select count(distinct ds.vn)'+
' from person p,house h,village v,depression_screen ds,vn_stat vn ,person_chronic pc '+
' where p.house_id=h.house_id '+
' and h.village_id = v.village_id '+
' and vn.vn=ds.vn '+
' and pc.person_id=p.person_id '+
' and p.death = "N" '+
' and p.house_regist_type_id in ("1","3")' +
' and p.person_discharge_id ="9" '+
' and vn.vstdate between "'+ds1+'" and "'+ds2+'" '+
'and ds.depression_score < 100 '+
' and pc.clinic in("001","005","015" ,"017","018","019") '+
' and v.village_id = ' + DBPipeline['village_id'] );
-
ลองดูครับว่าใช้ได้ไหม ;)
ปล.ยังไม่ได้แก้ส่วนอื่นให้ ต้องแก้ต่อเอง ถ้ารายงานเสร็จแล้วอย่าลืม post แจกด้วยนะครับ
-
ขอบคุณครับ
ลองดูแล้วตัวเลขมันออกมาแปลกๆครับ มันน้อยเกินไปทั้งๆที่คีย์ไปเยอะแล้ว
แต่พอเอา ' and pc.clinic in("001","005","015" ,"017","018","019") '+ออก ข้อมูลบางหมู่เกิน 100%
Value := GetSQLintegerData('select count(distinct pd.hn) '+
' from person p '+
'left outer join house h on h.house_id=p.house_id '+
'left outer join village v on v.village_id =h.village_id '+
'left outer join patient_depression pd on pd.hn=p.patient_hn '+
'left outer join depression_screen ds on ds.patient_depression_id =pd.patient_depression_id '+
'left outer join person_chronic pc on pc.person_id=p.person_id '+
' where p.person_discharge_id ="9" '+
' and p.house_regist_type_id in ("1","3")' +
' and ds.screen_datetime between "'+ds1+'" and "'+ds2+'" '+
' and pc.clinic in("001","005","015" ,"017","018","019") '+
' and v.village_id ="'+DBPipeline['village_id']+'" ');