if GetSQLStringData('select drugallergy from patient where hn="'+DBPipeline['HN'] +'"')<>'' then
Value := ''+GetSQLStringData('select drugallergy from patient where hn="'+DBPipeline['HN'] +'"') else
if GetSQLIntegerData('select count(distinct(v.vn)) as cc from rx_operator r '+
' inner join vn_stat v on v.vn=r.vn '+
' where v.hn="'+DBPipeline['HN'] +'" and r.pay="Y" and r.pay_staff in (select code from doctor where position_id in (3,7)) ')>0 then
Value := 'ปฏิเสธอาการแพ้ยา' else
Value := 'ไม่มีข้อมูลการแพ้ยา';