อยากให้แสดง รายการสั่ง Lab ล่วงหน้าจะต้องเพิ่มคำสั่งอะไรเพิ่มเติมบ้างคับ ช่วยดูให้หน่อยครับ พี่ๆทุกท่าน เหลือตรงนี่ที่เดียวครับ
select d1.*,o1.*,v1.*,s.*,pe.*,oa.*,p.drugallergy,p.clinic,p.nationality,p.hometel as pt_tel,
p2.pttype as pttype_pttype,p2.name as pttype_name,p2.pcode as pttype_pcode,
p2.requirecode as pttype_requirecode,p2.require_hcode as pttype_require_hcode,
concat(if(d1.patient_address is null,'',d1.patient_address),' โทร. ',
if((p.hometel is null or p.hometel = ''),' - ',p.hometel)) as patient_address_tel,
oo.observe_id,oo.send_date_time as observe_intime,oo.leave_date_time as observe_outtime,
oo.symptom as observe_symptom,oo.nurse_activity as observe_activity,oo.note as observe_note,
oo.ward as observe_ward,pp.name as pt_priority_name,pw.name as pt_walk_name,
concat(help3_icode,' # ',if(help3_qty is null,'',help3_qty)) as help3_drug_name,x1.vn as xray_vn
from doctor_order_print d1
left outer join ovst o1 on o1.vn = d1.vn
left outer join vn_stat v1 on v1.vn = d1.vn
left outer join opdscreen s on s.vn = d1.vn
left outer join pe_image pe on pe.vn = d1.vn
left outer join opd_observe oo on oo.vn = d1.vn
left outer join oapp oa on oa.vn = d1.vn
left outer join patient p on p.hn = d1.hn
left outer join xray_head x1 on x1.vn = d1.vn
left outer join pttype p2 on p2.pttype = v1.pttype
left outer join pt_priority pp on pp.id = o1.pt_priority
left outer join pt_walk pw on pw.walk_id = s.walk_id
where d1.vn = '520316162311' and d1.print_server = 'ER'