แสดงกระทู้

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - iisomi

หน้า: 1 [2]
51
Report Exchange / Re: Export report แล้ว error
« เมื่อ: พฤศจิกายน 07, 2009, 09:24:16 AM »
ขอบคุณค่ะ  ยังไม่รู้จะทำไงเลยค่ะทำรายงานไว้ด้วย

52
Report Exchange / Export report แล้ว error
« เมื่อ: พฤศจิกายน 06, 2009, 20:13:31 PM »
คือจะทำการ export report ค่ะแต่ขึ้น error ไม่สามารถ export ได้
ไม่ทรายว่าเป็นที่อะไรเพราะใช้ window 7 รึป่าวค่ะแล้วมีวิธีแก้ยังไงค่ะขอบคุณค่ะ

53
การเขียน SQL Script / Re: ดึงรายงาน ตอบกลับ refer ค่ะ
« เมื่อ: พฤศจิกายน 06, 2009, 08:12:07 AM »
unit MyIPDReport;

function getsqlsubquerydatax(sql:string):string;
begin
  result:='';
  zquery.close;
  zquery.sql.text:=sql;
  zquery.open;
  zquery.first;
    while not zquery.eof do
    begin
       if result='' then result:=''''+zquery.fields[0].asstring+'''' else
       result:=result+','''+zquery.fields[0].asstring+'''';

       zquery.next;
    end;
  zquery.close;
    if result='' then result:='''''';

end;

procedure main;
var d1,d2:tdatetime;
people_distinct_count1 : integer;
people_count1 : integer;
ds1,ds2:string;
pttype_list1 : string;
pttype,pttype_name:string;
hospcode_list:string;
money1:currency;
i:integer;
occu:string;

begin
   showmessage('à¡ÕèÂǡѺÃÒ§ҹ'+#13+'Custom OPD-NK2-PK');

   pttype:= getpickuplist('select name from pttype where isuse="Y" order by name');
   if pttype='' then exit;

   pttype_name:=pttype;

   pttype:=getsqldata('select pcode from pttype where name="'+pttype+'"');
   if pttype='UA' then pttype:='UC';
   if pttype='UB' then pttype:='UC';

   if pttype='UC' then pttype_name:=getsqlsubquerydata('select name from pttype where pcode in ("UC","UA","UB")') else
    pttype_name := getsqlsubquerydata('select name from pttype where pcode="'+pttype+'"');

   showmessage('use pcode = '+pttype);

   if not getdaterange() then exit;
   d1:=date_result1();
   d2:=date_result2();

  // showmessage(formatdatetime('yyyy-mm-dd',d1)+' - '+
   //  formatdatetime('yyyy-mm-dd',d2));

   ds1:=formatdatetime('yyyy-mm-dd',d1);
   ds2:=formatdatetime('yyyy-mm-dd',d2);


   hospcode_list:=getsqlsubquerydata('select distinct hospmain from vn_stat where pcode = "'+pttype+'" and vstdate between "'+ds1+'" and "'+ds2+'" ');
   hospcode_list := getpickuplist('select concat(hospcode,":",hosptype," ",name) as name from hospcode where hospcode in ('+
     hospcode_list+') ');

   zquery.sql.text:='delete from tempreport where id = "CUSTOM-NK1OPD-PK" ';
   zquery.execsql;
   fcds.close;
   fcds.datarequest('select * from tempreport where id = "CUSTOM-NK1OPD-PK" ');
   fcds.open;

   fcds2.close;
   if hospcode_list='' then
   fcds2.datarequest('select * from vn_stat where pcode = "'+pttype+'" and vstdate between "'+ds1+'" and "'+ds2+'" order by vn ')
   else
   fcds2.datarequest('select * from vn_stat where pcode = "'+pttype+'" and vstdate between "'+ds1+'" and "'+ds2+'" '+
   ' and hospmain="'+copy(hospcode_list,1,5)+'" order by vn ');
   fcds2.open;
   setstatuslabel('Open result : '+inttostr(fcds2.recordcount)+' Records');
   fcds2.first;
   i:=0;
   while not fcds2.eof do
   begin
    i:=i+1;
    setprogressbar(i,fcds2.recordcount);
     fcds.insert;
   fcds['id']:='CUSTOM-NK1OPD-PK';
   fcds['reportname']:='CUSTOM-NK1OPD-PK';
  // fcds['name']:=fcds2['vn'];
   fcds['name1']:=pttype_name;

   fcds['name2']:=getsqldata('select concat(pname,fname,"  ",lname) as name from patient where hn="'+
      fcds2['hn']+'"');
   fcds['name3']:=fcds2['hn'];
   fcds['name4']:=fcds2['pttypeno'];
   fcds['date3']:=fcds2['pttype_expire'];
   fcds['name5']:=getsqldata('select concat(name,", ",hosptype) as name from hospcode where hospcode="'+
     fcds2['hospmain']+'"');

   occu:=getsqldata('select occupation from patient where hn="'+fcds2['hn']+'"');
   if occu<>'' then
   occu:=getsqldata('select name from occupation where occupation="'+occu+'"');

   fcds['name6']:=occu;
   if fcds2['sex']='1' then
     fcds['name7']:='&ordf;' else
     fcds['name7']:='&shy;';
   fcds['num1']:=fcds2['age_y'];
   fcds['name8']:=fcds2['pdx']+' '+fcds2['dx0'];
   fcds['name9']:=fcds2['op0']+' '+fcds2['op1'];
   fcds['name']:=getsqldata('select i_refer_number from ovst where vn="'+fcds2['vn']+'"');

   // finance summary

   fcds['mon1']:=fcds2['inc01'];
   fcds['mon2']:=fcds2['inc02'];
   fcds['mon3']:=fcds2['inc03'];
   fcds['mon4']:=fcds2['inc04'];
   fcds['mon5']:=fcds2['inc05'];
   fcds['mon6']:=fcds2['inc06'];
   fcds['mon7']:=fcds2['inc13'];
   fcds['mon8']:=fcds2['inc07'];
   fcds['mon9']:=fcds2['inc12'];
   fcds['mon10']:=fcds2['inc14']+fcds2['inc08']+fcds2['inc09']+fcds2['inc10']+
                  fcds2['inc11']+fcds2['inc15']+
                  fcds2['inc16']+fcds2['inc17'];
   fcds['mon11']:=fcds2['income'];


   fcds['date1']:=d1;
   fcds['date2']:=d2;
   fcds['date4']:=fcds2['vstdate'];
   fcds.post;
     fcds2.next;
   end;

   fcds.datarequest('select * from tempreport where id = "CUSTOM-NK1OPD-PK" ');
   applyupdate_fcds();

end;

end.



ขอบคุณอาจารย์ทุกท่านค่ะเพิ่งรู้ค่ะว่าคำสั่งอยู่ตรงนี้แต่พยายามไล่ดูแล้วก็ไม่เข้าใจสักทีทำไมรหัสแพทญืไม่ออกค่ะ รบกวนด้วยนะค่ะ

54
การเขียน SQL Script / Re: ดึงรายงาน ตอบกลับ refer ค่ะ
« เมื่อ: พฤศจิกายน 05, 2009, 18:51:49 PM »
ขอบคุณอาจารย์ทุกๆท่านค่ะเดียวพรุ่งนี้จะไปลองดูค่ะ
ผลยังไงจะมารบกวนอีกนะค่ะ...

อีกคำถามนะค่ะอันนี้งงสุดๆค่ะ จากรายงานCUSTOM-แบบรายการค่ารักษาพยาบาลผู้ป่วยนอก ประกันสังคม (นค 1)  มีคำสั่งดังนี้  select t.* from tempreport t

 where t.id = "CUSTOM-NK1OPD-PK"  หนูอยากทราบว่าคำสั่งเรียกCUSTOM-NK1OPD-PK จากไหนค่ะตามรูป รหัสแพทย์ไม่ขึ้นอ่ะค่ะเท่าที่เข้าใจน่าจะในตารางที่เรียกมาดูแล้วไม่มีข้อมูลไม่ทราบว่าต้องแก้ไขอย่างไรให้รหัสแพทย์ขึ้นมาด้วยค่ะ

55
การเขียน SQL Script / Re: ดึงรายงาน ตอบกลับ refer ค่ะ
« เมื่อ: พฤศจิกายน 05, 2009, 17:37:25 PM »
เป็นคำสั่งที่เขียนเพื่อให้รายงานออกมาอ่ะค่ะ ตามรูปค่ะคือสั่งชื่อคนๆหนึ่งแต่ไม่ออกมาตามที่สั่งค่ะ
กลับออกรายชื่อคนอื่น

56
การเขียน SQL Script / ดึงรายงาน ตอบกลับ refer ค่ะ
« เมื่อ: พฤศจิกายน 05, 2009, 11:24:05 AM »
หนูต้องการดึงเป็นฟอร์มใบ refer ตอบกลับคะเพื่อดึง ชื่อนามสกุล, ผลชัยสูตรที่สำคัญ , การรักษาที่ให้ของผู้ป่วยออกมาแต่ว่าเมื่อสั่งปริ้นแล้วไม่ออกตามรายชื่อผู้ป่วยที่สั่งงค่ะ ออกมาช่อเดิมตลอดเลยค่ะอยากจะทราบว่าต้องทำอย่างไรค่ะแล้วการกำหนด ค่ parameter มีการกำหนอดอย่างไรต้องเอาอะไรมากำหนดค่ะ

select o.vn,o.refer_date,o.hospcode,o.refer_number , o.lab_text , o.treatment_text , o.confirm_diagnosis,
concat(p.pname,p.fname,'     ',p.lname) as ptname
from referout  o
left outer join patient p on p.hn=o.hn
where o.refer_number=1


รบกวนอาจารย์ทุกท่านด้วยนะค่ะหนูเพิ่งเข้ามาทำงานที่ โรงพยาบาลบางปลาม้าจังหวัดสุพรรณบุรีค่ะ



57
Delphi / Pascal / Re: สอบถามเรื่อง function HOSxP_GetDataset ค่ะ
« เมื่อ: ตุลาคม 17, 2009, 23:12:54 PM »
ค่ะใน Project ยังไม่มี HOSXPDMU  พยายามจะดึงใน โปรเจค turbo_hosxp มาใช้แต่นำมาใช้ในโปรเจคเรายังไง  รบกวนอาจารย์ด้วยนะค่ะพยายามมาหลายวันแล้ว  หรือถ้าเขียนขึ้นมาต้องเขียนอะไรบ้างค่ะ อยากก็อปโค้ดให้อาจารย์ดูแต่ไม่รู้จะรบกวนมากไปรึป่าว  ขอบคุณอาจารย์ทุกท่านที่ร่วมตอบคำถามค่ะ

58
Delphi / Pascal / Re: สอบถามเรื่อง function HOSxP_GetDataset ค่ะ
« เมื่อ: ตุลาคม 16, 2009, 08:35:57 AM »
ลองศึกษาแล้วค่ะแต่ uses HOSxPDMU  นำมาใช้ได้ยังไงอ่ะค่ะ
ถ้าเขียนตามอาจารย์แล้วแต่ฟ้อง errorตรงนี้ค่ะ  รบกวนด้วยนะค่ะ



1.Unit xxxx;


2.interface


3.uses .....,...


4.implementation


5.uses HOSxPDMU;


6.


7.Procedure Button1Click(Sender:TObject);


8.var TC : TClientDataset;


9.begin


10.


11.  TC := TClientDataset.Create(nil);


12.  TC.Data := HOSxP_GetDataset('select * from pttype');


13.  while not TC.eof do


14.  begin


15.   showmessage(TC.fieldbyname('name').asstring);


16.   TC.next;


17.  end;


18.  TC.free;


19.


20.end;

59
Delphi / Pascal / สอบถามเรื่อง function HOSxP_GetDataset ค่ะ
« เมื่อ: ตุลาคม 15, 2009, 21:23:23 PM »
คือไม่เข้าใจค่ะว่าภายใน function ต้องเขียนอย่างไรบ้าง ถึงจะนำข้อมูลในตารางมาใช้ได้ค่ะ ลองดึงข้อมูลออกมาแล้วพอจะนำน้อมูลไปแก้ไขข้อมูลไม่ขึ้นค่ะ รบกวนทุกท่านด้วยนะค่ะ

หน้า: 1 [2]