แสดงกระทู้

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 ... 6 7 [8] 9
351
ลองแบบนี้
Value :=GetSQLStringData('select vstdate from vn_stat where hn="'+DBPipeline['HN'] +'"and vn<"'+DBPipeline['vn']  +'" order by vn desc limit 1');
ถ้าต้องวันที่ที่มาครั้งก่อน


352
มี Source code ของ
1.Export SSN
2.Import HCIS->HOSxP
3.Import HCIS->HOSxP_PCU
ให้ศึกษาบ้างมั๊ยครับ

353
Report Exchange / Re: จะเขียนคำสั่งยังไงเนี่ยครับ
« เมื่อ: กุมภาพันธ์ 26, 2008, 17:45:18 PM »
แบบนี้พอไหวมั๊ย
select o.vn,o.hn,p.pname,p.fname,p.lname
,p.addrpart,p.moopart,a.full_name as address
,count(op.icode) as amount,s.bps,s.bpd
from ovst o
left join patient p on p.hn=o.hn
left join thaiaddress a on a.addressid=concat(p.chwpart,p.amppart,p.tmbpart)
left join opitemrece op on o.vn=op.vn
left join drugitems d on op.icode=d.icode
left join opdscreen s on s.vn=o.vn
where o.vstdate=now()
and d.name is not null
and o.hn in (select hn from clinicmember where clinic=
(select sys_value from sys_var where sys_name='ht_clinic_code'))
group by o.vn
having amount>=5
order by o.hn

354
Report Exchange / Re: รบกวนผู้รู้เรื่องรายงานครับ
« เมื่อ: กุมภาพันธ์ 22, 2008, 16:27:33 PM »
ลองเอาสั่ง sql ไปประยุกต์ดูครับ
select a.hn,concat(pname,p.fname,' ',p.lname) as namept,a.order_date
,b.lab_items_code,c.lab_items_name
,count(a.hn) as amount,d.name as doctor
from lab_head a
left join lab_order b on b.lab_order_number=a.lab_order_number
left join lab_items c on c.lab_items_code=b.lab_items_code
left join doctor d on d.code=a.doctor_code
left join patient p on p.hn=a.hn
where a.order_date between '2008-1-1' and '2008-1-31'
group by a.hn,a.order_date,b.lab_items_code,a.doctor_code
having amount>1
order by a.hn,a.order_date,b.lab_items_code,a.doctor_code
น่าจะพอใช้ได้

355
select o.hn,o.vstdate,p.pname,p.fname,p.lname,v.pdx
from ovst o
left join vn_stat v on o.vn=v.vn
left join patient p on o.hn=p.hn
where v.vstdate between '2008-1-1' and '2008-1-31'
and (v.pdx is null or v.pdx=' '
or left(v.pdx,1) in ('0','1','2','3','4','5','6','7','8','9'))
order by o.hn,o.vstdate

ลองประยุกต์ต่อนะครับ

356
Report Exchange / Re: รายงาน
« เมื่อ: กุมภาพันธ์ 01, 2008, 17:03:29 PM »
หรือจะลองแบบนี้มั๊ง
select cm.hn,cm.last_vn,concat(p.pname,p.fname,' ',p.lname) as name
,concat(p.addrpart,ifnull(p.moopart,if(p.moopart=' ','',' ม.'+p.moopart)),' ',ifnull(t.full_name,'')) as address
,o.vstdate,o.bps,o.bpd,o.fbs,o.cholesterol,o.tg,o.hdl,o.ldl
from clinicmember cm
left join patient p on cm.hn=p.hn
left join thaiaddress t on t.addressid=concat(p.chwpart,p.amppart,p.tmbpart)
left join opdscreen o on cm.last_vn=o.vn
where cm.clinic=001
order by cm.hn

ลองปรับแต่งเอานะครับ โดยเอาผลจาก opdscreen

357
Development / Re: VFP7 VS Mysql
« เมื่อ: มกราคม 28, 2008, 15:15:15 PM »
กรณีที่ 2 โดยการสร้าง User DSN ขึ้นมา && สมมุติชื่อ hos
set talk off
close data
_handle=sqlconnect('hos')
if _handle>0
  ?'สามารถ Connect HOSxp ได้'
  =sqldisconect(_handle)
else
 =aerror(merror)
 ?'ไม่สามารถติดต่อ HOSxP ได้'
 ?merror(1,2)
endif
close data

โดยปกติผมจะใช้กรณีที่ 1 เพราะที่ รพ.เปลี่ยน IP กันบ่อยมาก
โดยสร้าง func รับค่าจาก C:\WINDOWS\HOS-WIN32.INI

358
Development / Re: VFP7 VS Mysql
« เมื่อ: มกราคม 28, 2008, 15:05:26 PM »
ของ อ.อ๊อด น่าจะ Connect ไม่ได้
น่าจะเป็น
กรณี 1
set talk off
close data
_server='192.168.1.1'
_user='sa'
_psw='sa'
_database='hos'ntoc(_database,0)
_connect = ;
"Driver={MySQL ODBC 3.51 Driver};" + ;
"Server=" + _server + ";" + ;
"UID=" + _user + ";" + ;
"PASSWORD=" + _psw + ";" + ;
"Database="+_database+";" +;
"Port=3306;" + ;
"Option= 0 ;"+;
"Stmt =set names tis620;"
_handle=sqlstringconnect(_connect)
if _handle>0
  ?'สามารถ Connect HOSxp ได้'
  =sqldisconect(_handle)
else
 =aerror(merror)
 ?'ไม่สามารถติดต่อ HOSxP ได้'
 ?merror(1,2)
endif
close data

359
อ.MN ครับ วิธีทำ ReSync VN ทำอย่างไรครับ
แบบกำหนดทั้งปี พ.ศ. ได้มั๊ยครับ

360
ไม่ทำตัวตรวจสอบ cid ว่าถูกต้องหรือไม่ ก่อนนำเข้าหล่ะครับ
เห็นอ่านเข้าทุกอย่าง โดยไม่คำนึงถึงรูปแบบ กลัวข้อมูลจะเพี้ยนครับ

361
ยินดีต้อนรับ / Re: สวัสดีปีใหม่
« เมื่อ: ธันวาคม 28, 2007, 17:20:42 PM »
ขอให้โชคดี มีสุข มีเงินทองใช้ ปราศจากเรื่องเครียดๆหนักๆ ทุกท่านครับผม

362
ผมว่าคุณใช้เงื่อนไขของวันนัด+วันมาตรวจ
ทำให้เกิดปัญหา ถ้านัดแล้วไม่มาตรวจหล่ะครับ
ผมว่าน่าจะเป็น
select vn.vn,oa.hn,oa.nextdate,concat(pt.pname,pt.fname,"   ",pt.lname) as pt_name,pt.addrpart,right(concat('0',pt.moopart),2) as moopart,ta.full_name,concat(vn.age_y," - ",vn.age_m," - ",vn.age_d) as pt_age,concat(os.bpd," / ",os.bps) as bpds

from oapp oa
left outer join vn_stat vn on vn.hn=oa.hn
left outer join patient pt  on pt.hn=oa.hn
left outer join thaiaddress ta on ta.addressid=concat(pt.chwpart,pt.amppart,pt.tmbpart)
left outer join opdscreen os on os.vn=vn.vn

where (oa.nextdate between '2007-10-24' or '2007-10-24' and vn.vstdate between '2007-10-24' )and '2007-10-24' and oa.clinic="002"

order by ta.addressid,moopart,pt.addrpart asc

ลองเปลี่ยนตรงช่วงสีแดงดูครับ น่าจะพอใช้ได้

363
ผู้ป่วยนอก น่าจะเป็น
select p.hn,p.pname,p.fname,p.lname,p.sex,p.birthday
,p.addrpart,p.moopart,p.tmbpart,p.amppart,p.chwpart,max(o.vstdate) as vstdate
from patient p
left join ovst o on p.hn=o.hn
left join ovstdiag o1 on o.vn=o1.vn
where o1.icd10 between 'b20' and 'b24'
and p.hn not in (select hn from death)
group by p.hn
having count(o.hn)>2
****
ผู้ป่วยใน น่าจะ
select p.hn,p.pname,p.fname,p.lname,p.sex,p.birthday
,p.addrpart,p.moopart,p.tmbpart,p.amppart,p.chwpart,max(o.regdate) as regdate
from patient p
left join ipt o on p.hn=o.hn
left join iptdiag o1 on o.an=o1.an
where o1.icd10 between 'b20' and 'b24'
and p.hn not in (select hn from death)
group by p.hn
having count(o.hn)>2

พอจะใช้ได้มั๊ยครับ

364
ผมใช้โปรแกรม  HOSxP อยู่ ทำการย่อเพื่อใช้โปรแกรมอื่นแล้วกลับมาใช้
แต่ใช้ Num Pad ไม่ได้ ต้องเปิดแล้วเปิดใหม่
มีวิธีแก้ไขมั๊ยครับ

365
การเขียน SQL Script / Re: sql วันละคำ กับ perjer
« เมื่อ: ธันวาคม 13, 2007, 12:31:47 PM »
น่าจะมีบอกไว้เกี่ยวกับบางคำสั่ง เพราะใช้ต่าง version กัน
เช่น timestampdiff ใช้ใน MySQL 5 ขึ้นไป
เพราะของผมยังใช้ 4 อยู่เลยใช้ไม่ได้
*****
ผมไม่แน่ใจว่า from_days กับ to_days เป็น store procedures รึปล่าว
เห็นมีอยู่หลายตัวเหมือนกันใน HOSxP

366
อ.ดึงข้อมูลจากฟิล์ด moid ใช่มั๊ยครับ
ฟิด์ลที่น่าจะได้
village=copy(moid,7,2)
tambon=copy(moid,5,2)
ampur=copy(moid,3,2)
changwat=copy(moid,1,2)
แบบนี้มั๊ยครับ (ผมลงย่อๆมาให้ดู)


367
แฟ้ม HOME ข้อมูล Changwat,Ampur,Tambon น่าจะผิดนะครับ
ใส่สลับตัวแปร

368
รหัสมาตรฐาน (DID) หาจากที่ไหนครับ
หรือสามารถกำหนดเองได้เลย
หรือมีวิธีการกำหนดอย่างไรบ้าง

369
ผมใช้ mysql 4.1 อยู่ ใช้คำสั่งอะไรครับ

370
ผมใช้คำสั่งดึงข้อมูล แล้วเกิด error

Got error 134 from storage engine

หมายความว่าอย่างไรครับ


371
การเขียน SQL Script / Re: คำสั่ง Count
« เมื่อ: กันยายน 06, 2007, 16:34:31 PM »
หรือจะลองแบบนี้มั๊ง
select ov.vstdate,count(op.hn) as hn
,sum(if(op.bpd>0,1,0)) as bpd
,sum(if(op.bps>0,1,0)) as pbs
,sum(if(op.bw>0,1,0)) as bw
,sum(if(op.pulse>0,1,0)) as pulse
,sum(if(op.temperature>0,1,0)) as temperature
from opdscreen op , ovst ov
where op.vstdate between "2007-08-01" and "2007-08-31" and op.vn = ov.vn
and ov.main_dep = "010"
group by ov.vstdate

372
อ.MN ครับ ขอถามชื่อไฟล์ Source code หน่อยครับ
1.ลงทะเบียนผู้ป่วยใหม่
2.บันทึกส่งตรวจ
3.บันทึผลวินิจฉัย
*****
อ. มีไฟล์เสียง 21 กับ 101 บ้างมั๊ยครับ

373
ลองสั่ง update patient set drugallergy=null where drugallergy='""'

374
ขอให้หายไวๆ นะครับ จะได้สู้ต่อไปอีกครับผม

375
มีแบบแยกเป็น Module มั๊ยครับ

376
การใช้งานของ OVST_DIAG_ID ทำงานอย่างไรครับ
ใช้ที่ max(ovst_diag_id)+1 ของ ovstdiag เลยรึปล่าวครับ
โดยตรวจสอบกับ seiral
*****
เห็น อ.ใช้ delete ovstdiag where vn=? แล้ว insert จาก getserialnumber()
ผมลองตรวจก้อไม่เห็นมี ovst_diag_id ข้ามครับ

377
ลองตรวจตรง DRGs Income Group ดูซิครับ
ฟิลด์ DRG_Group ใน income

378
ขอบคุณมากครับ
ที่จริงไม่น่าขึ้นอยู่กับ fixed_price เพราะราคาอยู่ที่หมอสั่ง หรือไม่ก้อห้องยา(ที่คิดเงิน)
เพราะห้อง X-Ray ก้อยังไม่ค่อยได้ใช้เท่าไร
แต่อย่างไรก้อได้ตามความต้องการของ รพ.ระดับหนึ่ง

379
ถ้าเราจะทำให้ขึ้นอัตโนมัติได้มั๊ยครับ แบบการสั่ง Lab

380
ผมตรวจสอบ icode ของ xray_items ก้อมีใน nondrugitems
ก้อยังไม่ขึ้น ใช้ 3.50.6.17 อยู่ครับ
ต้องตรวจสอบตรงไหนอีกครับ

381
อ.ครับ มี Er-Diagram ของห้องบัตรบ้างมั๊ยครับ
ขอแยกเป็น Module ได้มั๊ยครับ(บัตรใหม่,ลงทะเบียน,ลงโรค)

382
อ.ครับ จะ Click หรือไม่ ก้อทำงานครับ ในกรณีเป็นผู้ป่วยคลีนิคพิเศษ

383
จาก Module บันทึกผลการตรวจรักษา
1.ไม่ต้องการลง Screen Data ต้องทำอย่างไรครับ กรณีผู้ป่วยคลีนิคพิเศษ
2.ไม่ให้ขึ้น Auto Dx ของผู้ป่วยคลีนิคพิเศษได้มั๊ยครับ
*****
อ. ยังไม่ได้แก้เกี่ยวกับสภาพผลการตรวจรักษาครับ
ในกรณีที่แพทย์ยังไม่ได้ลงโรคมา
เราจะแก้เป็นอย่างอื่นไม่ได้ ต้องบันทึกไปครั้งหนึ่งก่อน แล้วกลับมาแก้
กรณี Refer ข้อมูลเก่าจะไม่ขึ้นมา

384
ลองเป็น
select o.spclty,sp.name as spname,
sum(if(o.pttype between '61' and '96',1,0)) as countUC,
sum(if(o.pttype between '61' and '96',vn.income,0)) as sumUC,
sum(if(o.pttype between '34' and '35',1,0)) as countSSM,
sum(if(o.pttype between '34' and '35',vn.income,0)) as sumSSM,
sum(if(o.pttype='22',1,0)) as countA2,
sum(if(o.pttype='22',vn.income,0)) as sumA2,
from ovst o
left outer join spclty sp on sp.spclty=o.spclty
left outer join vn_stat vn on vn.vn=o.vn
where o.vstdate between "2007-01-01" and "2007-01-31" and o.an IS NULL
group by sp.spclty
order by sp.spclty,o.vstdate

ลองประยุกต์ตามสิทธิอื่นๆดูครับ

385
ใน vn_stat เป็น SDx รึปล่าวครับ
จากคำสั่งแรก มันหาเฉพาะที่เป็น priciple dx นะครับ
ลองเป็น
select *
from vn_stat
where pdx='n63' or dx0='n63' or dx1='n63' or dx2='n63' or dx3='n63' or dx4='n63' or dx5='n63'
สิครับ

386
Error แบบนี้แก้ไขอย่างไรครับ
คือ เรยกผู้ป่วยจาก Modlue หร้องตรวจโรคขึ้นมา จะขึ้น error นี้ เป็นแค่บางรายครับ

387
จากรูปที่ 1 ถ้าไม่มีการลง Dx.มาก่อน จะเปลี่ยนสถาพหลังการตรวจเป็นอย่างอื่นๆไม่ได้(01-12 หรือ 54)
จะได้เฉพาะ 99

จากรูปที่ 2 เมื่อมีการแก้ไข จะไม่มีข้อมูลเก่าที่เคยลงขึ้นมา

388
1.การใส่ข้อมูลที่เป็น null ใน table ที่เรียกจาก sql โดย keyboard ทำอย่างไรครับ
พอดีลบข้อมูลแล้วเป็นช่องว่าง ยังไม่ได้ใช้คำสั่ง update
2.ค่าของ vsttime ที่ดึงข้อมูลด้วย vfp ออกมาไม่ถูกต้อง ที่ใช้ date_format(vsttime,'%T') แทน มีวิธีอื่นอีกมั๊ยครับ
3.Modile ของ บันทึกผลการตรวจรักษา มี bug ครับ คือถ้าแพทย์ไม่ลงโรคมา แล้วจะลงสถาพผลการรักษา
เป็น Admit หรือ Refer ต้องทำการบันทึกก่อน แล้วค่อยเปิดมาแก้ไข แล้วถ้าเป็น Refer จะไม่มีข้อมูลเก่าขึ้นมา

389
ขอรบกวนอาจารย์ หรือท่านผู้รู้
เกี่ยวกับวิธีใช้ DeCryptText หน่อยครับ

390
Development / Re: เรียนสอบถามผู้รู้อีกครั้งครับ
« เมื่อ: มีนาคม 30, 2007, 23:08:06 PM »
ถ้าเป็นแบบนี้หล่ะครับ
select a.hn,b.pname,b.fname,b.lname,c.vstdate,d.fbs,d.bps,d.bpd
from clinicmember a
left join patient b on a.hn=b.hn
left join ovst c on a.hn=c.hn
left join opdscreen d on c.vn=d.vn
where a.clinic=(select sys_value from sys_var where sys_name='dm_clinic_code') //บางที่ให้รหัสไม่เหมือนกัน
and c.vstdate='2007-3-29'
order by (b.chwpart+b.amppart+b.tmbpart)

391
ถ้าคุณใช้ VFP ได้
ลองส่งแฟ้ม DBF มาให้สัก 10 records สิครับ
จะทำ code ให้ครับ
หรือที่ woravet@yahoo.com ก้อได้ครับ

392
อยากทราบรหัสผ่านของ User แต่ละราย
เพราะมี User ระดับ Admin หลายคน
ไม่ทราบใครไปเปลี่ยนแปลงอะไรบ้าง บางครั้งของๆผมก้อถูกเปลี่ยน
ทำให้เข้าโปรแกรมไม่ได้
*****
ผมเห็นมี func DeCrypttext,EnCrypttext อยู่ แต่ใช้ไม่เป็น
มีตัวอย่างบ้างมั๊ยครับ

393
ขอบคุณครับ
****
อ.MN ครับ ขอวิธีคำนวณ LASTVISIT,LASTVISIT_HOUR หน่อยได้มั๊ยครับ
ลองดูแล้วยังงงอยู่ครับ


394
ขอความหมายตัวแปรใน DataResyncVNU.PAS
FODrugAccountIncome := gethosvariable('non_drug_account_income');
หาค่าได้อย่างครับ

395
คือผมจะให้คำสั่งนี้กับ User ที่จะใช้ เพราะยังไม่ได้ออกแบบ Report ให้
อยากให้ Export แบบง่ายๆ ไปก่อน เพื่อการใช้งานเบื้องต้น
*****
โดยปกติผม Export เป็น DBF เพราะยังใช้ VFP เป็นอยู่บ้าง

396
จากคำสั่ง Sql
select a.hn,concat(b.pname,b.fname,' ',b.lname) as name,b.addrpart,b.moopart,h.age_y,h.age_m,h.age_d,b.sex,b.marrystatus,g.icd10 as dx,e.name as pttype,
date_format(a.vsttime,'%T') as time,c.nextdate,concat(round(d.bps,0),'/',round(d.bpd,0)) as bp,d.cc,d.pe,d.fbs,d.bw,d.height,d.bmi,f.name as result
from ovst a
left join patient b on a.hn=b.hn
left join oapp c on a.vn=c.vn
left join opdscreen d on a.vn=d.vn
left join pttype e on a.pttype=e.pttype
left join ovstost f on a.ovstost=f.ovstost
left join ovstdiag g on a.vn=g.vn and g.diagtype=1
left join vn_stat h on a.vn=h.vn
where a.vstdate='2007-3-12'
and b.chwpart=62 and b.amppart=10 and b.tmbpart=02
group by a.hn
order by a.vsttime
ถ้า Run Sql สามารถอ่านได้ แต่ถ้า Excel Exopt ใน Column ของ CC กับ PE จะออกเป็น (MEMO)
ต้องทำอย่างไรบ้างครับ

397
ผมใช้คำสั่ง sql
select vn,hn,vstdate from ovst where vn not in (select vn from vn_stat)
ซึ่งผลลัพธ์มีจำนวนมาก เมื่อเทียบกับ
select vn,hn,vstdate from vn_stat where vn not in (select vn from ovst)
ดังนั้นผมอยากได้ Script หรือวิธีที่จะโอนข้อมูลจาก ovst,ovstdiag--->vn_stat


398
มีวิธีโอนข้อมูลจาก ovst,ovstdiag ไป vn_stat
และ vn_stat ไป  ovst,ovstdiag บ้างมั๊ยครับ
เนื่องจากผมใช้คำสั่ง sql ลบข้อมูลบ้างตัวออกไป
แล้วตรวจสอบเห็นข้อมูลไม่เท่ากันครับ
*****
ขอของ an_stat ไป ipt,iptdiag
และ ipt,iptdiag ไป an_stat ด้วยนะครับ

399
Diagnosis has been locked
Diagnosis data not save

คือผมจะลงโรคเพิ่ม หรือแก้ไขรหัสโรคให้ถูกต้อง
จากระบบผู้ป่วยนอก->บันทึกผลการตรวจรักษา

400
ระบบผู้ป่วยนอก
->ลงทะเบียนเวชระเบียน
-->ตัวเลือกการพิมพ์
--->เปิดหน้าจอส่งตรวจหลังการบันทึก จะติ๊กหรือไม่ ก้อจะเปิดหน้าต่างส่งตรวจตลอดครับ

หน้า: 1 ... 6 7 [8] 9