ลองไปเอา paremeter value ของ lab_order_number จากตารางจริง ของ รพ.เราล่าสุดมาใช้ก่อน save report ดูครับ...
ก็ยังไม่ออกครับพี่เกื้อ
select concat(p.pname,p.fname," ",p.lname) as ptname,g.lab_items_group_name,
d.name as request_doctor_name,u.name as reporter_name1,
h.*,l.*,i.lab_items_unit,i.lab_items_normal_value ,i.lab_items_name
from lab_head h
left outer join lab_order l on l.lab_order_number=h.lab_order_number and l.lab_order_result IS NOT NULL and l.lab_order_result<>''
left outer join lab_items i on i.lab_items_code=l.lab_items_code
left outer join patient p on p.hn=h.hn
left outer join doctor d on d.code=h.doctor_code
left outer join opduser u on u.loginname=h.reporter_name
left outer join lab_items_group g on g.lab_items_group_code = i.lab_items_group
where l.lab_order_number="345277"
order by i.lab_items_group,i.display_order,i.lab_items_name