BMS-HOSxP Community
HOSxP => MySQL => ข้อความที่เริ่มโดย: nahos ที่ กันยายน 13, 2010, 11:35:26 AM
-
ขอคำสั่ง sql ดึง icd9 ที่มีการใช้ครับ
คอนเซป
ต้องการดึง รหัส และ name icd9 ที่มีการใช้งาน (มีการบันทึก)
โดยให้เรียงลำดับจากที่มีการใช้มาก ไปจนถึงน้อยที่สุด
ตัดรายการที่ไม่มีการลงใช้ออก
จุดประสงค์
อยากจะปรับแก้รายการ หัตถการ ER ใหม่
โดยจะจะผูก icd9 กับ er_oper_code แบบ 1:1
ซึ่งคิดว่าจะทำให้การส่งออก 18 แฟ้มมากยิ่งขึ้น
ขอบคุณครับ
-
1:1 จะเป็นไปได้หรือไม่ครับ....เช่น หากผมกำหนดเพื่อนับกิจกรรม suture จราจร กับ suture clean wound ก็คงใช้ ICD9 ตัวเดียวกันครับ
-
ขอคำสั่ง sql ดึง icd9 ที่มีการใช้ครับ
... ท่าน nahos ลองประมาณนี้ดูนะครับ
select icd10,count(icd10) as Count_icd9
from ovstdiag where vstdate between '2010-07-01' and '2010-07-31'
and icd10 between '0' and '9999'
group by icd10
order by Count_icd9 desc
... ปล. แต่จะมาทั้งหมดเลยนะครับ
และ join ชื่อเพิ่มเองนิดนะครับ .. ;D ;D ....
-
ขอคำสั่ง sql ดึง icd9 ที่มีการใช้ครับ
... ท่าน nahos ลองประมาณนี้ดูนะครับ
select icd10,count(icd10) as Count_icd9
from ovstdiag where vstdate between '2010-07-01' and '2010-07-31'
and icd10 between '0' and '9999'
group by icd10
order by Count_icd9 desc
... ปล. แต่จะมาทั้งหมดเลยนะครับ
และ join ชื่อเพิ่มเองนิดนะครับ .. ;D ;D ....
ขอบคุณครับ รับไปเลย 100 point
-
... ถ้าต้องการเฉพาะห้อง ER ก็แบบนี้ครับ ...
select eoc.icd9cm,i9.name,count(eoc.icd9cm) as Count_icd9
from er_regist_oper ero
left outer join ovst o on o.vn = ero.vn
left outer join er_oper_code eoc on eoc.er_oper_code = ero.er_oper_code
left outer join icd9cm1 i9 on i9.code = eoc.icd9cm
where o.vstdate between '2010-07-01' and '2010-07-31'
group by eoc.icd9cm
order by Count_icd9 desc
... :D ...
... ปล. คำตอบนี้เปลี่ยนจาก point เป็นตังค์นะครับท่านเจษ อิ อิ ... ;D ....