
XEDSCustom สำหรับ HOSxP (621113) แก้ไข ThaiCVRisk แบบ 2
– แก้ไข query ของ ThaiCVRisk แบบที่ 2
– เพิ่มระบบบันทึกกิจกรรมหอผู้ป่วยใน ( เก็บฐาน image & Log )
– กรณีใช้ การแสดง CVD Risk ตอนเปิด @แบบที่ 2 นะครับ มีสมาชิกแจ้งเข้ามาครับ ก็ปรับตามความเหมาะสมนะครับ
–
– ปรับตามโค้ด sql นี้นะครับ
********
SELECT GROUP_CONCAT(vstdate,”=”,if(ThaiCVRiskCal(age,sex,dm,smoking,bps,tc,hdl,ldl,waist,height)<>””
,ThaiCVRiskCal(age,sex,dm,smoking,bps,tc,hdl,ldl,waist,height),””),” # ”
,if(ThaiCVRiskCal(age,sex,dm,smoking,bps,tc,hdl,ldl,waist,height)<20,”เหลือง”,
if(ThaiCVRiskCal(age,sex,dm,smoking,bps,tc,hdl,ldl,waist,height)<30,”ส้ม”,
if(ThaiCVRiskCal(age,sex,dm,smoking,bps,tc,hdl,ldl,waist,height)<40,”แดง”,
if(ThaiCVRiskCal(age,sex,dm,smoking,bps,tc,hdl,ldl,waist,height)>=40,”แดงเข้ม”,”เขียว” ))))) t
FROM(SELECT v.vn,v.hn,v.vstdate, timestampdiff(YEAR,p.birthday,v.vstdate) age
,if(timestampdiff(day,dm,v.vstdate)>0 ,1,0)dm ,if(p.sex=2,0,1) as sex,waist,o.height
,o.bps,tc,hdl,ldl,if(o.smoking_type_id=”1″,0,1)smoking
FROM vn_stat v
LEFT JOIN patient p on v.hn=p.hn
LEFT JOIN (SELECT * from opdscreen o where (waist<>’0′ and height <>’0′ and bps<>’0′ )
and o.bps is not null and (( waist is not null and o.height is not null) or tc is not null ))o on v.vn=o.vn
left JOIN
(SELECT odx.hn,min(vstdate) as dm FROM ovstdiag odx
where odx.icd10 between “E10” and “E1499″ GROUP BY hn) dm on p.hn=dm.hn
WHERE v.hn=”00016597″ and o.vn<>” GROUP BY v.vn ORDER BY vn DESC LIMIT 5) as cc
********
– อีกอันเป็นการเพิ่มหน้าจอสำหรับคีย์ กิจกรรมของหอผู้ป่วยใน (กรณีใช้ที่ด่านซ้าย แห่งไหนสนใจก็สามารถนำไปใช้งานได้ แต่เก็บที่ฐาน image&log นะครับ ดังนั้นท่านต้องไปสร้างตารางนี้ก่อนที่ฐาน imageserver นั้นเอง แนะนำนะครับ
–
– สามารถกำหนดรายการ กิจกรรมได้ แยกตาม หอผู้ป่วยใน
–
สร้างตารางนี้ก่อนนะครับ 2 ตาราง
—————–
CREATE TABLE `ipt_oper_order_ds` (
`ipt_oper_order_id` int(10) DEFAULT NULL,
`ipt_oper_head_id` int(10) DEFAULT NULL,
`ipt_oper_code` int(10) DEFAULT NULL,
`ipt_oper_date` date DEFAULT NULL,
`ward` varchar(2) DEFAULT NULL,
`ipt_oper_name` varchar(50) DEFAULT NULL,
`count_1` int(9) DEFAULT NULL,
`count_2` int(9) DEFAULT NULL,
`count_3` int(9) DEFAULT NULL,
`total` int(3) DEFAULT NULL,
`last_modify` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=tis620
—————–
CREATE TABLE `ipt_oper_head_ds` (
`ipt_oper_head_id` int(11) NOT NULL DEFAULT ‘0’,
`ward` int(11) DEFAULT NULL,
`ipt_oper_head_date` date DEFAULT NULL,
`ipt_oper_head_detail` text,
`hos_guid` varchar(38) DEFAULT NULL,
`totol_1` varchar(11) DEFAULT NULL,
`totol_2` varchar(11) DEFAULT NULL,
`totol_3` varchar(11) DEFAULT NULL,
PRIMARY KEY (`ipt_oper_head_id`)
) ENGINE=InnoDB DEFAULT CHARSET=tis620
ดาวโหลด XEDSCustom_for_HOSxP_update_621114
***
XEDSCustom_for_HOSxP_update_621114 (82 downloads )
***
– ติดปัญหาอะไรก็แจ้งมาได้ครับ
– แล้วพบกันใหม่ครับ