ผู้เขียน หัวข้อ: ฝาก script ให้ golf_win ครับ  (อ่าน 6755 ครั้ง)

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

ออฟไลน์ Khuad

  • Hero Member
  • *****
  • กระทู้: 3,778
  • .. นางฟ้า ตัวไม่น้อยแล้ว ..
  • Respect: +10
    • ดูรายละเอียด
ฝาก script ให้ golf_win ครับ
« เมื่อ: มกราคม 17, 2011, 15:07:35 PM »
0

... ลองทดสอบดูก่อนนะ  พี่ทดสอบดูของพี่แล้วไม่ช้า

    ตรง and depcode in ("008","010","050")  ก็ใส่แผนกของจุด screen

    ตรง form_name = "Lab Checkup (DM)" ก็ใส่ชื่อฟอร์ม lab ที่เราใช้ส่งตรวจ
 
    ...  :D ....


var
  fvn,fcomputername,fdepartment,fhn : string;
  fdate_1,fdate_2,fdate_3 : string;
  DM_HN,HT_HN : string;
  tc : TClientDataset;

begin

  fvn := GetGlobalValue('VN');
  fcomputername := GetGlobalValue('CURRENT_COMPUTER');
  fdepartment := GetGlobalValue('CURRENT_DEPCODE');
  fhn := getsqldata('select hn from ovst where vn = "'+fvn+'" ');

  {==================== Screen ====================}
  if getsqldata('select depcode from kskdepartment where depcode = "'+fdepartment+'" '+
  'and depcode in ("008","010","050") ') = ''+fdepartment+''  then
    begin

        fdate_1 := formatdatetime('yyyy',getsqldata('select curdate()'));

      if getsqldata('select count(vn) as cc from ovst where vn = "'+fvn+'" '+
      'and month(vstdate) in ("10","11","12")') > 0 then
        begin
        fdate_2 := fdate_1+'-10-01" and "'+inttostr(strtoint(fdate_1) + 1)+'-09-30';
        fdate_3 := inttostr(strtoint(fdate_1) + 544);
        end
        else
        begin
        fdate_2 := inttostr(strtoint(fdate_1) - 1)+'-10-01" and "'+fdate_1+'-09-30';
        fdate_3 := inttostr(strtoint(fdate_1) + 543);
        end;

      DM_HN := getsqlsubquerydata('select hn from clinicmember where clinic = "001"');
      HT_HN := getsqlsubquerydata('select hn from clinicmember where clinic = "002"');
  {-------------------------------------------------------------------------------------------}
        if getsqldata('select count(distinct hn) as cc from clinicmember '+
        'where clinic = "001" and hn = "'+fhn+'" ') > 0 then
          begin
            if getsqldata('select count(*) as cc from lab_head '+
            'where report_date between "'+fdate_2+'"  '+
            'and hn = "'+getsqldata('select hn from ovst where vn = "'+fvn+'"')+'" '+
            'and hn in ('+DM_HN+') '+
            'and form_name = "Lab Checkup (DM)" ') > 0 then
            showmessage(' <<< เป็นผู้ป่วยในคลีนิคเบาหวาน  ได้รับการตรวจ Lab_Checkup(DM) ประจำปีงบประมาณ  '+fdate_3+'  นี้แล้ว >>> ')
            else
            showmessage(' <<< เป็นผู้ป่วยในคลีนิคเบาหวาน  ยังไม่เคยได้รับการตรวจ Lab_Checkup(DM) ประจำปีงบประมาณ  '+fdate_3+'  >>> ');
          end;
   {-------------------------------------------------------------------------------------------}
        if getsqldata('select count(*) as cc from ovstdiag where vn = "'+fvn+'" '+
        'and hn not in ('+DM_HN+') '+
        'and (icd10 between "E10" and "E1499")') > 0 then
          begin
            showmessage(' <<< ผู้ป่วยได้รับการ diag ว่าเป็นโรคเบาหวาน  แต่ยังไม่ได้ขึ้นทะเบียนผู้ป่วยคลีนิคเบาหวาน >>> ');
          end;
  {-------------------------------------------------------------------------------------------}
        if getsqldata('select count(*) as cc from ovstdiag where vn = "'+fvn+'" '+
        'and hn not in ('+HT_HN+') '+
        'and (icd10 between "I10" and "I1599")') > 0 then
          begin
            showmessage(' <<< ผู้ป่วยได้รับการ diag ว่าเป็นโรคความดันโลหิตสูง  แต่ยังไม่ได้ขึ้นทะเบียนผู้ป่วยคลีนิคความดันโลหิตสูง >>> ');
          end;

    end;


end;

โรงพยาบาลวังน้อย   พระนครศรีอยุธยา ( รพช.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

ออฟไลน์ SrWooD

  • Hero Member
  • *****
  • กระทู้: 1,024
  • Respect: +1
    • ดูรายละเอียด
Re: ฝาก script ให้ golf_win ครับ
« ตอบกลับ #1 เมื่อ: มกราคม 17, 2011, 16:22:09 PM »
0
ได้ผลอย่างไร แจ้งให้ทราบด้วยครับ จะได้นำไปใช้บ้าง

 ;D ;D ;D
โรงพยาบาลโพธิ์ทอง จังหวัดอ่างทอง

ออฟไลน์ Khuad

  • Hero Member
  • *****
  • กระทู้: 3,778
  • .. นางฟ้า ตัวไม่น้อยแล้ว ..
  • Respect: +10
    • ดูรายละเอียด
Re: ฝาก script ให้ golf_win ครับ
« ตอบกลับ #2 เมื่อ: มกราคม 17, 2011, 16:25:33 PM »
0
ได้ผลอย่างไร แจ้งให้ทราบด้วยครับ จะได้นำไปใช้บ้าง

 ;D ;D ;D

....  Work     ผมใช้แล้ว 
   
                ตอนนี้ระบบยังไม่ล่ม 55555555  ...  ;D ....
« แก้ไขครั้งสุดท้าย: มกราคม 17, 2011, 16:27:52 PM โดย Khuad »
โรงพยาบาลวังน้อย   พระนครศรีอยุธยา ( รพช.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

ออฟไลน์ golf_win

  • Hero Member
  • *****
  • กระทู้: 3,481
  • Respect: +112
    • ดูรายละเอียด
Re: ฝาก script ให้ golf_win ครับ
« ตอบกลับ #3 เมื่อ: มกราคม 17, 2011, 17:54:17 PM »
0
กำลังทดสอบกับ slav ครับ ;) ;)
โรงพยาบาลเจ็ดเสมียน จังหวัดราชบุรี
Start 19-1-51    35 station
HOSxP  3.59.5.18 Activate License
Tel. 032-305096-7 ต่อ 118
Web. http://csmhos.thaiddns.com:8080
         http://csmhos.thaieasydns.com:8080