เมษายน 2024
จ. อ. พ. พฤ. ศ. ส. อา.
« มี.ค.    
1234567
891011121314
15161718192021
22232425262728
2930  
เมษายน 2024
จ. อ. พ. พฤ. ศ. ส. อา.
« มี.ค.    
1234567
891011121314
15161718192021
22232425262728
2930  

Visit ผู้มารับบริการ แยก วันหยุด+เสาร์+อาทิตย์ และแยกนอกในเวลาราชการ

select o.vstdate as DT,
sum(if(weekday(o.vstdate)in(“0″,”1″,”2″,”3″,”4”) and h.holiday_date is null and o.vsttime BETWEEN ’08:00:00′ and ’16:00:00′,’1′,null))as visitIntime,

sum(if((weekday(o.vstdate)in(“5″,”6”)or h.holiday_date is not null)
or (weekday(o.vstdate) in(“0″,”1″,”2″,”3″,”4”) or h.holiday_date is null) and (o.vsttime not BETWEEN ’08:00:00′ and ’16:00:00′)
,’1′,null))as visitOuttime,

count(DISTINCT if(weekday(o.vstdate)in(“0″,”1″,”2″,”3″,”4”)and h.holiday_date is null and o.vsttime BETWEEN ’08:00:00′ and ’16:00:00′,o.hn,null))as HNIntime,

count(distinct if((weekday(o.vstdate)in(“5″,”6”) or h.holiday_date is not null)
or (weekday(o.vstdate) in(“0″,”1″,”2″,”3″,”4”) or h.holiday_date is null) and (o.vsttime not BETWEEN ’08:00:00′ and ’16:00:00′)
,o.hn,null))as HNOuttime,

case
when WEEKDAY(o.vstdate)=0 then “จันทร์”
when WEEKDAY(o.vstdate)=1 then “อังคาร”
when WEEKDAY(o.vstdate)=2 then “พุธ”
when WEEKDAY(o.vstdate)=3 then “พฤหัส”
when WEEKDAY(o.vstdate)=4 then “ศุกร์”
when WEEKDAY(o.vstdate)=5 then “เสาร์”
when WEEKDAY(o.vstdate)=6 then “อาทิตย์”
end as KDATE,h.day_name as Holiday
from ovst o
left outer join (select vn from opd_regist_sendlist group by vn)as r on r.vn=o.vn
left outer join holiday h on h.holiday_date=o.vstdate
where o.vstdate between ‘2019-01-01’ and ‘2019-04-31’ and r.vn is not null
group by o.vstdate

ผูกผล LAB ปรับปรุง LABFU ในการส่งออก 43 แฟ้ม กรณีผล LABRESULT ไม่ออก

/*
update
lab_items_exp_map_list
set export_value=report_result
where report_result between ‘1’ and ‘9999999’
*/

/*
select * from lab_items_exp_map_list where report_result between ‘1’ and ‘9999999’
*/

/*
update
lab_items_exp_map_list
set export_value=report_result
where report_result not between ‘1’ and ‘9999999’

navicat นำเข้าไฟล์ txt


ลักษณะไฟล์ txt  ไม่มีหัวฟิลล์
“xx”,”xx”,”xx”,”xx”
“xx”,”xx”,”xx”,”xx”

การเงินยกเลิกใบเสร็จ และจะลงรับใหม่ ยอดเงินหาย ให้ไปเคลียร์ ฟิลล์ finance_number ใน ตาราง opitemrece

การเงินยอดค้างชำระไม่ตรง และมีการแบ่งจ่ายบางส่วน

การดึงผล 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’

ปรับยอดเงินในใบเสร็จรับเงินที่เป็นภาษาไทยให้ออก สตางค์ไม่มีคำว่าบาทลงท้าย

if getsqlintegerdata(‘select if(name3 like “%ʵҧ¤ì%”,”03″,null) ‘+
‘as cc from tempreport where name3 like “%ʵҧ¤ì%” and id=”‘+DBPipeline[‘id’]+'” ‘)=03 then
Value := thaimoney(DBPipeline[‘mon3’])
else
Value := ‘ ‘+ thaimoney(DBPipeline[‘mon3′])+’¶éǹ’ ;

เครดิต http://61.19.251.235/smf2/index.php?topic=21443.0

—————————————————————-
“Variable6”
Value := GetSQLStringData(‘select sum(sum_price)as bb from opitemrece where vn=”‘+ DBPipeline[‘an’] +'”‘);
—————————————————————-
“Variable10”
if getsqlintegerdata(‘select if( sum(sum_price) like “%.25%” ‘+
‘ or sum(sum_price) like “%.50%” ‘+
‘ or sum(sum_price) like “%.75%” ,1,0) as dd from opitemrece ‘+
‘ where an=”‘+DBPipeline[‘an’] +'” ‘)=1 then
Value := ‘ตัวอักษร (‘+ thaimoney(variable6.value)+’)’
else
Value := ‘ตัวอักษร (‘+ thaimoney(Variable6.value)+’ถ้วน)’ ;
—————————————————————–

การยกเลิก ลูกหนี้ค้างชำระ

หลังจากลงค้างชำระผิดให้ยกเลิกค้างชำระ   และสิ่งที่ต้องทำต่อไปคือ

หาคนใข้ในตาราง  vn_stat กำหนด ฟิลล์ paid_money เป็นยอดที่ต้องค้างชำระ

และหาคนไข้ในตาราง opitemrece กำหนด ฟิล paidst จาก  00 เป็น 03 หรือ 01 หรือ 02

ระบบสั่งอาหารผู้ป่วยใน

ตารางที่เกี่ยวข้อง select * from nutrition_items

ติดตั้ง 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