BMS-HOSxP Community

HOSxP => Report Exchange => ข้อความที่เริ่มโดย: namlao ที่ ตุลาคม 05, 2015, 15:53:58 PM

หัวข้อ: รายงาน color chart DM HT
เริ่มหัวข้อโดย: namlao ที่ ตุลาคม 05, 2015, 15:53:58 PM
รายงาน custom color chart DM HT ของ อ.วรเวทย์ เอี่ยมพร  รพ.บึงสามัคคี
ถ้าไม่ต้องการผล cholesterol ต้องแก้รายงานยังไงครับ
ขอบคุณครับ
หัวข้อ: Re: รายงาน color chart DM HT
เริ่มหัวข้อโดย: woravet ที่ ตุลาคม 05, 2015, 18:15:01 PM
คลิ๊กขวาที่ variable ที่ column Cholesterol เลือก visible
หรือ ลบ variable นั้นออกไปเลย
*****
ไม่ต้องการผล อย่างไงคับ
หัวข้อ: Re: รายงาน color chart DM HT
เริ่มหัวข้อโดย: namlao ที่ ตุลาคม 06, 2015, 08:51:03 AM
ไม่ต้องการให้นำมาคำนวณครับ
หัวข้อ: Re: รายงาน color chart DM HT
เริ่มหัวข้อโดย: namlao ที่ ตุลาคม 08, 2015, 15:33:23 PM
SELECT
v.vn,
v.hn,
concat(pt.pname,pt.fname," ",pt.lname) AS ptname,v.vstdate,group_concat(distinct odx.icd10) AS icd10,
if(v.sex=1,"ชาย","หญิง") AS sex,
thaiage(pt.birthday,v.vstdate) AS age,
concat(floor(s.bps),"/",floor(s.bpd)) AS bp,
if(s.tc>0,"Y","N") AS has,
s.tc,
if(s.smoking_type_id>1,"Y","N") AS smoke,
if(cm.hn is null,"N","Y") AS chronic,
group_concat(distinct if(cm.clinic=001,"DM",if(cm.clinic=002,"HT",null)) order by cm.clinic) AS NCD,
(select color from colorchart where has=if(s.tc>0,"Y","N")
  and chronic=if(cm.hn is not null,"Y","N")
  and sex=v.sex
  and age=if(v.age_y>=70,70,if(v.age_y>=60,60,if(v.age_y>=50,50,40)))
  and smoke=if(s.smoking_type_id in ('1','3','4'),"N","Y")
  and bp=if(s.bps>=180,180,if(s.bps>=160,160,if(s.bps>=140,140,120)))
  and cholesterol=if(s.tc>=320,320,if(s.tc>=280,280,if(s.tc>=240,240,if(s.tc>=200,200,160)))) limit 1) AS color,
  cm.clinic_member_status_id
  from vn_stat v
  left join patient pt on pt.hn=v.hn
  left join opdscreen s on s.vn=v.vn
  left join clinicmember cm on v.hn=cm.hn and cm.clinic in (001,002)
  left join ovstdiag odx on v.vn=odx.vn
  where v.vstdate between "2015-10-01" and "2015-10-02'"
  and (odx.icd10 between "E10" and "E1499" or odx.icd10 between "I10" and "I1599")
group by v.vn

คือไม่ต้องการให้นำ โคเลสเตอรอลมาคำนวณด้วยนะครับ ต้องแก้คิวรี่ในส่วนไหนบ้างครับ พอดีลองแล้วทำไม่ได้ครับ
หรือพี่ๆมีรายงาน cvd ที่ไม่เอา โคเลสเตอรอล มาคำนวณด้วย ช่วยลงให้หน่อยนะครับ ขอบคุณครับ
หัวข้อ: Re: รายงาน color chart DM HT
เริ่มหัวข้อโดย: woravet ที่ ตุลาคม 09, 2015, 10:19:53 AM
color chart ไม่เอาผล cholesterol มาคำนวณ ทำไมเหรอ?
ให้คำนวณจากรูป chart ข้างล่าง
โดยไมมีผล cholesterol เหรอ
*****
ตรงแถบสีแดง เปลี่ยนเป็น has="N"