ผู้เขียน หัวข้อ: Script สำหรับ update public_note  (อ่าน 7717 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ naj

  • Hero Member
  • *****
  • กระทู้: 2,449
  • Respect: +8
    • ดูรายละเอียด
    • http://www.luangphopern-hospital.com
Script สำหรับ update public_note
« เมื่อ: พฤษภาคม 28, 2008, 14:35:10 PM »
0
สำหรับโรงพยาบาลที่ต้องมา update field public_note ของ ptnote table ให้สามารถแก้ไขได้

โค๊ด: Pascal
  1. program yindenaja;
  2. var
  3. tc:tclientdataset;
  4.  
  5.  
  6. begin
  7. tc:=tclientdataset.create(nil);
  8. tc.data :=hosxp_getdataset('select hn,public_note from ptnote where ((public_note like"") or (public_note is null)) ');
  9. while not tc.eof  do
  10. begin
  11. i:=i+1;
  12. tc.edit;
  13. tc.fieldbyname('public_note').asstring:='Y';
  14. tc.post;
  15. showdebugtext('HN =  '+tc.fieldbyname('hn').asstring+'    >>>>>>>>   Public_note change result '+tc.fieldbyname('public_note').asstring+'   OK');
  16. tc.next
  17. end;
  18.  if tc.changecount>0 then
  19.  hosxp_updatedelta(tc.delta,'select hn,public_note from ptnote where ((public_note like"") or (public_note is null)) ');
  20. tc.free;
  21.   showmessage('Process Done');
  22.  
  23.  
  24. end.
Yindee And Tan

doramon

  • บุคคลทั่วไป
Re: Script สำหรับ update public_note
« ตอบกลับ #1 เมื่อ: พฤษภาคม 28, 2008, 15:38:38 PM »
0
สุดยอด

ออฟไลน์ anukul

  • Hero Member
  • *****
  • กระทู้: 1,363
  • Respect: +1
    • ดูรายละเอียด
Re: Script สำหรับ update public_note
« ตอบกลับ #2 เมื่อ: มิถุนายน 02, 2008, 18:03:27 PM »
0
ใช้ยังไงครับ
 ???
รพ.มะการักษ์ 260 เตียง
เริ่มระบบ 1 ธค 48 (ทีม MN)
Database structure :HOSxP 3.55.9.21b
Client : 3.55.6.8-3.55.9.21b
Server : Double QuadCore XEON 3.2 G. ECC 18 G. SAS 146 G x4(Raid 5) -- CentOS 5.3 (64 bit) , MySQL 5.1.30 percana
Client : Win2000 ~ 200 clients
Module :
OPD -Register,Screening,Doctor,Dispense,Billing,Dentist,PMMR
IPD - Admit center,Ward,Nutrition,Dispense,LR,OR
LAB , X-ray
การเชื่อมต่อ : LIS             --> RAX
                    X-ray PACS --> Infinitt (ThaiGL)

doramon

  • บุคคลทั่วไป
Re: Script สำหรับ update public_note
« ตอบกลับ #3 เมื่อ: มิถุนายน 02, 2008, 22:32:22 PM »
0
ต้องกดปุ่ม  ด้านบนซ้ายครับ

execute   

ครับ

ออฟไลน์ naj

  • Hero Member
  • *****
  • กระทู้: 2,449
  • Respect: +8
    • ดูรายละเอียด
    • http://www.luangphopern-hospital.com
Re: Script สำหรับ update public_note
« ตอบกลับ #4 เมื่อ: มิถุนายน 03, 2008, 08:39:24 AM »
0
ขอโทษด้วยครับ ลืมบอกวิธีใช้
Yindee And Tan

ออฟไลน์ anukul

  • Hero Member
  • *****
  • กระทู้: 1,363
  • Respect: +1
    • ดูรายละเอียด
Re: Script สำหรับ update public_note
« ตอบกลับ #5 เมื่อ: มิถุนายน 03, 2008, 14:51:40 PM »
0
กด Exec แล้ว ขึ้น error บรรทัดที่  " ....i:=i+1;...."  ครับ

 ???
รพ.มะการักษ์ 260 เตียง
เริ่มระบบ 1 ธค 48 (ทีม MN)
Database structure :HOSxP 3.55.9.21b
Client : 3.55.6.8-3.55.9.21b
Server : Double QuadCore XEON 3.2 G. ECC 18 G. SAS 146 G x4(Raid 5) -- CentOS 5.3 (64 bit) , MySQL 5.1.30 percana
Client : Win2000 ~ 200 clients
Module :
OPD -Register,Screening,Doctor,Dispense,Billing,Dentist,PMMR
IPD - Admit center,Ward,Nutrition,Dispense,LR,OR
LAB , X-ray
การเชื่อมต่อ : LIS             --> RAX
                    X-ray PACS --> Infinitt (ThaiGL)

ออฟไลน์ naj

  • Hero Member
  • *****
  • กระทู้: 2,449
  • Respect: +8
    • ดูรายละเอียด
    • http://www.luangphopern-hospital.com
Re: Script สำหรับ update public_note
« ตอบกลับ #6 เมื่อ: มิถุนายน 03, 2008, 14:55:55 PM »
0
code อันใหม่ครับ
โค๊ด: Delphi
  1. program yindeenaja;
  2. var
  3. tc:tclientdataset;
  4.  
  5. begin
  6. tc:=tclientdataset.create(nil);
  7. tc.data :=hosxp_getdataset('select hn,public_note from ptnote where ((public_note like"") or (public_note is null)) ');
  8. while not tc.eof  do
  9. begin
  10. tc.edit;
  11. tc.fieldbyname('public_note').asstring:='Y';
  12. tc.post;
  13. showdebugtext('HN =  '+tc.fieldbyname('hn').asstring+'    >>>>>>>>   Public_note change result '+tc.fieldbyname('public_note').asstring+'   OK');
  14. tc.next
  15. end;
  16.  if tc.changecount>0 then
  17.  hosxp_updatedelta(tc.delta,'select hn,public_note from ptnote where ((public_note like"") or (public_note is null)) ');
  18. tc.free;
  19.   showmessage('Process Done');
  20.  
  21.  
  22. end.
  23.  
« แก้ไขครั้งสุดท้าย: มิถุนายน 03, 2008, 14:58:09 PM โดย naj »
Yindee And Tan

ออฟไลน์ anukul

  • Hero Member
  • *****
  • กระทู้: 1,363
  • Respect: +1
    • ดูรายละเอียด
Re: Script สำหรับ update public_note
« ตอบกลับ #7 เมื่อ: มิถุนายน 03, 2008, 15:32:58 PM »
0
เยี่ยมมากครับ อ.naj  เรียบร้อยแล้วครับ ประมาณ 7000 กว่า records

 ;D
รพ.มะการักษ์ 260 เตียง
เริ่มระบบ 1 ธค 48 (ทีม MN)
Database structure :HOSxP 3.55.9.21b
Client : 3.55.6.8-3.55.9.21b
Server : Double QuadCore XEON 3.2 G. ECC 18 G. SAS 146 G x4(Raid 5) -- CentOS 5.3 (64 bit) , MySQL 5.1.30 percana
Client : Win2000 ~ 200 clients
Module :
OPD -Register,Screening,Doctor,Dispense,Billing,Dentist,PMMR
IPD - Admit center,Ward,Nutrition,Dispense,LR,OR
LAB , X-ray
การเชื่อมต่อ : LIS             --> RAX
                    X-ray PACS --> Infinitt (ThaiGL)

ออฟไลน์ naj

  • Hero Member
  • *****
  • กระทู้: 2,449
  • Respect: +8
    • ดูรายละเอียด
    • http://www.luangphopern-hospital.com
Re: Script สำหรับ update public_note
« ตอบกลับ #8 เมื่อ: มิถุนายน 10, 2008, 09:27:24 AM »
0
แก้ไขเพิ่มเติมให้แสดง ลำดับที่ และ สรุปจำนวนรายการที่แก้ไขครับ จะได้ดูง่ายขึ้น
โค๊ด: Delphi
  1. program yindeenaja;
  2. var
  3. tc:tclientdataset;
  4. i:integer;
  5.  
  6. begin
  7. i:=0;
  8. tc:=tclientdataset.create(nil);
  9. tc.data :=hosxp_getdataset('select hn,public_note from ptnote where ((public_note like"") or (public_note is null)) ');
  10. while not tc.eof  do
  11. begin
  12. i:= i+1;
  13. tc.edit;
  14. tc.fieldbyname('public_note').asstring:='Y';
  15. tc.post;
  16. showdebugtext('ÅӴѺ·Õè '+inttostr(i)+' HN =  '+tc.fieldbyname('hn').asstring+'    >>>>>>>>   Public_note change result '+tc.fieldbyname('public_note').asstring+'   OK');
  17. tc.next
  18. end;
  19.  if tc.changecount>0 then
  20.  hosxp_updatedelta(tc.delta,'select hn,public_note from ptnote where ((public_note like"") or (public_note is null)) ');
  21.  showdebugtext('...........................................................................');
  22.  showdebugtext('ÃÇÁ·Ñé§ÊÔé¹  '+inttostr(tc.recordcount)+' ÃÒ¡ÒÃ');
  23. tc.free;
  24.  
  25.   showmessage('Process Done');
  26.  
  27.  
  28. end.
  29.  
Yindee And Tan

ออฟไลน์ Khuad

  • Hero Member
  • *****
  • กระทู้: 3,778
  • .. นางฟ้า ตัวไม่น้อยแล้ว ..
  • Respect: +10
    • ดูรายละเอียด
Re: Script สำหรับ update public_note
« ตอบกลับ #9 เมื่อ: มิถุนายน 10, 2008, 09:42:08 AM »
0

..ขอบคุณ อ.นาจ  มากครับ... :D...

..ยกนิ้วให้เลยครับ... ;)....
โรงพยาบาลวังน้อย   พระนครศรีอยุธยา ( รพช.30 เตียง )
Server : ProLiant DL120G6  Xeon X3450  RDIMM 12 Gb  2x256GB SSD Raid 1
OS : CentOS 6.3  DB : Percona 5.5.21

Slave : ProLiant ML110G6  Xeon X3430  UDIMM 8 Gb  2x300GB SAS Raid 1
OS : CentOS 6.3  DB : Percona 5.5.32

HOSxP version  3.57.xx.xx    เริ่มระบบ  เมษายน 2549