####History###
SELECT SUBSTR(o.history,LOCATE('CHIEF COMPLAINT',o.history),LOCATE('PRESENT ILLNESS',o.history)-
LOCATE('CHIEF COMPLAINT',o.history))
FROM opd_visits o
WHERE o.visit_id in ('0002250117','0002250119')
/////ตัดอักขระพิเศษ
SELECT o.VISIT_ID as seq , replace(replace(replace(SUBSTR(o.history,LOCATE('PRESENT ILLNESS',o.history)+17) ,char(13),''),char(10),''),'""','') as hpi FROM opd_visits o WHERE o.visit_id = '${seq}' group by o.visit_id
######ตรวจร่างกาย#######
SELECT o.VISIT_ID as seq , replace(replace(replace(o.pexam,char(13),''),char(10),''),'""','') as pe FROM opd_visits o WHERE o.visit_id = '${seq}' group by o.visit_id
ไม่มีความคิดเห็น:
แสดงความคิดเห็น