DRUG_OPD
โครงสร้าง แฟ้ม DRUG_OPDDRUG_OPD
/*DIDSTD_error ตรวจสอบ รหัสยา 24 หลัก*/ /*! set names utf8*/; SELECT drugitems.icode, drugitems.`name`, drugitems.strength, drugitems.istatus, drugitems.did, length(drugitems.did)as'l' FROM drugitems WHERE istatus = 'Y' AND (LEFT(drugitems.did,5)=99999 or length(drugitems.did)<>24 or drugitems.did='' ) #================= |
ตัวอย่าง
icode | name | strength | istatus | did |
1520022 | Fuller Earth | 0 | Y | |
1520120 | K. Permanganate ด่างทับทิม | 0 | Y | |
1560013 | ครีมบัวบก [XENTELLA Cream] | 7 % | Y | |
1560014 | Morphine Syrup | 10 mg/5ml | Y |
/*รายการ ยาที่ไม่เชื่อมโยง Visit (service)*/ set @date1 ='2016-01-01',@date2='2016-01-10';/*เปลี่ยน '2013-07-13' ตามต้องการ*/ #------------------- SELECT os.vn, IF(o.hn is not null,concat(p.fname,space(1),p.lname),'ไม่พบvisit')as'patient', os.rxdate, os.icode, o.vn as 'ovst_vn' from opitemrece_summary as os left outer JOIN ovst as o on o.vn = os.vn left JOIN patient as p on p.hn =o.hn where rxdate BETWEEN @date1 and @date2 and o.vn is null ; #========== |
ตัวอย่าง
vn | patient | rxdate | icode | ovst_vn |
590101060001 | ไม่พบvisit | 2016-01-01 | 3120005 | |
590101060001 | ไม่พบvisit | 2016-01-01 | 3150011 | |
590102080349 | ไม่พบvisit | 2016-01-02 | 3120005 | |
590102080309 | ไม่พบvisit | 2016-01-02 | 3120005 |