แสดงกระทู้

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - woravet

หน้า: 1 ... 3 4 [5] 6 7 ... 9
201
Report Exchange / Re: ขอรายงานหน่อยครับท่าน
« เมื่อ: กันยายน 29, 2011, 15:36:12 PM »
select a.hn,p.pname,p.fname,p.lname
,a.nextdate
,c.name as clinic,k.department,a.doctor, d.name as doctorname
,concat(p.addrpart,' ม.',p.moopart,' ',t.full_name) address
from oapp a
left join patient p on a.hn=p.hn
left join clinic c on c.clinic=a.clinic
left join doctor d on d.code=a.doctor
left join kskdepartment k on k.depcode = a.depcode
left join thaiaddress t on t.addressid=concat(p.chwpart,p.amppart,p.tmbpart)
where a.nextdate between '2011-9-1' and '2011-9-30'
and (a.patient_visit<>'Y' or a.patient_visit is null)
group by a.hn,a.nextdate

202
set @n:=0;
select pcode,p.date,if(left(docno,1)='R',pvalue,0) 'R',if(left(docno,1)='E',pvalue,0) 'E'
,@n:=@n+if(left(docno,1)='R',pvalue,-pvalue) 'Total'
from stock_card
where pcode=?
order by pdate
ประมาณนี้มั๊ย

204
select r.vn,i.an,i.hn,p.pname,p.fname,p.lname,i.regdate,i.dchdate,i.dchtype,i.rw
,a.pdx,a.dx0,a.dx1,a.dx2,a.dx3,a.dx4,a.dx5
,a.op0,a.op1,a.op2,a.op3,a.op4,a.op5
,r.hospcode
from referout r
left join ipt i on r.vn=i.an
left join an_stat a on i.an=a.an
left join patient p on i.hn=p.hn
where refer_date between '2010-10-1' and '2011-9-30'
and r.department in ('IPD','LR','WARD')
and i.rw>=0 and i.rw<0.5
ประมาณนี้มั๊ย
กรุณาตรวจสอบ dchtype,rw=0,pdx

205
select i.vn,i.hn,rcpno,i.incdate
,concat(pt.pname,pt.fname," ",pt.lname) as ptname
,sum(if(paidst="00",i.rcptamt,0)) 'money0'
,sum(if(paidst="01",i.rcptamt,0)) 'money1'
,sum(if(paidst="02",i.rcptamt,0)) 'money2'
,sum(if(paidst="03",i.rcptamt,0)) 'money3'
,sum(i.rcptamt) 'total'
from incoth i
left join patient pt on pt.hn=i.hn
where i.incdate between '2011-8-1' and '2011-8-31'
group by i.vn
order by i.rcpno,i.incdate,i.hn
ประมาณนี้รึป่าว

206
ขอบคุณท่านบอยมากครับ ได้แล้วครับ  :o :o :o

207
hosxp มี bug ตัวนี้แก้ยังไงครับ UP structure ก็ไม่หายครับ V.3.54.7.20 ครับ

System Message
SQL Error: Column 'pq_doctor_id' cannot be null
select * from pq_doctor where vn='540828094744' and doctor='70'

208
select x1.film_id,x3.film_name,count(distinct x1.xn) cc,sum(x1.qty) amount
,sum(if(x1.damage_id>0,1,0)) 'lost'
from xray_report_film x1
left join xray_report x2 on x1.xn=x2.xn
left join xray_film x3 on x1.film_id=x3.film_id
where report_date between '2010-10-1' and '2011-9-30'
group by x1.film_id

209
Value := GetSQLIntegerData('select count(v.vn) as num '+
' from vn_stat v '+
' left outer join doctor d on  d.code=v.dx_doctor '+
' left outer join ovst o on o.vn=v.vn '+
' left outer join holiday h on h.holiday_date=v.vstdate '+
' left outer join patient p on p.hn=v.hn '+
' where v.vstdate between "'+GetUserParameter(0)+'" and "'+GetUserParameter(1)+'" '+
' and o.cur_dep_time between "08:00:00" and "16:00:00" '+
' and v.dx_doctor in ("139") and o.main_dep="010" '+
' and v.vstdate not in (select holiday_date from holiday) ');

ไม่ต้องใช้ฟังก์ชัน ISO2Date()

210
ประมาณนี้มั๊ย
set @mclinic:=001;
select m.*,a.*
from (select 0 as 'cormobidity','ไม่มีภาวะแทรกซ้อน' as  'name'
union select cormobidity,name from clinic_cormobidity where clinic=@mclinic) m
left join (select cormobidity
,sum(if(sex='1' and age<40,1,0)) 'Male_less_40'
,sum(if(sex='1' and age between 40 and 49,1,0)) 'Male_40'
,sum(if(sex='1' and age between 50 and 60,1,0)) 'Male_50'
,sum(if(sex='1' and age>=60,1,0)) 'Male_more_60'
,sum(if(sex='2' and age<40,1,0)) 'FeMale_less_40'
,sum(if(sex='2' and age between 40 and 49,1,0)) 'FeMale_40'
,sum(if(sex='2' and age between 50 and 60,1,0)) 'FeMale_50'
,sum(if(sex='2' and age>=60,1,0)) 'FeMale_more_60'
from (select c.hn,ifnull(cc.cormobidity,0) cormobidity
,p.sex,timestampdiff(year,p.birthday,now()) age
from clinicmember c
left join patient p on p.hn=c.hn
left join clinic_cormobidity_list cc on c.hn=cc.hn and cc.clinic=@mclinic
where c.clinic=@mclinic
order by c.hn,cormobidity) a
group by cormobidity) a on a.cormobidity=m.cormobidity
*****
แต่น่าจะไปผิดตรงผลรวม
เพราะบางครั้งมีภาวะแทรกซ้อนมากกว่า 1 อย่าง
เช่น DM แล้วแทรกซ้อน ตา กับ ไต นับกันอย่างไร
ต้องหาวิธีการนับกันก่อน

211
select i.an,i.hn,p.pname,p.fname,p.lname,i.regdate,i.regtime,i.dchdate,i.dchtime
,i.dchstts,i.dchtype,i.rfrolct,a.admdate,a.admit_hour
from ipt i
left join patient p on p.hn=i.hn
left join an_stat a on i.an=a.an
where i.dchtype=04
and a.admit_hour<24
*****
ประมาณนี้รึป่าว

212
Report Exchange / Re: รายงาน REFER
« เมื่อ: สิงหาคม 03, 2011, 15:12:31 PM »
ตรงแท๊ป อื่นๆ จะเป็นวิธีนับ

213
hn_ward เป็น ตัวแปร ไม่ใช่ฟิล์ด
น่าจะเป็น
Value :=GetPatientAddress ('"'+hn_ward+'"');
มากกว่า

214
Report Exchange / Re: สอบถามคำสั่ง SQL
« เมื่อ: กรกฎาคม 25, 2011, 15:49:43 PM »
select a.pdx,icd101.name,count(a.pdx) as count_pdx,sum(a.income) as sum_income
,avg(a.income) 'avg'
from an_stat a
left outer join icd101 icd101 on icd101.code = a.pdx
where a.admit_hour <= 4
group by a.pdx
order by sum_income desc

216
ระบบห้องจ่ายยา
........................................................
เพิ่งมีหนังสือจากกรมบัญชีกลางครับ ที่จะต้องเอกสารในระบบเบิกจ่ายตรงครับ คือ นำหน้า from ตัวนี้ไปใส่แล้วครับ
แต่ยังขึ้นอยู่ครับไม่ทราบว่าต้องแก้ไขอย่างไร ขอบคุณครับ   ??? ??? ???

217
มีวีธีแก้อย่างไรครับ ช่วยหน่อยครับ ดูจากตาราง patient แล้วปกติ

218
ขอบคุณครับ

219
BMSxTraBackupGUI-3.54.4.27.zip  คือ โหลดแล้วไม่ได้ครับ ถ้าใครมีขอหน่อยนะครับ ต้องการด่วน ขอบคุณครับ

220
Aศูนย์ หรือ Aโอ กันแน่คับ

221
select v.pttype,p.name,count(distinct v.hn) 'case',count(*) 'total'
,inc16 as 'Room_Food'
,inc12 as 'drug'
,inc01+inc02+inc03 as 'Lab'
,inc04+inc05 as 'Xray'
,inc
,income
from vn_stat v
left join pttype p on p.pttype=v.pttype
where v.vstdate between '2011-1-1' and '2011-1-31'
group by v.pttype

ประมาณนี้มั๊ย
ประยุกต์กับ income_group ว่าอยู่รายการไหนกันแน่

222
หรือจะลองประมาณนี้

select o.vn,o.hn,o.an,o.vstdate,o.vsttime,o.main_dep
,er.enter_er_time,er.doctor_tx_time,er.finish_time,er.er_list
from er_regist er
left join ovst o on o.vn=er.vn
where er.vstdate between  '2011-06-01' and '2011-06-31'
and o.main_dep<>005

223
select v.vn,v.hn,concat(p.pname,p.fname,' ',p.lname) as ptname
,v.vstdate,v.age_y,v.age_m,v.age_d,s.temperature,s.hpi
from vn_stat v
left join patient p on p.hn=v.hn
left join opdscreen s on s.vn=v.vn
where v.vstdate between "2011-05-01" and "2011-05-31"
and (v.age_y between 0 and 5 or (v.age_y=6 and v.age_m=0 and v.age_d=0))
and s.temperature between 38.0 and 38.4

225
ช่วยด้วยครับ วิธีใช้ไม่ขึ้น จากประวัติเดิม

226
หรือแบบนี้
select birthdate
,year(birthdate)+543 'year'
,case month(birthdate)
when 1 then 'มค.'
when 2 then 'กพ.'
when 3 then 'มีค.'
when 4 then 'เมย.'
when 5 then 'พค.'
when 6 then 'มิย.'
when 7 then 'กค.'
when 8 then 'สค.'
when 9 then 'กย.'
when 10 then 'ตค.'
when 11 then 'พย.'
when 12 then 'ธค.'
else 'ไม่รู้คับ'
end as 'month'
,day(birthdate) as 'day'
from person
limit 100

227
select birthdate
,year(birthdate)+543 as 'year'
,month(birthdate) as 'month'
,day(birthdate) as 'day'
from person
limit 100

228
Report Exchange / Re: ขอคำสั่ง SQL เพื่อทำรายงานครับ
« เมื่อ: มิถุนายน 08, 2011, 15:43:59 PM »
1.รายวัน
select regdate,count(an) cc
from an_stat
where regdate between '2011-1-1' and '2011-1-31'
and ward='01'  //รหัสที่ต้องการ
group  by regdate
order by regdate

2.รายเดือน
select month(regdate) 'month',year(regdate) 'year',count(an) cc
from an_stat
where regdate between '2011-1-1' and '2011-12-31'
and ward='01'
group  by month,year
order by month,year

3.รายปี
select year(regdate) 'year',count(an) cc
from an_stat
where regdate between '2009-1-1' and '2011-12-31'
and ward='01'
group  by year
order by year

229
procedure MainForm.FormShow(Sender: TObject);
var
  opdscreen_cds: TClientDataSet;
  cds:Tclientdataset;
begin
  fvn := trim(Getglobalvalue('VN'));
  fptname := getsqldata('select concat(p.pname,p.fname," ",p.lname) '+
                     ' as name '+
                     ' from patient p  '+
                     ' left outer join ovst o on o.hn = p.hn '+
                     ' where o.vn ="'+fvn+'"  ');
  ptname.text := fptname;
  ptname1.caption := fptname;
  opdscreen_cds.data := HOSxP_GetDataSet('select * from opdscreen where vn = "'+fvn+'" ');
  txtfbs.text :=opdscreen_cds['fbs'].value;
end;

แล้วขึ้น error ว่า Record, object or class type required. แก้ไขอย่างไรครับ

230
select a.pdx,count(*) cc
from an_stat a
left join iptoprt iop on iop.an=a.an
where a.dchdate between '2009-10-01' and '2010-09-30'
and iop.icd9 in ('9672','9671')
group by a.pdx
order by cc desc
limit 10
ประมาณนี้มั๊ยคับ

231
select a.admdate
,(select count(*) from ipt where regdate=a.admdate) 'admit'
,(select count(*) from ipt where dchdate=a.admdate) 'dch'
,(select count(*) from ipt where regdate<=a.admdate and (dchdate>a.admdate or dchdate is null)) 'Stay'
from (select i.regdate 'admdate'
from ipt i
where i.regdate between '2011-1-1' and '2011-1-31'
group by i.regdate) a


232
การเขียน SQL Script / Re: คำสั่งคำนวนผลต่างของเดือน
« เมื่อ: กุมภาพันธ์ 04, 2011, 11:34:07 AM »
select p.patient_hn,p.pname,p.fname,p.lname
,pa.labor_date,timestampdiff(month,pa.labor_date,now()) 'month'
from person_anc pa
left join  person p on p.person_id = pa.person_id
where timestampdiff(month,pa.labor_date,now())>=6

ประมาณนี้มั๊ย

233
ได้ลงข้อมูลเชิงรุก หรือ HOSxP_PCU มั๊ย
*****
ถ้าไม่มีข้อมูล ลองเปลี่ยนเดือนดู
*****
รหัส wbc_vaccine_id ให้เปลี่ยนเป็นของ รพ.คุณเองนะครับ

234
ลองคำสั่งประมาณนี้
select p.person_id,p.cid,p.patient_hn,p.pname,p.fname,p.lname
,s.service_date,s.body_weight,s.height

,ifnull((select 'X' from person_wbc_vaccine_detail d
where d.person_wbc_service_id=s.person_wbc_service_id
and d.wbc_vaccine_id in (1,2)),' ') 'BCG'

,ifnull((select 'X' from person_wbc_vaccine_detail d
where d.person_wbc_service_id=s.person_wbc_service_id
and d.wbc_vaccine_id in (7,8,9,10,11)),' ') 'DTP'

,ifnull((select 'X' from person_wbc_vaccine_detail d
where d.person_wbc_service_id=s.person_wbc_service_id
and d.wbc_vaccine_id in (39,40,41)),' ') 'DTP_HB'

,ifnull((select 'X' from person_wbc_vaccine_detail d
where d.person_wbc_service_id=s.person_wbc_service_id
and d.wbc_vaccine_id in (20,21,22,23,24)),' ') 'OPV'

,ifnull((select 'X' from person_wbc_vaccine_detail d
where d.person_wbc_service_id=s.person_wbc_service_id
and d.wbc_vaccine_id in (12,13,14)),' ') 'HB'

,ifnull((select 'X' from person_wbc_vaccine_detail d
where d.person_wbc_service_id=s.person_wbc_service_id
and d.wbc_vaccine_id in (15,16,17)),' ') 'JE'

,ifnull((select 'X' from person_wbc_vaccine_detail d
where d.person_wbc_service_id=s.person_wbc_service_id
and d.wbc_vaccine_id in (19)),' ') 'MMR'

from person p
left join person_wbc wbc on wbc.person_id=p.person_id
left join person_wbc_service s on wbc.person_wbc_id=s.person_wbc_id
where s.service_date between '2010-1-1' and '2010-1-31'
group by vn
order by p.person_id,vn

235
ผมทำ FingerScan ด้วย VFP9
เมื่อออกจากโปรแกรมแล้ว สัญญาณ sensor ไม่ดับ คับ
เครื่องจะติดอยู่ตลอด ทำให้ร้อน
****
ผมก้อใส่ค่า
QueryUnLoad()
Form1.GrFingerX1.CapFinalize()
Form1.GrFingerX1.Finalize()

236
Report Exchange / Re: ขอรายงาน from er-sitcker ครับ
« เมื่อ: มกราคม 18, 2011, 11:13:02 AM »

237
Report Exchange / ขอรายงาน from er-sitcker ครับ
« เมื่อ: มกราคม 18, 2011, 10:34:00 AM »
ขอรายงาน From ER-Sitcker หน่อยครับ หาในนี้แล้วไมา่เจอ

238
ผมใช้ VFP9 ดึงข้อมูลจาก Finger_Template
ฟิล์ด Template ออกมาเป็น General แล้วใช้งานไม่ได้
พอมีวิธีใช้มั๊ยครับ
ขอบคุณครับ
*****
ตอนนี้ใช้ Access  ลิ้งค์กับ HOSxP แล้วใช้ VFP ดึงจาก Access อีกที

239
ลอง select hn,fathername,fatherlname
,left(fathername,instr(fathername,' ')) 'test1'
,substr(fathername,instr(fathername,' ')+1) 'test2'
from patient
where locate(' ',trim(fathername))>1
limit 1000
ดูก่อน แล้วค่อย Update
1.update patient set fatherlname=fathername where where locate(' ',trim(fathername))>1
2.update patient set fatherlname=left(fathername,instr(fathername,' ')),fatherlname=substr(fatherlname,instr(fatherlname,' ')+1) where where locate(' ',trim(fathername))>1
ระมัดระวังหน่อยนะคับ

240
ตู้รับข้อความส่วนตัว มีปัญหารึป่าวคับ?
เปิดทีไร Error ตลอด
512: loadMemberContext(): member id 24955 not previously loaded by loadMemberData()
ไฟล์: /var/www/html/smf/Sources/Load.php
บรรทัด: 858
*****
หากท่านใดต้องการติดต่อผม กรุณาติดต่อทาง mail หรือไม่ MSN นะครับ
woravet12@hotmail.com

241
ร่วมทดสอบ Audit OP-PP Package ก่อนจะตรวจสอบด้วย OP-PP 2554 มั๊ยคับ
พัฒนาด้วย VFP9 เป็น Application นะคับ
*****
ก่อนใช้งาน ควรติดตั้ง VFP9Runtime กับ MySQL ODBC Driver ก่อน
หากติดตั้งอยู่แล้ว ก้อไม่ต้องคับ
*****
วิธีติดตั้ง แค่ Extact ไป Folder ที่ต้องการ
*****
วิธีเรียกใช้ แค่ดับเบิ้ลคลิ๊กที่ Audit_Package.EXE ก้อทำงานแล้ว
*****
หากพบปัญหาติดต่อ E-mail/MSN:=woravet12@hotmail.com หรือที่ web นี้ก้อได้คับ

242
เข้าข้อความส่วนตัวไม่ได้ เป้นเพราะ net ผม หรือ ที่ Server คับ

243
variable:=getsqlstringdata('select regdate from an_stat where hn="'+dbpipeline['hn']+'"  and an < "'+dbpipline['an']+'" order by regdate desc limit 1');

244
การเขียน SQL Script / Re: ตรวจสอบคำสั่งให้หน่อยครับ
« เมื่อ: พฤศจิกายน 12, 2010, 15:23:54 PM »
select dm.hn,p.pname,p.fname,p.lname,dm.lastdate
from (select o.hn,max(o.vstdate) lastdate
from ovstdiag o
where o.icd10 between 'E10' and 'E1499'
group by o.hn) dm
left join (select o.hn
from ovstdiag o
where o.icd10 between 'I10' and 'I1599'
group by o.hn) ht on dm.hn=ht.hn
left join patient p on dm.hn=p.hn
where ht.hn is null

245
select ifnull(p.patient_hn,pt.hn) 'hn',p.cid,p.pname,p.fname,p.lname,p.age_y
,p2.bpd,p2.bps,p2.bw,p2.height
,p2.albumin,p2.sugar
,a.blood_vdrl1_result,a.blood_vdrl2_result,a.blood_hiv1_result,a.blood_hiv2_result
,a.blood_of_result,a.blood_hct_result,a.preg_no ,a.current_preg_age,p1.pa_week
,count(*) visit
from person_anc a
left join person p on p.person_id = a.person_id
left join patient pt on p.cid=pt.cid
left join person_anc_service p1 on a.person_anc_id=p1.person_anc_id
left join person_anc_screen p2 on p2.person_anc_service_id=p1.person_anc_service_id
where p1.anc_service_date between '2010-1-1' and '2010-1-31'
group by p.cid

246
แก้ไข Birthdate,DateIn,DateExp
กรุณา D/L ใหม่
*****
ไม่พบ Error บ้างเหรอคับ
ผมเคยสั่ง 10,000 HN ดูเหมือนจะติดต่อ web service ช้า..ไปจนถึงหลุด
*****
IP=127.0.0.1 ให้ใช้ Localhost แทนคับ
*****
หากพบปัญหาติดต่อ MSN/E-mail : WORAVET12@HOTMAIL.COM

247
เป็นแค่ application เท่านั้น พัฒนาด้วย VFP9
หากจะทดสอบกรุณาติดตั้ง VFP9Runtime กับ MySQL ODBC Driver ก่อนนะคับ
****
เรื่อง Pttype กรุณากำหนดให้ตรงกับ HOSxP เราเองนะคับ
ไม่เช่นนั้น อาจผิดพลาด

248
select p.hn,p.pname,p.fname,p.lname,p.sex,p.birthday
,timestampdiff(year,p.birthday,now()) as 'age'
,p.addrpart,p.moopart
,p.tmbpart,t1.name as tambon
,p.amppart,t2.name as ampur
,p.chwpart,t3.name as changwat
from patient p
left join thaiaddress t1 on t1.addressid=concat(p.chwpart,p.amppart,p.tmbpart)
left join thaiaddress t2 on t2.addressid=concat(p.chwpart,p.amppart,'00')
left join thaiaddress t3 on t3.addressid=concat(p.chwpart,'00','00')
where timestampdiff(year,p.birthday,now()) between 60 and 100
and p.chwpart=62
and p.amppart=10
and p.tmbpart=03

249
User ->OpdUser ->Picture
Patient ->Patient_image ->Image
น่าจะประมาณนี้
*****
เมื่อ open แล้วให้คลิ๊กขวาเลือก Swicth grid ก่อน
แล้วค่อย Edit JPeg Picture เพือดูรูป

250
แจ้งปัญหา / ขอความช่วยเหลือ / Re: ขอคำสัง sql
« เมื่อ: สิงหาคม 10, 2010, 16:03:35 PM »
select o.vn,ifnull(o.an,'') 'an',o.hn,p.pname,p.fname,p.lname,o.vstdate
,v.pdx,concat_ws(',',v.dx0,v.dx1,v.dx2,v.dx3,v.dx4,v.dx5) 'Sdx'

,ifnull((select concat(d.name,' ',d.strength) 'CC'
from opitemrece o1,drugitems d,income i
where o1.icode=d.icode and i.income=o1.income and o1.vn=o.vn
and i.income_group=12
order by o1.icode
limit 1,1),'') 'd1'

,ifnull((select concat(d.name,' ',d.strength) 'CC'
from opitemrece o1,drugitems d,income i
where o1.icode=d.icode and i.income=o1.income and o1.vn=o.vn
and i.income_group=12
order by o1.icode
limit 2,1),'') 'd2'

,ifnull((select concat(d.name,' ',d.strength) 'CC'
from opitemrece o1,drugitems d,income i
where o1.icode=d.icode and i.income=o1.income and o1.vn=o.vn
and i.income_group=12
order by o1.icode
limit 3,1),'') 'd3'

from ovst o
left join patient p on o.hn=p.hn
left join vn_stat v on o.vn=v.vn
where o.vstdate = '2009-10-1'
order by o.vn

ประมาณนี้รึป่าว? ไม่รู้จุดประสงค์ที่แท้จริง
ไม่ควรใช้กับฐานข้อมูลจริง เพราะอาจจะอืด..ถึงทำให้แฮ้งด้

หน้า: 1 ... 3 4 [5] 6 7 ... 9