วันจันทร์ที่ 11 มกราคม พ.ศ. 2559

คำสั่งตรวจสอบรายงานการคัดกรอง และโรค ปี 2558

คำสั่งตรวจสอบรายงานการคัดกรอง และโรค ปี 2558

ขั้นตอนการดูรายงาน ให้ก๊อปคำสั่งไปวางใน sql query แล้วคลิก run


รายชื่อประชากร ที่อาจกรอกช้ำ ในงานคัดกรอง และ โรค ปี 2558
SELECT person.person_id,CONCAT(person.pname, person.fname," ",person.lname) AS `name`,
person.cid,ovstdiag.hn,ovstdiag.icd10,ovstdiag.vstdate,count(ovstdiag.hn)as ovstdiag2
FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z133" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY person.person_id HAVING ovstdiag2 >= 2
union
SELECT person.person_id,CONCAT(person.pname, person.fname," ",person.lname) AS `name`,
person.cid,ovstdiag.hn,ovstdiag.icd10,ovstdiag.vstdate,count(ovstdiag.hn)as ovstdiag2
FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z123" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY person.person_id HAVING ovstdiag2 >= 2
union
SELECT person.person_id,CONCAT(person.pname, person.fname," ",person.lname) AS `name`,
person.cid,ovstdiag.hn,ovstdiag.icd10,ovstdiag.vstdate,count(ovstdiag.hn)as ovstdiag2
FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z014" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY person.person_id HAVING ovstdiag2 >= 2
union
SELECT person.person_id,CONCAT(person.pname, person.fname," ",person.lname) AS `name`,
person.cid,ovstdiag.hn,ovstdiag.icd10,ovstdiag.vstdate,count(ovstdiag.hn)as ovstdiag2
FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z124" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY person.person_id HAVING ovstdiag2 >= 2
union
SELECT person.person_id,CONCAT(person.pname, person.fname," ",person.lname) AS `name`,
person.cid,ovstdiag.hn,ovstdiag.icd10,ovstdiag.vstdate,count(ovstdiag.hn)as ovstdiag2
FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z131" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY person.person_id HAVING ovstdiag2 >= 2
union
SELECT person.person_id,CONCAT(person.pname, person.fname," ",person.lname) AS `name`,
person.cid,ovstdiag.hn,ovstdiag.icd10,ovstdiag.vstdate,count(ovstdiag.hn)as ovstdiag2
FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z138" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY person.person_id HAVING ovstdiag2 >= 2

ผลงานโรค และการคัดกรอง ปี 2558

SELECT ovstdiag.icd10, count(person.sex)as total FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z001" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY ovstdiag.icd10
union
SELECT ovstdiag.icd10, count(person.sex)as total FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z012" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY ovstdiag.icd10
union
SELECT ovstdiag.icd10, count(person.sex)as total FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z108" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY ovstdiag.icd10
union
SELECT ovstdiag.icd10, count(person.sex)as total FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z133" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY ovstdiag.icd10
union
SELECT ovstdiag.icd10, count(person.sex)as total FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z123" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY ovstdiag.icd10
union
SELECT ovstdiag.icd10, count(person.sex)as total FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z014" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY ovstdiag.icd10
union
SELECT ovstdiag.icd10, count(person.sex)as total FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z124" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY ovstdiag.icd10
union
SELECT ovstdiag.icd10, count(person.sex)as total FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z131" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY ovstdiag .icd10
union
SELECT ovstdiag.icd10, count(person.sex)as total FROM ovstdiag INNER JOIN person ON person.patient_hn = ovstdiag.hn
WHERE ovstdiag.icd10 LIKE "Z138" AND ovstdiag.vstdate BETWEEN "2014-10-01" and "2015-06-30"
GROUP BY ovstdiag.icd10

cr.ชีวิต ต้องสู้

ไม่มีความคิดเห็น:

แสดงความคิดเห็น