กันยายน 2013
จ. อ. พ. พฤ. ศ. ส. อา.
« ส.ค.   ต.ค. »
 1
2345678
9101112131415
16171819202122
23242526272829
30  
กันยายน 2013
จ. อ. พ. พฤ. ศ. ส. อา.
« ส.ค.   ต.ค. »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

คลังเก็บรายวัน: กันยายน 16, 2013

ตรวจสอบข้อมูลคนไข้ เสียชีวิต แต่ยังอยู่ใน คลีนิคผู้ป่วยเบาหวานความดัน <>2

select person.cid,person.pname,person.fname,person.lname,clinicmember.clinic_member_status_id,person.death,
patient.hn
from person
inner join clinicmember on person.patient_hn=clinicmember.hn
inner join patient on person.cid=patient.cid
where person.death=”y” and clinicmember.clinic_member_status_id <>2
group by cid

 

 

ดึงข้อมูลจาก clinic มาแก้ไข clinic_member_status_id ให้ 2

select clinicmember_id,clinic,hn,clinic_member_status,regedit

from clinicmember

where hn=’xxxxxxx’ and clinic_member_status_id <>2

หาผู้ป่วยที่มาทำบัตรใหม่กับ รพ. ของเรา ในช่วงเวลาที่กำหนด

select * from patient pt
inner join ovst ov on pt.hn=ov.hn
where (ov.vstdate between ‘2012-11-01’ and ‘2013-08-31’ ) and ( pt.firstday between ‘2012-11-01’ and ‘2013-08-31’)
group by pt.hn