มิถุนายน 2014
จ. อ. พ. พฤ. ศ. ส. อา.
« พ.ค.   ก.ค. »
 1
2345678
9101112131415
16171819202122
23242526272829
30  
มิถุนายน 2014
จ. อ. พ. พฤ. ศ. ส. อา.
« พ.ค.   ก.ค. »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

คลังเก็บรายวัน: มิถุนายน 25, 2014

ข้อมูล Hba1c < 7 สิทธ ucs diag e pdx&dx

select p.pttype,t.hipdata_code,o.hba1c,o.hn,o.vstdate,o.vn,s.pdx,s.dx0,s.dx1,s.dx2,s.dx3,s.dx4,s.dx5
from opdscreen o
join patient p on p.hn=o.hn
join pttype t on t.pttype=p.pttype
join vn_stat s on s.vn=o.vn
where (o.vstdate between ‘2013-10-01’ and ‘2014-06-31′)
and o.hba1c<7
and (t.hipdata_code=’UCS’)
and ((s.pdx like “e%”) or (s.dx0 like “e%”) or (s.dx2 like “e%”) or (s.dx3 like “e%”) or (s.dx4 like “e%”) or (s.dx5 like “e%”))
group by o.hn

 

select p.pttype,t.hipdata_code,o.hba1c,o.hn,o.vstdate,o.vn,s.pdx,s.dx0,s.dx1,s.dx2,s.dx3,s.dx4,s.dx5
from opdscreen o
join patient p on p.hn=o.hn
join pttype t on t.pttype=p.pttype
join vn_stat s on s.vn=o.vn
where (o.vstdate between ‘2013-10-01’ and ‘2014-06-31′)
and o.hba1c<>””
and (t.hipdata_code=’UCS’)
and ((s.pdx like “e%”) or (s.dx0 like “e%”) or (s.dx2 like “e%”) or (s.dx3 like “e%”) or (s.dx4 like “e%”) or (s.dx5 like “e%”))
group by o.hn

 

select p.pttype,t.hipdata_code,o.hba1c,o.hn,o.vstdate,o.vn,s.pdx,s.dx0,s.dx1,s.dx2,s.dx3,s.dx4,s.dx5
from opdscreen o
join patient p on p.hn=o.hn
join pttype t on t.pttype=p.pttype
join vn_stat s on s.vn=o.vn
where (o.vstdate between ‘2013-10-01’ and ‘2014-06-31’)
and o.hba1c<7
and ((s.pdx like “e%”) or (s.dx0 like “e%”) or (s.dx2 like “e%”) or (s.dx3 like “e%”) or (s.dx4 like “e%”) or (s.dx5 like “e%”))
group by o.hn

 

select p.pttype,t.hipdata_code,o.hba1c,o.hn,o.vstdate,o.vn,s.pdx,s.dx0,s.dx1,s.dx2,s.dx3,s.dx4,s.dx5
from opdscreen o
join patient p on p.hn=o.hn
join pttype t on t.pttype=p.pttype
join vn_stat s on s.vn=o.vn
where (o.vstdate between ‘2013-10-01’ and ‘2014-06-31’)
and o.hba1c<>””
and ((s.pdx like “e%”) or (s.dx0 like “e%”) or (s.dx2 like “e%”) or (s.dx3 like “e%”) or (s.dx4 like “e%”) or (s.dx5 like “e%”))
group by o.hn

 

 

select p.pttype,t.hipdata_code,o.hba1c,o.hn,o.vstdate,o.vn,o.bpd,o.bps,s.pdx,s.dx0,s.dx1,s.dx2,s.dx3,s.dx4,s.dx5
from opdscreen o
join patient p on p.hn=o.hn
join pttype t on t.pttype=p.pttype
join vn_stat s on s.vn=o.vn
where (o.vstdate between ‘2013-10-01’ and ‘2014-06-31′)
and (o.bps< 140 or o.bps <90)
and (t.hipdata_code=’UCS’)
and ((s.pdx like “i10”) or (s.dx0 like “i10”) or (s.dx2 like “i10”) or (s.dx3 like “i10”) or (s.dx4 like “i10”) or (s.dx5 like “i10”))
group by o.hn
order by o.vstdate desc

 

select p.pttype,t.hipdata_code,o.hba1c,o.hn,o.vstdate,o.vn,o.bpd,o.bps,s.pdx,s.dx0,s.dx1,s.dx2,s.dx3,s.dx4,s.dx5
from opdscreen o
join patient p on p.hn=o.hn
join pttype t on t.pttype=p.pttype
join vn_stat s on s.vn=o.vn
where (o.vstdate between ‘2013-10-01’ and ‘2014-06-31′)
and (o.bps< 140 or o.bps <90)
/* and (t.hipdata_code=’UCS’) */
and ((s.pdx like “i10”) or (s.dx0 like “i10”) or (s.dx2 like “i10”) or (s.dx3 like “i10”) or (s.dx4 like “i10”) or (s.dx5 like “i10”))
group by o.hn
order by o.vstdate desc

 

 

หาข้อมูล Admit สิทธิ uc ตาม รหัสโรค e

select pt.*,ov.*
from an_stat ov ,patient pt ,ipt ovst
where ov.an=ovst.an and ov.regdate between “2013-10-01” and “2014-06-25” and ov.hn=pt.hn
and ov.age_y>= 0
and ov.age_y<= 200
and ov.pcode in (
“A1″
,”AA”
,”AB”
,”AC”
,”AD”
,”AE”
,”AF”
,”AG”
,”AI”
,”AJ”
,”AK”
,”UB”
,”UC”
)
and ( (ov.pdx like “e%”)
)