-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathdata.txt
93 lines (74 loc) · 3.28 KB
/
data.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
composer global require "fxp/composer-asset-plugin:1.0.0"
composer create-project yiisoft/yii2-app-basic yii2-basic-moph
composer self-update
composer update
composer require kartik-v/yii2-krajee-base "dev-master"
composer require kartik-v/yii2-grid "*"
composer require kartik-v/yii2-mpdf "*"
composer require kartik-v/yii2-export "*"
composer require kartik-v/yii2-widgets "*"
composer require "2amigos/yii2-google-maps-library" "*"
composer require --prefer-dist miloschuman/yii2-highcharts-widget "dev-master"
#Yii2 User
https://github.com/dektrium/yii2-user
http://yii2-user.readthedocs.org/en/latest/getting-started/installation.html
https://github.com/amnah/yii2-user
#Yii2 Admin
https://github.com/mdmsoft/yii2-admin
#Theme
https://bitbucket.org/kongoon/yii2-theme-material
https://bitbucket.org/kongoon/yii2-theme-superhero
https://bitbucket.org/kongoon/yii2-theme-simplex
https://bitbucket.org/kongoon/yii2-theme-flaty
https://bitbucket.org/kongoon/yii2-theme-flat
https://github.com/miloschuman/yii2-highcharts
Query 2
SELECT year(t.DATETIME_DISCH) as yy,
month(t.DATETIME_DISCH) as mm,
count(t.AN) as cnt,
sum(t.ADJRW) as sumadj,
avg(t.ADJRW) as cmi ,
sum(t.ACTLOS) as los,
avg(t.ACTLOS) as los_per_case
FROM admission t
GROUP BY yy,mm
Yii2 Grid Export
https://github.com/dimpled/Yii2-Learning/blob/master/widgets/install-krajee-yii2-grid.md
###Query Report 3 สรุปการรักษาพยาบาลผู้ป่วยอยู่รักษาแยกรายเดือน ไม่รวม RW=0
SELECT year(t.DATETIME_DISCH) as yy,
month(t.DATETIME_DISCH) as mm,
count(t.AN) as cnt,
sum(t.ADJRW) as sumadj,
sum(t.ADJRW)/sum(if(ADJRW>0,1,0)) as cmi ,
sum(t.ACTLOS) as los,
avg(t.ACTLOS) as los_per_case
FROM admission t
GROUP BY yy,mm
##Query Report4
สรุปรายโรคผู้ป่วยใน (เฉพาะโรคแรก)
**** Top 10 โรคผู้ป่วยใน
รหัสโรค,ชื่อโรค,ชื่อโรค(ไทย),จำนวน,รวม AdjRW,เฉลี่ย AdjRW
SELECT t.DIAGCODE, i.diagename, i.diagtname, count(t.AN) as cnt
, sum(a.ADJRW) as sumadj, avg(a.ADJRW) as cmi
FROM diagnosis_ipd t join cicd10tm i on t.DIAGCODE = i.diagcode
join admission a on t.AN = a.AN
WHERE t.DIAGTYPE = 1
GROUP BY t.DIAGCODE
ORDER BY cnt desc
(กราฟแท่ง1 x=diagcode, y=cnt ให้แสดงแค่ 10 รายการแรก)
(กราฟแท่ง2 x=diagcode, y=sumadj ให้แสดงแค่ 10 รายการแรก)
##Query Report5
สรุปตามกลุ่ม DRG
select t.DRG, c.drgname, count(t.AN) as cnt, sum(t.ADJRW) as sumadj, avg(t.ADJRW) as cmi
from admission t join ccmi51drg c on t.DRG = c.drg
group by t.DRG
##Query Report6
สรุปตามกลุ่ม MDC
select c.mdc, c.drgname, count(t.AN) as cnt, sum(t.ADJRW) as sumadj, avg(t.ADJRW) as cmi
, count(if(substring(t.DRG,3,2)<50,t.an,null)) as orcnt
, sum(if(substring(t.DRG,3,2)<50,t.ADJRW,0))/count(if(substring(t.DRG,3,2)<50,t.an,null)) as orcmi
, count(if(substring(t.DRG,3,2)>49,t.an,null)) as norcnt
, sum(if(substring(t.DRG,3,2)>49,t.ADJRW,0))/count(if(substring(t.DRG,3,2)>49,t.an,null)) as norcmi
from admission t right join ccmimdc c on left(t.DRG,2) = c.mdc
where c.mdc between 1 and 25
group by c.mdc