การดึงผล LAB ออกมาแสดงในรายงาน DHDC2 ในส่วนของ Electronic Health Record (EHR)
ขอขอบคุณเจ้าของผลงาน HDHC2 ครับ
District Health Data Checker, Web:20170101.27.1 , Db:2017.01.27
พัฒนาโดย :UTEHN PHNU
SELECT l.labtest,if(l.labtest =’0531002′ or l.labtest =’01’ ,’01 ตรวจน้ำตาลในเลือด จากเส้นเลือดดำ หลังอดอาหาร’,
if(l.labtest=’0531004′ or l.labtest =’02’,’02 ตรวจน้ำตาลในเลือด จากเส้นเลือดดำ โดยไม่อดอาหาร’,
if(l.labtest=’0531101′ or l.labtest =’03’,’03 ตรวจน้ำตาลในเลือด จากเส้นเลือดฝอย หลังอดอาหาร’,
if(l.labtest=’0531102′ or l.labtest =’04’,’04 ตรวจน้ำตาลในเลือด จากเส้นเลือดฝอย โดยไม่อดอาหาร’,
if(l.labtest=’0531601′ or l.labtest =’05’,’05 ตรวจ HbA1C’,
if(l.labtest=’0546602′ or l.labtest =’06’,’06 ตรวจ Trglyceride’,
if(l.labtest=’0541601′ or l.labtest =’07’,’07 ตรวจ Total Cholesterol’,
if(l.labtest=’0541202′ or l.labtest =’08’,’08 ตรวจ HDL Cholesterol’,
if(l.labtest=’0541402′ or l.labtest =’09’,’09 ตรวจ LDL Cholesterol’,
if(l.labtest=’0583001′ or l.labtest =’10’,’10 ตรวจ BUN ในเลือด’,
if(l.labtest=’0581902′ or l.labtest =’11’,’11 ตรวจ Creatinine ในเลือด’,
if(l.labtest=’0581902′ or l.labtest =’12’,’12 ตรวจโปรตีน Microalbumin ในปัสสาวะ’,
if(l.labtest=’0581903′ or l.labtest =’13’,’13 ตรวจ CREATININE ในปัสสาวะ’,
if(l.labtest=’0446203′ or l.labtest =’14’,’14 ตรวจโปรตีน Macroalbumin ในปัสสาวะ’,
if(l.labtest=’0581904′ or l.labtest =’15’,’15 ตรวจ eGFR สูตร CKD-EPI’,
if(l.labtest=’0621401′ or l.labtest =’16’,’16 ตรวจ Hb’,
if(l.labtest=’0440205′ or l.labtest =’17’,’17 ตรวจ UPCR’,
if(l.labtest=’0511402′ or l.labtest =’18’,’18 ตรวจ K ckd stage 3 หรือยา ACEI//ARBs’,
if(l.labtest=’0510402′ or l.labtest =’19’,’19 ตรวจ Bicarb ckd stage 3′,
if(l.labtest=’0511202′ or l.labtest =’20’,’20 ตรวจ phosphate ckd stage 3′,
if(l.labtest=’0614402′ or l.labtest =’21’,’21 ตรวจ PTH ckd stage 3′,
Null))))))))))))))))))))) AS tlname,labresult
FROM tmp_labfu l
LEFT JOIN clabtest t ON t.id_labtest = l.labtest
WHERE cid =’$cid’
AND seq=’$seq’ AND hospcode = ‘$hospcode’
ติดตั้ง Yii 2
yii 2+ windows 10 64 bit + appserv24+
1. Download Yii 2 คลิ๊ก
2. แตกไฟล์ ไว้ที่ C:\Appserv\www\ folder แก้ชื่อเป็น yii
3. เข้า command ไปที่ Run พิมพ์ CMD
3. พิมพ์ cd c:\AppServ\www\yii
4. พิมพ์ c:\AppServ\www\yii\framework\yiic.bat webapp c:\AppServ\www\yii\newyii
5. ตอบ yes
6. เข้าไปตั้งค่า timezone โดยการเพิ่ม Script ในส่วน head <?php date_default_timezone_set(‘Asia/Bangkok’); ?> ใน ไฟล์ C:\AppServ\www\yii\newyii\protected\views\layouts\main.php กับ C:\AppServ\www\yii\newyii\protected\config\main.php
thai referout
SELECT r1.station_id,s1.station_name,count(*)as ‘ราย’
FROM referout r1
left join station s1 on s1.station_id=r1.station_id
group by r1.station_id
SELECT r1.user_save,count(*)as ‘ราย’
FROM referout r1
left join station s1 on s1.station_id=r1.station_id
group by r1.user_save
my.ini conifg
[mysqld]
skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
# Try number of CPU’s*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=64M
log-bin
server-id=1
[safe_mysqld]
err-log=/var/log/mysqld.log
open_files_limit=8192
[mysqldump]
quick
max_allowed_packet=16M
[mysql]
no-auto-rehash
#safe-updates
[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M
[mysqlhotcopy]
interactive-timeout
ที่มา : http://www.idatabase.in.th/2008/11/23/optimize-mysql
สรุปข้อมูลการบริการแยกรายแผนก เช้า – บ่าย – ดึก – รวม คำนวณตามวันรับบริการ
select o.send_to_depcode as ‘รหัสหน่วยงาน’,k.department as ‘หน่วยงาน’,
count(case when ov.vsttime between ’08:00′ and ’16:00′ then 1 end )as ‘เวรเช้า’,
count(case when ov.vsttime between ’08:00′ and ’16:00′ then 1 end )/
count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate)))) as ‘เฉลี่ยเช้า’,
sum(case when ov.vsttime between ’08:00′ and ’16:00′ then round(v.income,2) end)as ‘ค่าใช้จ่ายเช้า’,
count(case when ov.vsttime between ’16:01′ and ’23:59′ then 1 end)as ‘เวรบ่าย’,
count(case when ov.vsttime between ’16:01′ and ’23:59′ then 1 end)/
count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate)))) as ‘เฉลี่ยเวรบ่าย’,
sum(case when ov.vsttime between ’16:01′ and ’23:59′ then round(v.income,2) end)as ‘ค่าใช้จ่ายบ่าย’,
count(case when ov.vsttime between ’00:01′ and ’08:00′ then 1 end)as ‘เวรดึก’,
count(case when ov.vsttime between ’00:01′ and ’08:00′ then 1 end)/
count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate)))) as ‘เฉลี่ยดึก’,
sum(case when ov.vsttime between ’00:01′ and ’08:00′ then round(v.income,2) else 0 end)as ‘ค่าใช้จ่ายดึก’,
count(*) as ‘รวมครั้งทั้งหมด’,
count(*)/count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))as ‘เฉลี่ยทั้งหมด’,
sum(round(v.income,2))as ‘ค่าใช้จ่ายรวม’,
(case when o.send_to_depcode=001 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=002 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=003 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=005 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=010 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=011 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=017 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=026 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=028 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=029 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=031 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=034 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=035 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=041 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=042 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=043 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=044 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=045 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=049 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=054 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=051 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=052 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=056 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
when o.send_to_depcode=077 then count(distinct(concat(day(v.vstdate),month(v.vstdate),year(v.vstdate))))
end)as ‘วัน/เดือน’
from opd_regist_sendlist o
left join vn_stat v on v.vn=o.vn
left join ovst ov on ov.vn=v.vn
left join kskdepartment k on k.depcode=o.send_to_depcode
where (v.vstdate between ‘2015-11-01 00:00:00’ and ‘2015-11-31 23:59:59’)
and o.send_to_depcode not in (‘009′,’007′,’012′,’037′,’038′,’025′,’061′,’064′,’013′,’014′,’015′,’016′,’019′,’020′,’021′,’027′,’030′,’032′,’036′,’046′,’047′,’039’,
‘048’,’050′,’055′,’063′,’999′,’066′,’008′)
group by o.send_to_depcode
order by o.send_to_depcode
แก้ปริ้นห้องยา ใบสั่งยาค้าง จากห้องตรวจ 2 ปรับ N ให้เป็น Y
select * from printserver_document where print_from_computer =’DR002′ and print_ok=’N’
ตั้งค่า hosxp ปีใหม่ (i_refer_number+o_refer_number)
select * from serial
where name like “HN”
or name like “AN”
or name like “%refer_num%”
or name like “%xn-%”
or name like “%dn-%”
order by serial.name
/* refer in-out Reset นับใหม่ทุกปี */
ความเห็นล่าสุด