select h.hoscode hospcode,cast(h.hosname as char(200)) hospname,count(*) target,sum(result="Y") result,sum(result="Y")/count(*)*100 percent from chospital_amp h left join ( select p.hospcode,p.cid,p.hn,p.pid,concat(p.name," ",p.lname) ptname ,cc.instype_new ,group_concat(distinct if(c.chronic between "E10" and "E1499",c.chronic,null) order by c.chronic) chronic ,group_concat(distinct if(b.diagcode regexp "E100|E101|E110|E111|E120|E121|E130|E131|E140|E141",b.diagcode,null) order by b.diagcode) admit ,group_concat(distinct if(b.diagcode regexp "E100|E101|E110|E111|E120|E121|E130|E131|E140|E141","Y",null)) result from person p join card cc on cc.pid=p.pid and cc.hospcode=p.hospcode left join chronic c on c.pid=p.pid and c.hospcode=p.hospcode left join admission a on a.pid=p.pid and a.hospcode=p.hospcode and date(a.datetime_disch) between "2015-04-01" and "2016-03-31" left join diagnosis_ipd b on a.an=b.an and a.hospcode=b.hospcode and b.diagtype=1 where cc.instype_new=0100 and p.typearea in (1,3) and p.discharge = "9" and c.chronic between "E10" and "E1499" group by p.hospcode,p.pid ) a on a.hospcode=h.hoscode group by a.hospcode union select "ภาพรวมทั้งคัพ" as hoscode,"" as hosname,count(*) target,sum(result="Y") result,sum(result="Y")/count(*)*100 percent from chospital_amp h left join ( select p.hospcode,p.cid,p.hn,p.pid,concat(p.name," ",p.lname) ptname ,cc.instype_new ,group_concat(distinct if(c.chronic between "E10" and "E1499",c.chronic,null) order by c.chronic) chronic ,group_concat(distinct if(b.diagcode regexp "E100|E101|E110|E111|E120|E121|E130|E131|E140|E141",b.diagcode,null) order by b.diagcode) admit ,group_concat(distinct if(b.diagcode regexp "E100|E101|E110|E111|E120|E121|E130|E131|E140|E141","Y",null)) result from person p join card cc on cc.pid=p.pid and cc.hospcode=p.hospcode left join chronic c on c.pid=p.pid and c.hospcode=p.hospcode left join admission a on a.pid=p.pid and a.hospcode=p.hospcode and date(a.datetime_disch) between "2015-04-01" and "2016-03-31" left join diagnosis_ipd b on a.an=b.an and a.hospcode=b.hospcode and b.diagtype=1 where cc.instype_new=0100 and p.typearea in (1,3) and p.discharge = "9" and c.chronic between "E10" and "E1499" group by p.hospcode,p.pid ) a on a.hospcode=h.hoscode
แสดง 21 ถึง 25 จาก 25 ผลลัพธ์

อัตราการรับไว้รักษาในโรงพยาบาล (ADMISSION RATE) ด้วยโรคเบาหวานที่มีภาวะแทรกซ้อนเฉียบพลัน ปีงบประมาณ 2559

#HOSPCODEสถานบริการ TargetResultPercent
2107731รพ.สต.โป่งหว้า ตำบลห้วยใหญ่282--
2207732รพ.สต.ยางลาด ตำบลระวิง90--
2307733รพ.สต.ระวิง ตำบลระวิง128--
2410727รพ.เพชรบูรณ์1,53920.13
25ภาพรวมทั้งคัพ8,51220.02
   10,5514