select o.hn,o.an,concat(p.pname,' ',fname,' ',lname) as ptname,rx.qty,rx.sum_price,p.drugallergy,o.age_y,rx.rxdate,
concat(du.name1," ",du.name2," ",du.name3) as drugu,concat(spu.name1," ",spu.name2," ",spu.name3) as spus,
concat(d.name," ",d.strength," ",d.units) as drugname
from an_stat o
left outer join patient p on p.hn=o.hn
left outer join opitemrece rx on rx.an=o.an
left outer join drugitems d on d.icode=rx.icode
left outer join sp_use spu on spu.sp_use=rx.sp_use
left outer join drugusage du on du.drugusage=rx.drugusage
where o.an='560000366' and rx.icode like "1%"
and item_type like 'H'
order by rx.icode