ธันวาคม 2014
จ. อ. พ. พฤ. ศ. ส. อา.
« พ.ย.   ม.ค. »
1234567
891011121314
15161718192021
22232425262728
293031  
ธันวาคม 2014
จ. อ. พ. พฤ. ศ. ส. อา.
« พ.ย.   ม.ค. »
1234567
891011121314
15161718192021
22232425262728
293031  

คลังเก็บรายวัน: ธันวาคม 1, 2014

ตรวจสอบ Accident ในการบันทึกข้อมูล

SELECT
o.vstdate,o.vsttime

,o.hn,CONCAT(p.pname,’ ‘,p.fname,’ ‘,p.lname) name
,o.cc,o.hpi,o.symptom,o.pe
,CONCAT(v.pdx,’ ‘,v.dx0,’ ‘,v.dx1,’ ‘,v.dx2,’ ‘,v.dx3,’ ‘,v.dx4,’ ‘,v.dx5) Diag
,ed.*

FROM er_regist er
INNER JOIN opdscreen o ON er.vn=o.vn
INNER JOIN er_nursing_detail ed ON ed.vn=er.vn
INNER JOIN patient p ON p.hn=o.hn
INNER JOIN vn_stat v ON v.vn=er.vn

WHERE er.er_pt_type=2 AND (
ISNULL(ed.arrive_time)
OR ISNULL(ed.trauma)
OR ISNULL(ed.bba)
OR ISNULL(ed.dba)
OR ISNULL(ed.psychic)
OR ISNULL(ed.revisit48hr)
OR ed.gcs_e<1
OR ed.gcs_v<1
OR ed.gcs_m<1
OR ISNULL(ed.pupil_l)
OR ISNULL(ed.pupil_r)
OR ISNULL(ed.inform_person)
OR ISNULL(ed.interview_person)
OR ISNULL(ed.report_doctor_time)
OR ISNULL(ed.doctor_finish_time)
OR ISNULL(ed.visit_type)
OR ISNULL(ed.transporter)
OR ISNULL(ed.er_accident_type_id)
OR ISNULL(ed.er_emergency_type)
OR ISNULL(ed.er_refer_sender_id)
OR ISNULL(ed.accident_in_province)
OR ISNULL(ed.accident_transport_type_id)
OR ISNULL(ed.o2sat)
OR ISNULL(ed.accident_place_type_id)
OR ISNULL(ed.accident_person_type_id)
OR ISNULL(ed.accident_alcohol_type_id)
OR ISNULL(ed.accident_drug_type_id)
OR ISNULL(ed.accident_airway_type_id)
OR ISNULL(ed.accident_bleed_type_id)
OR ISNULL(ed.accident_belt_type_id)
OR ISNULL(ed.accident_helmet_type_id)
OR ISNULL(ed.accident_splint_type_id)
OR ISNULL(ed.accident_fluid_type_id)
)
ORDER BY er.vstdate DESC
LIMIT 100