BMS-HOSxP Community

HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: ojt26 ที่ มีนาคม 10, 2015, 14:00:34 PM

หัวข้อ: Pop Up การตรวจ TC (total cholesterol)
เริ่มหัวข้อโดย: ojt26 ที่ มีนาคม 10, 2015, 14:00:34 PM
อยากให้ มี หน้าต่าง แจ้ง เตื่อน เมื่อใส่ HN ของผุ้ป่วยที่เข้ารับการรักษา ใน คลีนนิค อายุกรรม
เมนู ระบบผู้ป่วยนอก >> ห้่องตรวจโรค >> ระบบคัดกรอง และ
เมนู ระบบผู้ป่วยนอก >> ห้่องตรวจโรค >> ระบบห้องทำงานแพทย์
ซึ่งผม Load ไฟล์ SYS_VN_PRE_SCRIP และแทรกคำสั่งแต่ยังไม่แสดงผล ขอคำแนะนำด้วยน่ะครับ..

var
  fvn,fcomputername,fdepartment,fhn : string;
  tc : TClientDataset;

begin
 // showmessage('PRE-Script');

  fvn:= GetGlobalValue('VN');
  fcomputername := GetGlobalValue('CURRENT_COMPUTER');
  fdepartment := GetGlobalValue('CURRENT_DEPCODE');

if fdepartment='035' then // 035 คือคลินิคอายุกรรม
  begin
     fhn:=getsqldata('select hn from ovst where vn = "'+fvn+'"');

    if getsqldata('select l1.lab_order_result from lab_order l1 ' +
    ' left outer join lab_head l2 on l2.lab_order_number = l1.lab_order_number '+
    ' where l2.hn = "'+fhn+'" '+
    ' and l2.order_date between "2014-10-01" and now() '+
    ' and l1.lab_items_code = "102" and l1.lab_order_result > 0 ') then
    begin
      showmessage('มีการตรวจ TC แล้ว !');
    end;

   end;
end;



หัวข้อ: Re: Pop Up การตรวจ TC (total cholesterol)
เริ่มหัวข้อโดย: golf_win ที่ มีนาคม 10, 2015, 14:55:50 PM
var
  fvn,fcomputername,fdepartment,fhn : string;
  tc : TClientDataset;

begin
 // showmessage('PRE-Script');

  fvn:= GetGlobalValue('VN');
  fcomputername := GetGlobalValue('CURRENT_COMPUTER');
  fdepartment := GetGlobalValue('CURRENT_DEPCODE');

if fdepartment='035' then // 035 คือคลินิคอายุกรรม
  begin
     fhn:=getsqldata('select hn from ovst where vn = "'+fvn+'"');

    if getsqldata('select count(l2.vn) as cc from lab_order l1 ' +
    ' left outer join lab_head l2 on l2.lab_order_number = l1.lab_order_number '+
    ' where l2.hn = "'+fhn+'"  '+
    ' and l2.order_date between "2014-10-01" and now() '+
    ' and l1.lab_items_code = "102" and l1.lab_order_result>0  ')>0  then
    begin
      showmessage('มีการตรวจ TC แล้ว !');
    end;

   end;
end;