คำสั่งครับให้สอ.เกิดคำ
DateTime : 2010-07-31 16:34:21
Post By : dogmike
IP Address :
ปรับสถานะเป็นโสด ถ้าไม่มีการระบุสถานะ
update patient set marrystatus='1' where marrystatus='' or marrystatus is null
update person set marrystatus='1' where marrystatus='' or marrystatus is null
เปลี่ยนคำนำหน้าชื่อเป็น ด.ช. โดยเช็คจาก ปีเกิด และ เพช
update patient set pname='ด.ช.' where (sex ='1') and (2010-year( birthday )<15)
update person set pname='ด.ช.' where (sex ='1') and (2010-year( birthdate )<15)
เปลี่ยนคำนำหน้าชื่อเป็น ด.ญ. โดยเช็คจาก ปีเกิด และ เพช
update patient set pname='ด.ญ.' where (sex ='2') and (2010-year( birthday )<15)
update person set pname='ด.ญ.' where (sex ='2') and (2010-year( birthdate )<15)
เปลี่ยนคำนำหน้าชื่อเป็น นาย โดยเช็คจาก ปีเกิด และ เพช
update patient set pname='นาย' where (sex ='1') and (2010-year( birthday )>14)
update person set pname='นาย' where (sex ='1') and (2010-year( birthdate )>14)
เปลี่ยนคำนำหน้าชื่อเป็น นางสาว โดยเช็คจาก ปีเกิด และ เพช และ marrystatus='1'
update patient set pname='นางสาว' where (sex ='2') and (2010-year( birthday )>14) and marrystatus='1'
update person set pname='นางสาว' where (sex ='2') and (2010-year( birthdate )>14) and marrystatus='1'
เปลี่ยนคำนำหน้าชื่อเป็น นาง โดยเช็คจาก ปีเกิด และ เพช และ marrystatus='2'
update patient set pname='นาง' where (sex ='2') and (2010-year( birthday )>14) and marrystatus='2'
update person set pname='นาง' where (sex ='2') and (2010-year( birthdate )>14) and marrystatus='2'
เปลี่ยนเชื้อชาติ สัญชาติ ศาสนา อาชีพ
update patient set nationality='99' where nationality='' or nationality is null //ไทย
update patient set citizenship='99' where citizenship = '' or citizenship is null //ไทย
update patient set religion='01' where religion= '' or religion is null //พุทธ
update patient set occupation = '503' where occupation = '' or occupation is null //ทำนา
update person set nationality='99' where nationality='' or nationality is null //ไทย
update person set citizenship='99' where citizenship = '' or citizenship is null //ไทย
update person set religion='01' where religion= '' or religion is null //พุทธ
update person set occupation = '503' where occupation = '' or occupation is null //ทำนา
บัญชี6 การคุมกำเนิดเซ็ตเป็น ไม่ได้คุมกำเนิด สาเหตุไม่คุมกำเนิดเซ็ตเป็น อื่นๆ
UPDATE person_women SET women_birth_control_id=8,last_update='2010-07-31 13:59:10',nofp_type_id=3 WHERE women_birth_control_id is null
Message !!
หากต้องการตอบกระทู้ Webboard กรุณาเข้าใช้ระบบก่อนนะค่ะ..
กระทู้ตอบกลับ
ขอบคุณสำหรับสิ่งดีๆ ขอให้เว็บแห่งนี้เป็นที่แบ่งปันความรู้ซึ่งกันและกันตลอดไป
Post โดย : nufc1980 Date: 2010-07-31 16:42:25 ip:
ใช้งานได้จริง ครับ และหวังเป็นอย่างยิ่งว่า พี่น้อง สอ. จะได้ใช้
ทำให้ 100 % แล้ว อย่างอื่น ๆ จะตามมา
Post โดย : สบู่เหลว Date: 2010-07-31 17:35:05 ip:
แก้นิดนึงครับ ตรงปรับคำนำหน้าชื่อ "นางสาว" นี่น่าจะไม่ถูกต้องเพราะรหัสคำนำหน้าชื่อสปสช.เขาใช้คำว่า "น.ส." ดังนั้นน่าจะเป็น
เปลี่ยนคำนำหน้าชื่อเป็น น.ส. โดยเช็คจาก ปีเกิด และ เพศ และ marrystatus='1'
update patient set pname='น.ส.' where (sex ='2') and (2010-year( birthday )>14) and marrystatus='1'
update person set pname='น.ส.' where (sex ='2') and (2010-year( birthdate )>14) and marrystatus='1'
ไม่งั้นเวลาส่งออกจากโปรแกรมมันจะเจอ Error ไม่พบรหัสคำนำหน้าชื่อ "นางสาว" ครับ
Post โดย : smakui Date: 2010-07-31 18:50:09 ip:
ขอบคุณ พี่smakui มากครับไม่น่าลืมเลยเรา
Post โดย : dogmike Date: 2010-07-31 21:08:26 ip:
แถมอีกหน่อยเพราะเคยเจอปัญหาแบบนี้ในหลายที่
เปลี่ยนคำนำหน้าชื่อจาก "เด็กชาย" เป็น "ด.ช."
update patient set pname = 'ด.ช.' where pname = 'เด็กชาย'
update person set pname = 'ด.ช.' where pname = 'เด็กชาย'
เปลี่ยนคำนำหน้าชื่อจาก "เด็กหญิง" เป็น "ด.ญ."
update patient set pname = 'ด.ญ.' where pname = 'เด็กหญิง'
update person set pname = 'ด.ญ.' where pname = 'เด็กหญิง'
และคำนำหน้าชื่ออื่น ๆ ที่ไม่ตรงกับรหัสคำนำหน้าชื่อของสปสช.ก็ใช้คำสั่งประมาณนี้ครับ
update patient set pname = 'XXXXX' where pname = 'YYYYYY'
เมื่อ 'XXXXX' คือคำนำหน้าชื่อที่ถูกต้องตามรหัสของสปสช.
และ 'YYYYY' คือคำนำหน้าชื่อที่ยังไม่ถูกต้องในฐานข้อมูลเรา
Post โดย : smakui Date: 2010-08-01 05:30:33 ip:
ขอบคุณ พี่ dogmike และ พี่ smakui ครับ สำหรับสิ่งที่ดีๆครับ หาวิธีทำอยู่ตั้งนานครับ
Post โดย : Tracker Date: 2010-08-09 12:03:29 ip:
ทำไมมันก็เป็นแบบที่เป็นบ่แม่น 5555
Post โดย : x industry Date: 2010-08-09 21:16:21 ip: