205
« เมื่อ: มิถุนายน 03, 2009, 14:19:30 PM »
ผมลองนำรายงานเข้าแล้วก็ขึ้นหน้ารายงานเปล่า ก็เลยเข้า show sql trace windows ดูว่าโปรแกรมส่งค่าอะไรให้กับ report ปรากฏว่าส่งค่า an = "4" ไปให้รายงาน ทั้งๆที่ คนไข้นั้น an = 520000972 ตามจริงน่าจะส่ง an ตัวนี้ไปให้รายงาน
-------------------------------------------------------------
Date Time Type Exec Time SQL Text
52-06-03 14:27:45.546 SQL 15 select script_dfm from reporttemplate where name = 'REPORT-LABOUR-INFANT-1'
-------------------------------------------------------------
Date Time Type Exec Time SQL Text
52-06-03 14:27:45.546 SQL 0
select ip.an,concat(p.pname) as p_name,p.lname,p.cid,s.name,n.name,p.birthday,ip.born_time,
concat(p.fathername,' ',p.fatherlname) as fnl,p.father_cid,concat(p.mathername,' ',p.motherlname) as mnl,
p.mother_cid,ip.birth_weight,ip.preg_no,d.name as dname,pr.ga,
l.mother_gvalue,l.mother_p1value,l.mother_p2value,l.mother_avalue,(l.mother_lvalue+pr.child_count) as living_all,
(l.mother_lvalue+pr.child_count+l.mother_avalue) as child_all,
p2.cid as mom_cid
from ipt_newborn ip
left outer join ipt i on i.an=ip.an
left outer join patient p on p.hn=i.hn
left outer join thaiaddress t on t.addressid=concat(p.chwpart,p.amppart,p.tmbpart)
left outer join sex s on s.code=p.sex
left outer join nationality n on n.nationality=p.nationality
left outer join labor l on l.an=ip.mother_an
left outer join an_stat a on a.an=ip.mother_an
left outer join patient p2 on p2.hn=a.hn
left outer join doctor d on d.code=l.labor_who
left outer join ipt_pregnancy pr on pr.an=ip.mother_an
where ip.an='4'