BMS-HOSxP Community

HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: bbbas ที่ ธันวาคม 16, 2014, 13:53:38 PM

หัวข้อ: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: bbbas ที่ ธันวาคม 16, 2014, 13:53:38 PM
พอดีที่ รพ. ผม หมออยากให้มี popup แสดงโชว์ประวัติการได้รับวัคซีนอยู่ 2 ตัวครับ ที่หน้าจอห้องตรวจแพทย์ แต่ผมเองไม่เคยทำ จึงอยากขอคำแนะนำหรือวิธีการทำ popup ด้วยน่ะครับ หรือทางโรงพยาบาลใดทำไว้แล้ว ขอความอนุเคราะห์ด้วยน่ะครับ   ;D ;D ;D
หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: เกื้อกูล ครับ.. ที่ ธันวาคม 16, 2014, 16:29:36 PM
วัคซินอะไรกับวัคซินอะไรครับ
หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: เกื้อกูล ครับ.. ที่ ธันวาคม 16, 2014, 16:31:12 PM
เอาไปไว้ในตาราง ptnote สิครับ  ทำ SQL ไป  Insert  into ptnote where hn in xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: bbbas ที่ ธันวาคม 17, 2014, 09:04:57 AM
วัคซินอะไรกับวัคซินอะไรครับ
บาดทะยัก กับ verorab ครับพี่เกื้อ  :) :) :)

เอาไปไว้ในตาราง ptnote สิครับ  ทำ SQL ไป  Insert  into ptnote where hn in xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ขอขั้นตอนแบบละเอียดนิดนึงน่ะครับพี่ พอดียังไม่เคยทำเลยน่ะครับ  ;D ;D ;D
หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: golf_win ที่ ธันวาคม 17, 2014, 10:47:51 AM
แบบนี้หรือป่าวครับ  :D :D
หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: bbbas ที่ ธันวาคม 17, 2014, 11:25:41 AM
แบบนี้หรือป่าวครับ  :D :D
ครับผม แบบนี้เลยครับ ขอคำแนะนำด้วยครับ  ;D ;D ;D
หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: golf_win ที่ ธันวาคม 17, 2014, 11:34:31 AM
ใช้ sys_vn_pre_script ครับ
แต่เงื่อนไขผมจับจากหัตถการที่ระบบห้องฉุกเฉินที่ตั้งชื่อเป็น dT IM เข็ม 3 แบบนี้ครับ ถ้าไม่ได้ใช้แบบนี้ก็คงต้องคิดคำสั่งแบบนี้ในการตรวจสอบการฉีด dT
หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: bbbas ที่ ธันวาคม 17, 2014, 11:37:58 AM
ใช้ sys_vn_pre_script ครับ
แต่เงื่อนไขผมจับจากหัตถการที่ระบบห้องฉุกเฉินที่ตั้งชื่อเป็น dT IM เข็ม 3 แบบนี้ครับ ถ้าไม่ได้ใช้แบบนี้ก็คงต้องคิดคำสั่งแบบนี้ในการตรวจสอบการฉีด dT
ครับผม อืม..ผมขอเอาคำสั่งมาศึกษาดูได้มั้ยครับพี่ ผมไม่เคยทำมาก่อนเลยอ่ะครับ ยังไม่มีความรู้เลย แล้วการใช้ sys_vn_pre_script มีขั้นตอนหรือวิธีการทำอย่างไรครับ ขอคำแนะนำด้วยครับ  :) :) :)
หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: เกื้อกูล ครับ.. ที่ ธันวาคม 17, 2014, 11:40:17 AM
ใช้ sys_vn_pre_script ครับ
แต่เงื่อนไขผมจับจากหัตถการที่ระบบห้องฉุกเฉินที่ตั้งชื่อเป็น dT IM เข็ม 3 แบบนี้ครับ ถ้าไม่ได้ใช้แบบนี้ก็คงต้องคิดคำสั่งแบบนี้ในการตรวจสอบการฉีด dT
ครับผม อืม..ผมขอเอาคำสั่งมาศึกษาดูได้มั้ยครับพี่ ผมไม่เคยทำมาก่อนเลยอ่ะครับ ยังไม่มีความรู้เลย แล้วการใช้ sys_vn_pre_script มีขั้นตอนหรือวิธีการทำอย่างไรครับ ขอคำแนะนำด้วยครับ  :) :) :)


ไม่ต้องขอ... บอก ID  Teamviewer  มา เด๋ว อ.กอล์ฟไปทำให้ครับ..อิอิ
หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: golf_win ที่ ธันวาคม 17, 2014, 11:46:38 AM
ศึกษาจากกระทู้นี้ครับ http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=21592.0

ส่วน script ที่ผมใช้งานก็ตามนี้ครับ
var
  fvn,fcomputername,fdepartment,fhn : string;
  fdate_1,fdate_2,fdate_3 : string;
  tc : TClientDataset;
 dTDate, sdTDate : date;


begin
  //showmessage('TEST Script');

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


  // showmessage('Current VN = '+fvn+'  , Computer Name = '+fcomputername+' , Department Code = '+fdepartment);
    {==================== check TT ====================}
  if getsqldata('select depcode from kskdepartment where depcode in ("011","044","008") and depcode="'+fdepartment+'"')=''+fdepartment+'' then
  begin
     fhn:=getsqldata('select hn from ovst where vn = "'+fvn+'"');

     dTDate:=getsqldata('select o.vstdate from er_regist_oper e '+
                          'left outer join vn_stat o on o.vn=e.vn '+
                          'where o.hn = "'+fhn+'" and e.er_oper_code in ("148","266") order by o.vstdate desc limit 1 ');

     if getsqldata('select count(*) as cc from er_regist_oper e '+
                   'left outer join vn_stat o on o.vn=e.vn '+
                   'where o.hn = "'+fhn+'" and e.er_oper_code in ("148","266") ')>0 then
       begin
       sdTDate:=FormatDatetime('dd/mmm/eeee',dTDate);
       showmessage('[ ¼Ùé»èÇÂà¤Â©Õ´ÇѤ«Õ¹ Tetanus toxoid ËÃ×Í DIPHTHERIA-TETANUS à¢çÁ·Õè 3 ÁÒáÅéÇàÁ×èÍÇѹ·Õè '+sdTDate+' ]');
       end;
   end;

end;
หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: bbbas ที่ ธันวาคม 17, 2014, 11:56:26 AM
เดี่ยวผมขอศึกษาตามกระทู้ และขอลองนำคำสั่งของ อ.กอล์ฟมาปรับแต่งและใช้งานดูก่อนน่ะครับ หากติดขัดหรือไม่ได้อย่างไร จะมาขอคำแนะนำใหม่น่ะครับ  ;D ;D ;D (อ.กอล์ฟคับ ผมขอชื่อเฟส ได้มั้ยครับ เพื่อจะสอบถามผ่านทางเฟสครับ)
หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: bbbas ที่ ธันวาคม 17, 2014, 16:08:00 PM
อ.กอล์ฟ ผมเพิ่มโค้ดแบบนี้อ่ะครับ ถูกมั้ยครับ แต่อันที่ 2 ฉีดยา id ไม่ขึ้นครับ
{Unit Script;
var wd:tclientdataset;

Procedure Main;
begin
   if (GetGlobalValue('CURRENT_DEPCODE')='027')  or (GetGlobalValue('CURRENT_DEPCODE')='013')
     begin
       wd:=tclientdataset.create(nil);
       wd.data:=hosxp_getdataset('select * from ovst where vn="'+GetGlobalValue('VN')+'"');
       if wd.recordcount>0 then
          begin
              showmessage('Hospital Queue : '+wd.fieldbyname('oqueue').asstring+chr(10)+chr(10)
              +' Queue '+getsqldata('select department from kskdepartment where depcode="'+wd.fieldbyname('main_dep').asstring+'"')+' : '+wd.fieldbyname('main_dep_queue').asstring);
          end;
     end;
end;

end.}

var
  fvn,fcomputername,fdepartment,fhn : string;
  fdate_1,fdate_2,fdate_3 : string;
  tc : TClientDataset;
  dTDate, sdTDate : date;


begin
  //showmessage('TEST Script');

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


  // showmessage('Current VN = '+fvn+'  , Computer Name = '+fcomputername+' , Department Code = '+fdepartment);
    {==================== check TT ====================}
  if getsqldata('select depcode from kskdepartment where depcode in ("011",008) and depcode="'+fdepartment+'"')=''+fdepartment+'' then
  begin
     fhn:=getsqldata('select hn from ovst where vn = "'+fvn+'"');

     dTDate:=getsqldata('select o.vstdate from er_regist_oper e '+
                          'left outer join vn_stat o on o.vn=e.vn '+
                          'where o.hn = "'+fhn+'" and e.er_oper_code in ("412") order by o.vstdate desc limit 1 ');

     if getsqldata('select count(*) as cc from er_regist_oper e '+
                   'left outer join vn_stat o on o.vn=e.vn '+
                   'where o.hn = "'+fhn+'" and e.er_oper_code in ("412") ')>0 then
       begin
       sdTDate:=FormatDatetime('dd/mmm/eeee',dTDate);
       showmessage('[ ¼Ùé»èÇÂà¤Â©Õ´ÇѤ«Õ¹ºÒ´·ÐÂÑ¡ÁÒáÅéÇ àÁ×èÍÇѹ·Õè '+sdTDate+' ]');
       end;
   end;

   end;

var
  fvn,fcomputername,fdepartment,fhn : string;
  fdate_1,fdate_2,fdate_3 : string;
  tc : TClientDataset;
 dTDate, sdTDate : date;


begin
  //showmessage('TEST Script');

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


  // showmessage('Current VN = '+fvn+'  , Computer Name = '+fcomputername+' , Department Code = '+fdepartment);
    {==================== check TT ====================}
  if getsqldata('select depcode from kskdepartment where depcode in ("011","008") and depcode="'+fdepartment+'"')=''+fdepartment+'' then
  begin
     fhn:=getsqldata('select hn from ovst where vn = "'+fvn+'"');

     dTDate:=getsqldata('select o.vstdate from er_regist_oper e '+
                          'left outer join vn_stat o on o.vn=e.vn '+
                          'where o.hn = "'+fhn+'" and e.er_oper_code in ("224") order by o.vstdate desc limit 1 ');

     if getsqldata('select count(*) as cc from er_regist_oper e '+
                   'left outer join vn_stat o on o.vn=e.vn '+
                   'where o.hn = "'+fhn+'" and e.er_oper_code in ("224") ')>0 then
       begin
       sdTDate:=FormatDatetime('dd/mmm/eeee',dTDate);
       showmessage('[ ¼Ùé»èÇÂà¤Âä´éÃѺ¡ÒéմÂÒ ID àÁ×èÍÇѹ·Õè '+sdTDate+' ]');
       end;
   end;

end;

หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: golf_win ที่ ธันวาคม 17, 2014, 16:37:31 PM
ต้องประกาศตัวแปรใหม่ครับ เพราะมันซ้ำกับของเดิมครับ
หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: bbbas ที่ ธันวาคม 18, 2014, 09:05:42 AM
ต้องประกาศตัวแปรใหม่ครับ เพราะมันซ้ำกับของเดิมครับ
ยังไงครับพี่ ขอคำแนะนำด้วยครับ  :) :) :)
หัวข้อ: Re: ขอคำแนะนำเกี่ยวกับ popup ครับ
เริ่มหัวข้อโดย: golf_win ที่ ธันวาคม 22, 2014, 17:50:48 PM
แทรก code ใหม่ ต่อจาก code เดิมโดยที่ไม่ต้องเริ่มประกาศ var ใหม่ครับ ถ้าติดขัดก็ FB มาก็ได้ครับ