ขอบคุณครับ
กำลังทำอยู่เหมือนกัน กว่าจะรู้รหัสเข้าไฟล์ DBSurveillance.mdb ก็ต้องไปหา mdb unlock มาดู(เสียเวลา)
มี script sql มาฝากครับ (ยังไม่เสร็จดีครับ) มีให้เลือก DM , HT , IHD , Stroke , COPD ฝาก อ.อ๊อก ช่วยเพิ่มเติมให้ด้วยนะครับ
script ส่งออก ไปยัง โปรแกรม Chronic Diseases Surveillance v2.10 GT แต่ควรจะใช้ v2.21
DM ใช้
select chwpart as IDPv,'11447' as Hospital,v.vstdate as Daterec,v.cid as IDCard,p.hn as HN ,pname as Title , fname as NPatient,Lname as Spatient,
Birthday as Birthday,age_y as Age,p.Sex,s.bw as Weight,s.height as High,s.bpd+'/'+s.bps as Effect,addrpart as No,p.moopart as Moo,space(2) as Lane,
p.road as Road,aid as Address,nationality as Nation,p.occupation as Occupation,space(17) as Death,space(17) as Casue,space(17) as BMI,
space(16) as DateDiag,space(17) as Chornic,space(18) as code,pdx as Diagnosis,space(20) as Remark,space(21) as icd10,space(22) as "ที่อยู่"
from vn_stat v
left outer join patient p on p.hn= v.hn
left outer join opdscreen s on s.vn= v.vn
where v.vstdate between "2008-03-01" and "2008-03-29"
and ( (v.pdx >= "E100" and v.pdx <= "E149")
or (v.dx0 >= "E100" and v.dx0 <= "E149")
or (v.dx1 >= "E100" and v.dx1 <= "E149")
or (v.dx2 >= "E100" and v.dx2 <= "E149")
or (v.dx3 >= "E100" and v.dx3 <= "E149")
or (v.dx4 >= "E100" and v.dx4 <= "E149")
or (v.dx5 >= "E100" and v.dx5 <= "E149") )
HT ใช้
select chwpart as IDPv,'11447' as Hospital,v.vstdate as Daterec,v.cid as IDCard,p.hn as HN ,pname as Title , fname as NPatient,Lname as Spatient,
Birthday as Birthday,age_y as Age,p.Sex,s.bw as Weight,s.height as High,s.bpd+'/'+s.bps as Effect,addrpart as No,p.moopart as Moo,space(2) as Lane,
p.road as Road,aid as Address,nationality as Nation,p.occupation as Occupation,space(17) as Death,space(17) as Casue,space(17) as BMI,
space(16) as DateDiag,space(17) as Chornic,space(18) as code,pdx as Diagnosis,space(20) as Remark,space(21) as icd10,space(22) as "ที่อยู่"
from vn_stat v
left outer join patient p on p.hn= v.hn
left outer join opdscreen s on s.vn= v.vn
where v.vstdate between "2008-03-01" and "2008-03-29"
and ( (v.pdx >= "I100" and v.pdx <= "I159")
or (v.dx0 >= "I100" and v.dx0 <= "I159")
or (v.dx1 >= "I100" and v.dx1 <= "I159")
or (v.dx2 >= "I100" and v.dx2 <= "I159")
or (v.dx3 >= "I100" and v.dx3 <= "I159")
or (v.dx4 >= "I100" and v.dx4 <= "I159")
or (v.dx5 >= "I100" and v.dx5 <= "I159") )
IHD ใช้
select chwpart as IDPv,'11447' as Hospital,v.vstdate as Daterec,v.cid as IDCard,p.hn as HN ,pname as Title , fname as NPatient,Lname as Spatient,
Birthday as Birthday,age_y as Age,p.Sex,s.bw as Weight,s.height as High,s.bpd+'/'+s.bps as Effect,addrpart as No,p.moopart as Moo,space(2) as Lane,
p.road as Road,aid as Address,nationality as Nation,p.occupation as Occupation,space(17) as Death,space(17) as Casue,space(17) as BMI,
space(16) as DateDiag,space(17) as Chornic,space(18) as code,pdx as Diagnosis,space(20) as Remark,space(21) as icd10,space(22) as "ที่อยู่"
from vn_stat v
left outer join patient p on p.hn= v.hn
left outer join opdscreen s on s.vn= v.vn
where v.vstdate between "2008-03-01" and "2008-03-29"
and ( (v.pdx >= "I120" and v.pdx <= "I125")
or (v.dx0 >= "I120" and v.dx0 <= "I125")
or (v.dx1 >= "I120" and v.dx1 <= "I125")
or (v.dx2 >= "I120" and v.dx2 <= "I125")
or (v.dx3 >= "I120" and v.dx3 <= "I125")
or (v.dx4 >= "I120" and v.dx4 <= "I125")
or (v.dx5 >= "I120" and v.dx5 <= "I125") )
Stroke ใช้
select chwpart as IDPv,'11447' as Hospital,v.vstdate as Daterec,v.cid as IDCard,p.hn as HN ,pname as Title , fname as NPatient,Lname as Spatient,
Birthday as Birthday,age_y as Age,p.Sex,s.bw as Weight,s.height as High,s.bpd+'/'+s.bps as Effect,addrpart as No,p.moopart as Moo,space(2) as Lane,
p.road as Road,aid as Address,nationality as Nation,p.occupation as Occupation,space(17) as Death,space(17) as Casue,space(17) as BMI,
space(16) as DateDiag,space(17) as Chornic,space(18) as code,pdx as Diagnosis,space(20) as Remark,space(21) as icd10,space(22) as "ที่อยู่"
from vn_stat v
left outer join patient p on p.hn= v.hn
left outer join opdscreen s on s.vn= v.vn
where v.vstdate between "2008-03-01" and "2008-03-29"
and ( (v.pdx >= "I610" and v.pdx <= "I649")
or (v.dx0 >= "I610" and v.dx0 <= "I649")
or (v.dx1 >= "I610" and v.dx1 <= "I649")
or (v.dx2 >= "I610" and v.dx2 <= "I649")
or (v.dx3 >= "I610" and v.dx3 <= "I649")
or (v.dx4 >= "I610" and v.dx4 <= "I649")
or (v.dx5 >= "I610" and v.dx5 <= "I649") )
COPD ใช้
select chwpart as IDPv,'11447' as Hospital,v.vstdate as Daterec,v.cid as IDCard,p.hn as HN ,pname as Title , fname as NPatient,Lname as Spatient,
Birthday as Birthday,age_y as Age,p.Sex,s.bw as Weight,s.height as High,s.bpd+'/'+s.bps as Effect,addrpart as No,p.moopart as Moo,space(2) as Lane,
p.road as Road,aid as Address,nationality as Nation,p.occupation as Occupation,space(17) as Death,space(17) as Casue,space(17) as BMI,
space(16) as DateDiag,space(17) as Chornic,space(18) as code,pdx as Diagnosis,space(20) as Remark,space(21) as icd10,space(22) as "ที่อยู่"
from vn_stat v
left outer join patient p on p.hn= v.hn
left outer join opdscreen s on s.vn= v.vn
where v.vstdate between "2008-03-01" and "2008-03-29"
and ( (v.pdx >= "I410" and v.pdx <= "I449")
or (v.dx0 >= "I410" and v.dx0 <= "I449")
or (v.dx1 >= "I410" and v.dx1 <= "I449")
or (v.dx2 >= "I410" and v.dx2 <= "I449")
or (v.dx3 >= "I410" and v.dx3 <= "I449")
or (v.dx4 >= "I410" and v.dx4 <= "I449")
or (v.dx5 >= "I410" and v.dx5 <= "I449") )