select o.vn,p.cid,o.hn,concat(p.pname,p.fname,' ',p.lname) as name,o.icd10,p.pttype,lo.lab_order_number,lo.lab_items_code,lo.lab_items_name_ref,lo.lab_order_result from ovstdiag o
left outer join patient p on p.hn=o.hn
left outer join lab_head lh on lh.vn=o.vn
left outer join lab_order lo on lo.lab_order_number=lh.lab_order_number
where o.vstdate between '2010-02-01' and '2010-02-15' and p.pttype in ("72","77","74","89","81","82","75") and(o.icd10 like 'E10%' OR o.icd10
like 'E11%'OR o.icd10 like 'E12%' OR o.icd10 like 'E13%' OR o.icd10 like 'E14%' OR o.icd10 like 'I10%')
and (select lo.lab_items_code ='91')
order by o.vstdate,o.hn asc