คิดว่ามีประโยชน์ เลยเอามาฝาก
1. ไฟล์เสียง มี 2 track บรรยาย และช่วงถามตอบ
การประชุมถ่ายทอดนโยบายด้านระบบข้อมูล 21 แฟ้ม ปี 55 วันที่ 10 มกราคม 2555 เจบี หาดใหญ่
2. วีดีโอ
ขอบคุณพีGWAGKไฟล์มาให้เป็นอย่างสูงครับ เป็นประโยชน์มหาศาลต่อข้อมูลสุภาพ และทำให้ผู้ที่เข้ามาดูได้รู้ทิศทางของ ข้อมูลสุขภาพจากผู้ที่ต้องการข้อมูลอย่างแท้จริง ทั้ง สนย.และ สปสช.
หน้าเว็บ
         
HOME |พรบ.คอม50|ชวนน้องสร้างบล็อค|สารสนเทศกับการเบิกจ่าย|ICD10มือใหม่|เวปบอร์ด|
วันพุธที่ 11 มกราคม พ.ศ. 2555
วันอาทิตย์ที่ 8 มกราคม พ.ศ. 2555
ไขปริศนา PP55
กิจกรรมที่ต้องบันทึกในระบบ HIS (JHCIS,Hos,Mitnet,xp) เพื่อให้ออกใน 21 แฟ้ม หากเราทำได้ลองเอาเลข 58.86 * ประขากรในเขตรับผิดชอบ ตาม slide ด้านล่าง
ร้อยทั้งร้อยในสตูลผมคิดว่ายังไม่มีสถานบริการไหนบันทึกกิจกรรมที่ว่านี้ ที่เรียกว่าไขปริศนาเพราะว่า เป็นเรื่องที่คิดว่าใหม่ สปสช. ใช้วิธีเอาข้อมูลจากรหัสโรคที่อยู่ใน op แต่ใช้รหัสที่เป็น pp ซึ่งใน 18 แฟ้มเดิม คำว่า PP หมายถึง EPI ANC FP MCH PP แต่ปี 55 ปรับแนวความคิดได้เลย เพราะฉนั้น วิธีการบันทึกจะต้องบันทึก แบบ OP packageนะครับ หมายถึง PERSON SERVICE DIAG ส่วน Addon DRUG หรือ Proced ห้ามมีใน record ที่มี SEQ นั้นเด้ดขาด
ทำไมถึงห้ามมี ?? ย่อมมีคนถาม ก็ต้องขอบอกว่า เรื่องนี้เป็นเรื่อง PP (ส่งเสริมป้องกัน) หากมีเรื่องยาหรือหัตถการเข้ามาเกี่ยวข้อง แน่นอนมันต้องเป็น เรื่องของ การรักษา ซึ่งเป็นเรื่อง OP ไม่ใช่ PP
สำหรับ สไลด์สุดท้าย ก่อนการบันทึก ในระบบ HIS ให้นึกหลัก 4R5Z ก่อนเสมอ
และ การคำนึงถึง อายุของประชากรตามช่วงกิจกรรม ตามสไลด์ลำดับ 2 และ EPI ANC FP MCH PP ไม่ควรมี รหัสใน แฟ้ม diag เพราะ สปสช.มองว่าเป็นการซ้ำซ้อน และมีโอกาสโดน pendingสูง
สรุปเรื่อง pp อีกครั้งนะครับ
1.มีเป้าหมายการทำงานที่ชัดเจนตามสไลด์ 2 เป็นกลุ่มๆ กันหลุด บางกิจกรรมนึกถึงคำว่า 1 คน 1 ครั้งต่อปี
2.ทำมาตราฐานการบันทึกตาม สไลด์ 4 ว่ากิจกรรมนี้ บันทึกรหัสโรคอะไร พยายามเปรียบเทียบกับเป้าหมายเรื่อย เอารหัสโรคที่ออกจาก diag มาพิจารณาดูบ่อยๆว่าครอบคลุม เพียงพอหรือยัง
3 เรื่องมะเร็งปากมดลูกยังใช้วิธีเดิมอยู่นะครับ ไม่รวมในวิธีนี้
เพราะฉนั้น pp 55 มองเป็น 21 แฟ้มคือ pp เดิม(EPI ANC FP MCH PP ) + PP ที่แฝงอยู่ใน OP ตามกิจกรรมที่ต้องบันทึก (4R5Z) + cirvical screening
ลืมอีกประเด็นคือ การscreen HTDM หล่ะ ปี 55 ทำอย่างไรก็ได้เพื่อมันจะอยู่ใน 21 แฟ้มที่ชื่อ screen 1 คน 1 ครั้ง ต่อปีและให้เอาเข้าไปใน provis ให้ได้
ขอให้สนุกกับการ บันทึกข้อมูลปี 55 นะครับ
ยังตกอีกประเด็นนึงครับ
หญิงตั้งครรภ์ และ หลังคลอด ANC PNC และ FP ตาม slide 2
เราเคยทราบหรือไม่ว่่า สปสช.เค้าคิดอย่างไร
ANC ประเด็นคือ น้อยกว่า 12 week ครั้งแรก UC และ สิทธิ์อื่นๆ ประกันสังคมที่ส่งเงิน สมทบไม่ครบ 7 เดือนก็ได้เยอะหน่อย (วันฝากครรภ์ครั้งแรก - ประจำเดือนครั้งสุดท้าย ) ควรเอาข้มูลเก่า(แฟ้ม ANC)มาวิเคราะห์และวางแผนการทำงานเรียนรู้วิธีคิดของ สปสช.ร่วมกับผู้รับผิดชอบงาน
PNC ก็ภายใน 6 สัปดาห์ (MCH กะ PP) วิเคราห์จากการตวจ opindiv data ก็คงจะพอเดาออกนะครับ (วันตรวจหลังคลอดครั้งที่ 1 - วันคลอด)
FP นี่เรื่อง สิทธิอื่นที่ มิใช่ UC อันนี่เท่าที่สอยมาเงินน้อยสุดเลยไม่น่าสนใจ
แต่หามเอาข้มูลประชากรมาเรียงตาม อายุ แล้ว เอากิจกรรมใส่เข้าไป ก็จะเห็นความคลอบคุมของ กิจกรรม ตามอายุ และสามารถตอบได้ว่า ประชาชนได้อะไร จากระบบ บริการ pp เหล่านี้
และผู้ให้บริการคงมีความสุขที่ได้ ผลงาน และ ผลตอบแทนของสปสช. ต่อสถานบริการที่ทำตามกติกา
หวังว่า ผู้ที่เข้ามาอ่าน คงได้ประโยชน์ไม่มากก็น้อย ตามมุมองของผมนะครับ
เพิ่มเติม เพราะคิดไว้อยู่ว่า ต้องมีคนถามต่อว่าแล้วจะคียอย่างไรหละ?
มีตัวอย่าง การคีย์ข้อมูลใน JHCIS เพื่อให้ได้แฟ้ม diag มีข้อมูลการให้รหัสโรค การคัดกรองโรคซึมเศร้า(Z13.3) หรือเรียกZ133 http://dl.dropbox.com/u/39217612/cmpho_it.pdf ก็เครดิตลุงหนวดเจ้าเก่า ส่วนเจ้าของไฟล์คือ สสจเชียงใหม่
หลักการ สิ่งที่ต้องเข้าใจก่อน คีย์ให้กับใคร ก็ต้องนึกย้อนกลับไปว่า ทะเบียนคัดกรองซึมเศร้า ทำในประชากรกลุ่ม > 30 และหรือ > 60 เพื่อไม่ให้พลาดกลุ่มเป้าหมายนะครับ และในคีย์ข้มูล ซัก 5 คนก่อนแล้วลงส่งออก 21 แฟ้ม เปิดหา แฟ้มที่ชื่อ diag ลองเปิดดูซักนิดกะ notepad ว่า มีคำว่า Z133 แ้ล้วหรือยัง แล้วที่มี ครบ 5 คนไหม (Ctrl+f) พิมพ์ Z133 ค้นหา >>ค้นหาถัดไป จนครบ 5 คน เท่านี้ก็จะไม่ตกหล่นแล้วครับ อย่าลืมทำให้ครอบคลุมนะครับ สำหรับค่ายอื่น และ การคีย์ อีก 4 Z กะ อีก 4R ก็ใช้หลักการเดียวกันกับ JHCIS
ถ้ามีอะไรใหม่ๆเกียวกับเรื่องนี้ก็ขอเขียนไปในบล้อคหัวข้อนี้เรื่อยๆนะครับ
เพิ่มเติม 25/01/2555 (ก้อบปี้มาจากลุงหนวดหมออนามัยเจ้าเก่า)
การลงรหัส ICD10 เพื่อให้รับค่าตอบแทน ส่งเสริมป้องกันโรค สปสช2555 ดังนี้
การประเมินพัฒนาการในเด็ก
(ตามแนวทางของกรมอนามัย) = Z 001 การตรวจสุขภาพเด็กตามปกติ
การคัดกรองความเสี่ยงต่อโรค(ในรายที่ทำ confirm screening)
... - Metabolic (HT / อ้วน) = Z 138 การตรวจคัดกรองพิเศษสำหรับโรคและความผิดปกติอื่นที่ระบุรายละเอียด ความผิดปกติของฟัน ความผิดปกติของต่อมไร้ท่อและเมตะบอลิก ไม่รวม โรคเบาหวาน
- DM = Z 131 การตรวจคัดกรองพิเศษสำหรับโรคเบาหวาน
Pre DM
(ค่า FBS ระหว่าง 100 -125 mg/dl
หรือ Postpandial blood glucose ระหว่าง 140-199 mg/dl )
R 730 ผลการตรวจสอบการทนต่อกลูโคสผิดปกติ
R731 ผลการตรวจระดับน้ำตาลในเลือดหลังอดอาหารผิดปกติ
R739 ระดับน้ำตาลในเลือดสูง ไม่ระบุรายละเอียด
Pre HT
(Pre HT คือค่า Systolic BP ระหว่าง 120-139 mmHg
หรือ Diastolic BP ระหว่าง 80-89 mmHg ) = R 030 วัดความดันโลหิตได้สูง ไม่มีการวินิจฉัยว่าเป็นความดันโลหิตสูง
การปรับเปลี่ยนพฤติกรรม = Z 713 การให้คำปรึกษาและการเฝ้าระวังด้านอาหาร
การคัดกรองภาวะซึมเศร้า = Z 133 การตรวจคัดกรองพิเศษสำหรับความผิดปกติทางจิตและพฤติกรรม ดูเพิ่มเติม
การประเมินพัฒนาการในเด็ก
(ตามแนวทางของกรมอนามัย) = Z 001 การตรวจสุขภาพเด็กตามปกติ
การคัดกรองความเสี่ยงต่อโรค(ในร
... - Metabolic (HT /
- DM = Z 131 การตรวจคัดกรองพิเศษสำหรับโรคเบ
Pre DM
(ค่า FBS ระหว่าง 100 -125 mg/dl
หรือ Postpandial blood glucose ระหว่าง 140-199 mg/dl )
R 730 ผลการตรวจสอบการทนต่อกลูโคสผิดป
R731 ผลการตรวจระดับน้ำตาลในเลือดหลั
R739 ระดับน้ำตาลในเลือดสูง ไม่ระบุรายละเอียด
Pre HT
(Pre HT คือค่า Systolic BP ระหว่าง 120-139 mmHg
หรือ Diastolic BP ระหว่าง 80-89 mmHg ) = R 030 วัดความดันโลหิตได้สูง ไม่มีการวินิจฉัยว่าเป็นความดัน
การปรับเปลี่ยนพฤติกรรม = Z 713 การให้คำปรึกษาและการเฝ้าระวังด
การคัดกรองภาวะซึมเศร้า = Z 133 การตรวจคัดกรองพิเศษสำหรับความผ
ป้ายกำกับ:
jhcis
วันศุกร์ที่ 23 ธันวาคม พ.ศ. 2554
รวบรวมคู่มือจาก JHCISลุงหนวด
ขอบคุณเจ้าของไฟล์ที่สร้างคู่มือไว้และขอบคุณลุงหนวดที่รวบรวมมาให้
1"provis 55
http://webboard.moph.go.th/board/viewtopic.php?f=3&t=1596
2.เอกสารคู่มือการลงข้อมูล การคัดกรอง HT DM ของงาน NCD ลุงหนวดเห็นว่าดีมีประโยชน์มาโห ลดไปอ่านเป็นแนวทางปฎิบัติกันคร ับ
http://dl.dropbox.com/u/ 39217612/ Screening%20DM%20HT%20Update.pd f
1"provis 55
http://webboard.moph.go.th/board/viewtopic.php?f=3&t=1596
2.เอกสารคู่มือการลงข้อมูล
http://dl.dropbox.com/u/
3"เปิดคอ ร์ส MySQL & Ireprot For JHCIS
สิ่งที่ต้องมีเป็นเอกสารและ โปรแกรมประกอบต้อง มี 3 อย่างคือ
- 1.คู่มือ MySQL For JHCIS http://neo.moph.go.th/
jhcis/MySQL-JHCIS.zip - 2.คู่มือ Ireport For ๋็JHCIS http://neo.moph.go.th/
jhcis/ireport-manual.zip
- 3.Navicat
- 4.iReport 2.0.0 ดาวน์โหลด >>> http://
webboard.moph.go.th/board/ files/iReport-2.0.0.zip
4.JHCIS v.15 ธ.ค.2554 ออกแล้วคร้าบบบ ตามลิ้งค์เลยครับ
5" การบันทึกข้อมูลใน JHCIS เพื่อให้สามารถส่งออกเพิ่ม 3 แฟ้ม สำหรับปีงบประมาณ 2555 ให้บันทึกฯ ดังนี้
1. แฟ้ม ncdscreen.txt => บันทึกที่เมนู .ระบบคัดกรองโรคไม่ติดต่อเรื้อร ัง.
2. แฟ้ม chronicfu.txt => บันทึกเพิ่มเติม ที่เมนู บริการ / คล...ิ้กที่ปุ่มฯ NCD Screen & FU
3. แฟ้ม labfu.txt => บันทึกเพิ่มเติม ที่เมนู บริการ ดังนี้
3.1 คลิ้กที่ปุ่ม นํ้าตาล (ได้รหัส Lab 01 - 04) ดังนี้
01=ตรวจนํ้าตาลในเลือด จากหลอดเลือดดำ (FBS) หลังอดอาหาร
02=ตรวจนํ้าตาลในเลือด จากหลอดเลือดดำ (FBS) โดยไม่อดอาหาร
03=ตรวจนํ้าตาลในเลือด จากเส้นเลือดฝอย (DTX) หลังอดอาหาร
04=ตรวจนํ้าตาลในเลือด จากเส้นเลือดฝอย (DTX) โดยไม่อดอาหาร
3.2 ที่แทร็บตรวจมะเร็ง & บริการอื่น / คลิ้กที่ปุ่มฯ การตรวจทางห้องปฏิบัติการอื่น …(ได้รหัส Lab 05 – 13 )
ที่เมนูบริการ คลิ้กเลือกแทร็บ ตรวจมะเร็ง & บริการอื่น / แล้วคลิ้กที่ปุ่มฯ การตรวจทางห้องปฏิบัติการอื่น (Trigriceride - ….) โดยข้อมูลจะบันทึกลงตาราง visitlabchcyhembmsse และได้ข้อมูลออกมาในแฟ้ม LABFU.txt ในคอลัมภ์ LABTEST ( รหัส 05 - 13) โดยรหัส 05 – 13 นี้จะอยู่ในกลุ่ม Lab Chemeclinic ( กลุ่ม Chemeclinic(เคมีคลีนิค) โดยรหัสแล็ป ขึ้นต้นด้วย CH ) ดังนี้
05 – CH99 -> HbA1c
06 – CH25 -> Triglyceride
07 – CH07 -> Total Cholesterol
08 – CH14 -> HDL Cholesterol
09 – CH17 -> LDL Cholesterol
10 – CH04 -> BUN
11 – CH09 -> Creatinine
12 – Cha1 -> albumin ในปัสสาวะ(Urine Protein)
13 – CHc1 -> Creatinine ในปัสสาวะ
โดยข้อมูลจะบันทึกลงตาราง visitlabsugarblood และได้ข้อมูลออกมาในแฟ้ม LABFU.txt ในคอลัมภ์ LABTEST
1. แฟ้ม ncdscreen.txt => บันทึกที่เมนู .ระบบคัดกรองโรคไม่ติดต่อเรื้อร
2. แฟ้ม chronicfu.txt => บันทึกเพิ่มเติม ที่เมนู บริการ / คล...ิ้กที่ปุ่มฯ NCD Screen & FU
3. แฟ้ม labfu.txt => บันทึกเพิ่มเติม ที่เมนู บริการ ดังนี้
3.1 คลิ้กที่ปุ่ม นํ้าตาล (ได้รหัส Lab 01 - 04) ดังนี้
01=ตรวจนํ้าตาลในเลือด จากหลอดเลือดดำ (FBS) หลังอดอาหาร
02=ตรวจนํ้าตาลในเลือด จากหลอดเลือดดำ (FBS) โดยไม่อดอาหาร
03=ตรวจนํ้าตาลในเลือด จากเส้นเลือดฝอย (DTX) หลังอดอาหาร
04=ตรวจนํ้าตาลในเลือด จากเส้นเลือดฝอย (DTX) โดยไม่อดอาหาร
3.2 ที่แทร็บตรวจมะเร็ง & บริการอื่น / คลิ้กที่ปุ่มฯ การตรวจทางห้องปฏิบัติการอื่น …(ได้รหัส Lab 05 – 13 )
ที่เมนูบริการ คลิ้กเลือกแทร็บ ตรวจมะเร็ง & บริการอื่น / แล้วคลิ้กที่ปุ่มฯ การตรวจทางห้องปฏิบัติการอื่น (Trigriceride - ….) โดยข้อมูลจะบันทึกลงตาราง visitlabchcyhembmsse และได้ข้อมูลออกมาในแฟ้ม LABFU.txt ในคอลัมภ์ LABTEST ( รหัส 05 - 13) โดยรหัส 05 – 13 นี้จะอยู่ในกลุ่ม Lab Chemeclinic ( กลุ่ม Chemeclinic(เคมีคลีนิค) โดยรหัสแล็ป ขึ้นต้นด้วย CH ) ดังนี้
05 – CH99 -> HbA1c
06 – CH25 -> Triglyceride
07 – CH07 -> Total Cholesterol
08 – CH14 -> HDL Cholesterol
09 – CH17 -> LDL Cholesterol
10 – CH04 -> BUN
11 – CH09 -> Creatinine
12 – Cha1 -> albumin ในปัสสาวะ(Urine Protein)
13 – CHc1 -> Creatinine ในปัสสาวะ
โดยข้อมูลจะบันทึกลงตาราง visitlabsugarblood และได้ข้อมูลออกมาในแฟ้ม LABFU.txt ในคอลัมภ์ LABTEST
6. อันนี้แถม เรื่อง การคิดราคายา ตามาตรฐานกรมบัญชีกลาง ปี 2547 หมวดค่ายาและอาหารทางเส้นเลือด เป็นไฟล์exel http://dl.dropbox.com/u/39249953/DrugPrice_Cal_011249_new.zip
7. เพิ่มเติม
1.แนวทางการให้รหัสโรค ICD-10 คัดกรองความเสี่ยงโรคเบาหวาน
http://203.157.229.23/09832/images/stories/document/dm-kiam.pdf
2.แนวทางการให้รหัสโรค ICD-10 คัดกรองความเสี่ยงโรคความดันโลหิต
http://203.157.229.23/09832/images/stories/document/ht-kiam.pdf
3.การคีย์ข้อมูลเยี่ยมหลังคลอดในโปรแกรม JHCIS
http://203.157.229.23/09832/images/stories/document/mch-kiam.pdf
4.การคีย์ข้อมูลแพทย์แผนไทยโปรแกรม JHCIS
http://203.157.229.23/09832/images/stories/document/ttm-kiam%20jhcis.pdf
5.แนวทางการให้รหัสโรคคัดกรอง ความเสี่ยง DM HT 2555 http://203.157.229.23/ 09832/images/stories/ document/dm%20ht.pdf
============================================
ลุงหนวดเห็นว่ามีประโยชน์ สำหรับเพื่อนสมาชิก นำไปพิมพ์และใช้เป็นคู่มือได้ครับ
ที่มา : โรงพยาบาลส่งเสริมสุขภาพตำบลแหลมโตนด จ.พัทลุง
1.แนวทางการให้รหัสโรค ICD-10 คัดกรองความเสี่ยงโรคเบาหวาน
http://203.157.229.23/09832/images/stories/document/dm-kiam.pdf
2.แนวทางการให้รหัสโรค ICD-10 คัดกรองความเสี่ยงโรคความดันโลหิต
http://203.157.229.23/09832/images/stories/document/ht-kiam.pdf
3.การคีย์ข้อมูลเยี่ยมหลังคลอดในโปรแกรม JHCIS
http://203.157.229.23/09832/images/stories/document/mch-kiam.pdf
4.การคีย์ข้อมูลแพทย์แผนไทยโปรแกรม JHCIS
http://203.157.229.23/09832/images/stories/document/ttm-kiam%20jhcis.pdf
5.แนวทางการให้รหัสโรคคัดกรอง
============================================
ลุงหนวดเห็นว่ามีประโยชน์ สำหรับเพื่อนสมาชิก นำไปพิมพ์และใช้เป็นคู่มือได้ครับ
ที่มา : โรงพยาบาลส่งเสริมสุขภาพตำบลแหลมโตนด จ.พัทลุง
ป้ายกำกับ:
jhcis
วันอังคารที่ 6 ธันวาคม พ.ศ. 2554
เป้่่าหมายตามกลุ่มอายุ
คุยกะลุงหนวดคุยไปคุยมาเลยได้เรื่อง sql เผื่อใครจะเอาไปเป็นเป้าหมายในการทำงาน ของ JHCIS ครับ
-------------------------------------------------------------------------------------------------------------
select house.villcode,village.villname as ชื่อหมู่บ้าน
#,pid,birth,getAgeYearNum(birth,current_date) as age,sex
,count(case when getAgeYearNum(birth,current_date) in ('0','1') and person.sex ='1' then 1 else null end) as "man0-1"
,count(case when getAgeYearNum(birth,current_date) in ('0','1') and person.sex ='2' then 1 else null end) as "weman0-1"
,count(case when getAgeYearNum(birth,current_date) in ('0','1') and person.sex IN ('1','2') then 1 else null end) as "sum0-1" #อายุแรกเกิด - 1ปี
,count(case when getAgeYearNum(birth,current_date) in ('0','1','2','3','4','5') and person.sex ='1' then 1 else null end) as "man0-5"
,count(case when getAgeYearNum(birth,current_date) in ('0','1','2','3','4','5') and person.sex ='2' then 1 else null end) as "weman0-5"
,count(case when getAgeYearNum(birth,current_date) in ('0','1','2','3','4','5') and person.sex IN ('1','2') then 1 else null end) as "sum0-5" #อายุแรกเกิด - 1ปี
,count(case when getAgeYearNum(birth,current_date) BETWEEN 6 AND 12 and person.sex ='1' then 1 else null end) as "man6-12"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 6 AND 12 and person.sex ='2' then 1 else null end) as "weman6-12"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 6 AND 12 and person.sex IN ('1','2') then 1 else null end) as "sum6-12"#อายุ 6 - 12ปี
,count(case when getAgeYearNum(birth,current_date) BETWEEN 13 AND 59 and person.sex ='1' then 1 else null end) as "man13-59"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 13 AND 59 and person.sex ='2' then 1 else null end) as "weman13-59"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 13 AND 59 and person.sex IN ('1','2') then 1 else null end) as "sum13-59" #อายุ 13 - 59ปี
,count(case when getAgeYearNum(birth,current_date) >= 60 and person.sex ='1' then 1 else null end) as "man60up"
,count(case when getAgeYearNum(birth,current_date) >= 60 and person.sex ='2' then 1 else null end) as "weman60up"
,count(case when getAgeYearNum(birth,current_date) >= 60 and person.sex IN ('1','2') then 1 else null end) as "sum60up" # อายู 60 ปีขึ้นไป
,count(case when getAgeYearNum(birth,current_date) >= 0 and person.sex ='1' then 1 else null end) as "Totel_man"
,count(case when getAgeYearNum(birth,current_date) >= 0 and person.sex ='2' then 1 else null end) as "Totel_weman"
,count(case when getAgeYearNum(birth,current_date) >= 0 and person.sex IN ('1','2') then 1 else null end) as "Totelsum" #ทุกคนในเขตรับผิดชอบ
#,count(person.pid) as Totle #รวมประชากร
FROM house INNER JOIN person ON person.hcode = house.hcode
INNER JOIN village ON village.villcode = house.villcode
WHERE birth is not null and person.mumoi not in('','0') AND village.villno <> 0 # คัดเลือกเฉพาะหมู่บ้านในเขตบริการ
AND ((person.dischargetype is null) OR (person.dischargetype != '1')) # คัดคนตายออกไป
GROUP BY house.villcode,village.villname
# ORDER BY house.villcode #ยังขาดความสมบูร์คือ ยอดรวม UNION
union
select '','รวม' as ชื่อหมู่บ้าน
#,pid,birth,getAgeYearNum(birth,current_date) as age,sex
,count(case when getAgeYearNum(birth,current_date) in ('0','1') and person.sex ='1' then 1 else null end) as "man0-1"
,count(case when getAgeYearNum(birth,current_date) in ('0','1') and person.sex ='2' then 1 else null end) as "weman0-1"
,count(case when getAgeYearNum(birth,current_date) in ('0','1') and person.sex IN ('1','2') then 1 else null end) as "sum0-1" #อายุแรกเกิด - 1ปี
,count(case when getAgeYearNum(birth,current_date) in ('0','1','2','3','4','5') and person.sex ='1' then 1 else null end) as "man0-5"
,count(case when getAgeYearNum(birth,current_date) in ('0','1','2','3','4','5') and person.sex ='2' then 1 else null end) as "weman0-5"
,count(case when getAgeYearNum(birth,current_date) in ('0','1','2','3','4','5') and person.sex IN ('1','2') then 1 else null end) as "sum0-5" #อายุแรกเกิด - 1ปี
,count(case when getAgeYearNum(birth,current_date) BETWEEN 6 AND 12 and person.sex ='1' then 1 else null end) as "man6-12"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 6 AND 12 and person.sex ='2' then 1 else null end) as "weman6-12"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 6 AND 12 and person.sex IN ('1','2') then 1 else null end) as "sum6-12"#อายุ 6 - 12ปี
,count(case when getAgeYearNum(birth,current_date) BETWEEN 13 AND 59 and person.sex ='1' then 1 else null end) as "man13-59"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 13 AND 59 and person.sex ='2' then 1 else null end) as "weman13-59"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 13 AND 59 and person.sex IN ('1','2') then 1 else null end) as "sum13-59" #อายุ 13 - 59ปี
,count(case when getAgeYearNum(birth,current_date) >= 60 and person.sex ='1' then 1 else null end) as "man60up"
,count(case when getAgeYearNum(birth,current_date) >= 60 and person.sex ='2' then 1 else null end) as "weman60up"
,count(case when getAgeYearNum(birth,current_date) >= 60 and person.sex IN ('1','2') then 1 else null end) as "sum60up" # อายู 60 ปีขึ้นไป
,count(case when getAgeYearNum(birth,current_date) >= 0 and person.sex ='1' then 1 else null end) as "Totel_man"
,count(case when getAgeYearNum(birth,current_date) >= 0 and person.sex ='2' then 1 else null end) as "Totel_weman"
,count(case when getAgeYearNum(birth,current_date) >= 0 and person.sex IN ('1','2') then 1 else null end) as "Totelsum" #ทุกคนในเขตรับผิดชอบ
#,count(person.pid) as Totle #รวมประชากร
FROM house INNER JOIN person ON person.hcode = house.hcode
INNER JOIN village ON village.villcode = house.villcode
WHERE birth is not null and person.mumoi not in('','0') AND village.villno <> 0 # คัดเลือกเฉพาะหมู่บ้านในเขตบริการ
AND ((person.dischargetype is null) OR (person.dischargetype != '1')) # คัดคนตายออกไป
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
select house.villcode,village.villname as ชื่อหมู่บ้าน
#,pid,birth,getAgeYearNum(birth,current_date) as age,sex
,count(case when getAgeYearNum(birth,current_date) in ('0','1') and person.sex ='1' then 1 else null end) as "man0-1"
,count(case when getAgeYearNum(birth,current_date) in ('0','1') and person.sex ='2' then 1 else null end) as "weman0-1"
,count(case when getAgeYearNum(birth,current_date) in ('0','1') and person.sex IN ('1','2') then 1 else null end) as "sum0-1" #อายุแรกเกิด - 1ปี
,count(case when getAgeYearNum(birth,current_date) in ('0','1','2','3','4','5') and person.sex ='1' then 1 else null end) as "man0-5"
,count(case when getAgeYearNum(birth,current_date) in ('0','1','2','3','4','5') and person.sex ='2' then 1 else null end) as "weman0-5"
,count(case when getAgeYearNum(birth,current_date) in ('0','1','2','3','4','5') and person.sex IN ('1','2') then 1 else null end) as "sum0-5" #อายุแรกเกิด - 1ปี
,count(case when getAgeYearNum(birth,current_date) BETWEEN 6 AND 12 and person.sex ='1' then 1 else null end) as "man6-12"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 6 AND 12 and person.sex ='2' then 1 else null end) as "weman6-12"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 6 AND 12 and person.sex IN ('1','2') then 1 else null end) as "sum6-12"#อายุ 6 - 12ปี
,count(case when getAgeYearNum(birth,current_date) BETWEEN 13 AND 59 and person.sex ='1' then 1 else null end) as "man13-59"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 13 AND 59 and person.sex ='2' then 1 else null end) as "weman13-59"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 13 AND 59 and person.sex IN ('1','2') then 1 else null end) as "sum13-59" #อายุ 13 - 59ปี
,count(case when getAgeYearNum(birth,current_date) >= 60 and person.sex ='1' then 1 else null end) as "man60up"
,count(case when getAgeYearNum(birth,current_date) >= 60 and person.sex ='2' then 1 else null end) as "weman60up"
,count(case when getAgeYearNum(birth,current_date) >= 60 and person.sex IN ('1','2') then 1 else null end) as "sum60up" # อายู 60 ปีขึ้นไป
,count(case when getAgeYearNum(birth,current_date) >= 0 and person.sex ='1' then 1 else null end) as "Totel_man"
,count(case when getAgeYearNum(birth,current_date) >= 0 and person.sex ='2' then 1 else null end) as "Totel_weman"
,count(case when getAgeYearNum(birth,current_date) >= 0 and person.sex IN ('1','2') then 1 else null end) as "Totelsum" #ทุกคนในเขตรับผิดชอบ
#,count(person.pid) as Totle #รวมประชากร
FROM house INNER JOIN person ON person.hcode = house.hcode
INNER JOIN village ON village.villcode = house.villcode
WHERE birth is not null and person.mumoi not in('','0') AND village.villno <> 0 # คัดเลือกเฉพาะหมู่บ้านในเขตบริการ
AND ((person.dischargetype is null) OR (person.dischargetype != '1')) # คัดคนตายออกไป
GROUP BY house.villcode,village.villname
# ORDER BY house.villcode #ยังขาดความสมบูร์คือ ยอดรวม UNION
union
select '','รวม' as ชื่อหมู่บ้าน
#,pid,birth,getAgeYearNum(birth,current_date) as age,sex
,count(case when getAgeYearNum(birth,current_date) in ('0','1') and person.sex ='1' then 1 else null end) as "man0-1"
,count(case when getAgeYearNum(birth,current_date) in ('0','1') and person.sex ='2' then 1 else null end) as "weman0-1"
,count(case when getAgeYearNum(birth,current_date) in ('0','1') and person.sex IN ('1','2') then 1 else null end) as "sum0-1" #อายุแรกเกิด - 1ปี
,count(case when getAgeYearNum(birth,current_date) in ('0','1','2','3','4','5') and person.sex ='1' then 1 else null end) as "man0-5"
,count(case when getAgeYearNum(birth,current_date) in ('0','1','2','3','4','5') and person.sex ='2' then 1 else null end) as "weman0-5"
,count(case when getAgeYearNum(birth,current_date) in ('0','1','2','3','4','5') and person.sex IN ('1','2') then 1 else null end) as "sum0-5" #อายุแรกเกิด - 1ปี
,count(case when getAgeYearNum(birth,current_date) BETWEEN 6 AND 12 and person.sex ='1' then 1 else null end) as "man6-12"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 6 AND 12 and person.sex ='2' then 1 else null end) as "weman6-12"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 6 AND 12 and person.sex IN ('1','2') then 1 else null end) as "sum6-12"#อายุ 6 - 12ปี
,count(case when getAgeYearNum(birth,current_date) BETWEEN 13 AND 59 and person.sex ='1' then 1 else null end) as "man13-59"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 13 AND 59 and person.sex ='2' then 1 else null end) as "weman13-59"
,count(case when getAgeYearNum(birth,current_date) BETWEEN 13 AND 59 and person.sex IN ('1','2') then 1 else null end) as "sum13-59" #อายุ 13 - 59ปี
,count(case when getAgeYearNum(birth,current_date) >= 60 and person.sex ='1' then 1 else null end) as "man60up"
,count(case when getAgeYearNum(birth,current_date) >= 60 and person.sex ='2' then 1 else null end) as "weman60up"
,count(case when getAgeYearNum(birth,current_date) >= 60 and person.sex IN ('1','2') then 1 else null end) as "sum60up" # อายู 60 ปีขึ้นไป
,count(case when getAgeYearNum(birth,current_date) >= 0 and person.sex ='1' then 1 else null end) as "Totel_man"
,count(case when getAgeYearNum(birth,current_date) >= 0 and person.sex ='2' then 1 else null end) as "Totel_weman"
,count(case when getAgeYearNum(birth,current_date) >= 0 and person.sex IN ('1','2') then 1 else null end) as "Totelsum" #ทุกคนในเขตรับผิดชอบ
#,count(person.pid) as Totle #รวมประชากร
FROM house INNER JOIN person ON person.hcode = house.hcode
INNER JOIN village ON village.villcode = house.villcode
WHERE birth is not null and person.mumoi not in('','0') AND village.villno <> 0 # คัดเลือกเฉพาะหมู่บ้านในเขตบริการ
AND ((person.dischargetype is null) OR (person.dischargetype != '1')) # คัดคนตายออกไป
-------------------------------------------------------------------------------------------
สมัครสมาชิก:
บทความ (Atom)



