พฤษภาคม 2024
จ. อ. พ. พฤ. ศ. ส. อา.
« มี.ค.    
 12345
6789101112
13141516171819
20212223242526
2728293031  
พฤษภาคม 2024
จ. อ. พ. พฤ. ศ. ส. อา.
« มี.ค.    
 12345
6789101112
13141516171819
20212223242526
2728293031  

hosxp ใบสั่งยา แสดงจำนวน คนซ้ำกัน ชื่อสกุลเหมือนกัน

select left(opn.presc_reason,2)as reason,opn.icode,if(v1.count_in_year=”o”,” ãËÁèã¹»Õ “,” à¡èÒã¹»Õ “)as NY,
(select count(*) from patient p2 where p2.fname=p.fname and p2.lname=p.lname having count(*)>1)as ACC,
(case when op.paidst in (’01’,’02’,’04’) and sp.pttype is null then ‘àºÔ¡ä´é’
when op.paidst in (’03’,’01’) and sp.pttype is not null and opn.presc_reason not like ‘EF%’
and op.icode not in (‘1550090′,’1550271′,’1550056’)
then ‘àºÔ¡ä´é’
else round(op.sum_price,2) end)as paid,
(case when op.paidst in (’03’,’01’) and sp.pttype is not null and opn.presc_reason like ‘EF%’
or opn.presc_reason is not null
and op.icode in (‘1550090′,’1550271′,’1550056’) then ‘àºÔ¡äÁèä´é’
when op.paidst in (’03’) and op.icode=’3003012′

then ‘àºÔ¡äÁèä´é’
else round(d1.item_price,2) end)as paid2,
v1.pttype,v1.pcode,op.paidst,(sp.pttype)as payman,nd.billcode,op.icode,d1.*,v1.*,o1.*,oapp.nextdate,oapp.app_cause,
p.drugallergy,i1.name as pdx_name,
concat(hpc.hosptype,” “,hpc.name) as hpcna,
concat(hpc1.hosptype,” “,hpc1.name) as hpcna1,nd.billcode,

concat(‘ T = ‘,round(c.temperature),’ P = ‘,round(c.pulse),’ R = ‘,round(c.rr),’ BP = ‘,round(c.bps),
‘/’,round(c.bpd),’ Bw = ‘,round(c.bw),’ ¡ÔâÅ¡ÃÑÁ’ ) as vital,concat(‘á¾éÂÒ ‘,p.drugallergy)as drugall

from doctor_order_print d1
left outer join vn_stat v1 on v1.vn=d1.vn
left outer join ovst o1 on o1.vn=d1.vn
left outer join patient p on p.hn = v1.hn
left outer join icd101 i1 on i1.code=v1.main_pdx
left outer join hospcode hpc on hpc.hospcode=v1.hospmain
left outer join hospcode hpc1 on hpc1.hospcode=v1.hospsub
left join oapp on oapp.vn=d1.vn
left join opitemrece op on op.vn=d1.vn and op.icode=d1.icode
left join nondrugitems nd on nd.icode=op.icode
left outer join service_pay sp on sp.icode=d1.icode and sp.pttype=v1.pttype
left join ovst_presc_ned opn on opn.vn=d1.vn and opn.icode=d1.icode
left join opdscreen c on c.vn=v1.vn
where d1.vn=”580902102232″ and d1.print_server=”OPD”
group by opn.icode,opn.presc_reason,opn.presc_datetime,d1.drug_name,d1.doctor_order_print_code

ปิดการแสดงความเห็น