แสดงกระทู้

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 - nksawan2011

หน้า: 1 2 [3]
101
ปัญหาเดิมครับ   ขอทราบตารางที่เก็บรายการยาที่หมอสั่งแต่ละvisitก็ได้ครับจะลองเขียนsqlเองครับ

102
รายงานจากข้อสงสัย วันนี้มีการลบยา 1 คัว เปิดใน doctor_order_print ยังมีรายการยาตัวนั้นอยู่ แต่อีก~ 20นาที เปิดดู รายการนั้นก็หายไปครับ

103
ตามนี้ครับ

104
รบกวนปรึกษาด้วยครับ คือที่ รพ.ต้องพิมพ์ใบสั่งยาที่ห้องหมอ ปัญหาคือพิมพ์ใบสั่งยาไปแล้วยาตัวนั้นหมด ต้องกลับมาปรับยาตัวใหม่แทนปรากฏว่าพอพิมพ์ใบสั่งยาก็ยังมียาตัวที่ไม่ต้องการขึ้นมาอีก ทั้งๆที่ลบจากรายการยาตัวนั้นแล้ว พอมาดูในตาราง doctor_order_print ก็ยังมียาต้วนั้นจริงๆ อยากทราบว่า
  -ตาราง doctor_order_print ไม่ใช่ตารางการสั่งยาที่แท้จริงหรือไม่
      *ถ้าใช่ ในใบสั่งยาจึงไม่ใช้ตารางการสั่งยาที่แท้จริงมาใช้ ถ้าที่ไหนใช้รบกวนส่ง query มาให้ใช้บ้างครับ
      *ถ้าไม่ใช่เราจะแก้ไขอย่างไรใบสั่งยาอย่างไร เพราะลบแล้วก็ยังมีในตารางอยู่
ขอบคุณครับ

105
Report Exchange / Re: ขอรายงานผู้ป่วยแยกโรคแยกอายุ..ครับ
« เมื่อ: พฤศจิกายน 16, 2011, 11:19:06 AM »
ลองเอาqueryนี้ไปออกแบบรายงานเองครับ แล้วส่งมาให้ใช้ด้วยนะครับ

106
ถ้าจะเอา sql ไปรันเอง ก็ตามนี้ครับ..................

ขอบคุณมากครับ ทำได้แล้วครับ

107
แบบนี้ได้ไหมครับ

108
;D ;D ;D
ตัวอย่าง
ตาราง hospcode  ฟิลด์ hosptype
แก้ "โรงพยาบาลชุมชน" เป็น "รพช." ฟิลด์ name แก้ "โรงพยาบาลลานสัก" เป็น "ลานสัก"
แก้ "โรงพยาบาลส่งเสริมสุขภาพตำบล" เป็น "รพ.สต." ฟิลด์ name แก้ชื่อ"xxxxxxxxx"เป็น "ป่าอ้อ"
แล้ว update
 ;D ;D ;D


อยากได้แบบนั้นแหละ แต่ตั้ง หมื่นกว่าเปลี่ยนไม่ไหว พอจะมีคำสั่ง sql บ้างไหมครับ

109
ในตัวโปรแกรม hosxp ครับ ผมใช้ ver 3.54.2.2 ครับ


110
ลองเปลี่ยนตัวแปรแสดงผลในปก OPDCARD เป็นไม่ต้อง concat(hosptype,hname ) เป็นเอาแค่ชื่อ รพ.ครับ..ไม่ต้องเอาประเภทหน่วยบริการ...ได้ไหม

ขอวิธีพร้อมรูปภาพประกอบด้วยครับ

111
update แล้ว เวลาที่พิมพ์ใน OPD card  มันออกมายาวมากกว่าแบบเดิม(แบบว่าเอา hosptype +name มันก็เลยออกมาเป็น เหมือนกระทู้ของ รพ.ศรีเชียงใหม่ฮ่ะครับ ไม่ทราบจะแก้ไขได้อย่างไหร่ครับ

แก้ไขยังไงครับอยากให้ hosptypeเป็นตัวย่อเหมือนเดิมครับ มันยาวไปอ่านชื่อ รพ.ไม่ได้เลยครับ

112
ยังกดAccept answerไม่ได้ ยังทำไม่สำเร็จ

GetDateRangeDialog(date1, date2);
       ds1:=formatdatetime('yyyy-mm-dd',date1);
       ds2:=formatdatetime('yyyy-mm-dd',date2);
      pttype_list := getsqlsubquerydata('select distinct pttype from vn_stat where vstdate between "'+ds1+'" and "'+ds2+'" ');
      pttype_list :=getpickuplist('select concat(pttype,":",name) as pttype_name from pttype where pttype in ('+pttype_list+')  order by pttype ');
      hospcode_list:=getsqlsubquerydata('select distinct hospmain from vn_stat where pttype in ('+copy(pttype_list,1,2)+') and vstdate between "'+ds1+'" and "'+ds2+'" ');
      hospcode_list := getpickuplist('select concat(hospcode,":",hosptype," ",name) as name from hospcode where hospcode in ('+hospcode_list+')order by hospcode ');
     
    ChangeReportSQL('select v.* from vn_stat v  left outer join ovst o on o.vn = v.vn   where v.pttype in ('+copy(pttype_list,1,2)+') and v.vstdate between "'+ds1+'" and "'+ds2+'"  and v.hospmain="'+copy(hospcode_list,1,5)+'" and o.an is null order by v.vn ');


113
ช่วยชี้แนวทางด้วยครับ ??? ::) :'(

114
ใช่ครับ เลือกวันแล้วเลือกจังหวัดจาก โรงพยาบาลหลักในตาราง hospcode และอำเภอในตาราง hospcode
รพ.เรียกเก็บรายอำเภอครับ

ขอเพิ่มอีกนิดครับเลือกแบบ ALL ได้ด้วยนะครับ




ลองส่งรายงานขึ้นมาครับ  แต่จากที่อ่าน
จากที่อ่านแสดงว่าไม่เอา pttype ไปจับใช่ไหมครับ
โรงพยาบาลก็ไม่เอา 
งั้นน่าจะใช้  vn_stat.aid มาจับได้นะครับ

หรือไม่ก็จัดเต็มที่
 http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=22755.msg198314#new

115
อยากแก้เงื่อนไขครับ คือ

1.เลือกช่วงวันที่ (ตามเดิม)
2.เลือกสิทธิ์ เปลี่ยนเป็น เลือกตามจังหวัด (จากตาราง chwpart.hospcode)
3.เลือก รพ. เปลี่ยนเป็น เลือกตามอำเภอ (จากตาราง amppart.hospcode)
   
ต้องแก้ไขตรงไหนบ้างครับ ตอนนี้กำลังงมหาอยู่ครับรบกวนด้วยครับ
 
       GetDateRangeDialog(date1, date2);
       ds1:=formatdatetime('yyyy-mm-dd',date1);
       ds2:=formatdatetime('yyyy-mm-dd',date2);
      pttype_list := getsqlsubquerydata('select distinct pttype from vn_stat where vstdate between "'+ds1+'" and "'+ds2+'" ');
      pttype_list :=getpickuplist('select concat(pttype,":",name) as pttype_name from pttype where pttype in ('+pttype_list+')  order by pttype ');
      hospcode_list:=getsqlsubquerydata('select distinct hospmain from vn_stat where pttype in ('+copy(pttype_list,1,2)+') and vstdate between "'+ds1+'" and "'+ds2+'" ');
      hospcode_list := getpickuplist('select concat(hospcode,":",hosptype," ",name) as name from hospcode where hospcode in ('+hospcode_list+')order by hospcode ');
     
    ChangeReportSQL('select v.* from vn_stat v  left outer join ovst o on o.vn = v.vn   where v.pttype in ('+copy(pttype_list,1,2)+') and v.vstdate between "'+ds1+'" and "'+ds2+'"  and v.hospmain="'+copy(hospcode_list,1,5)+'" and o.an is null order by v.vn ');
   
   
   

116
ลักษณะอย่างด้านล่างครับ แต่เงื่อนไขคือ ถ้า pttype=17 ให้แสดงข้อความที่ต้องการ


procedure GlobalOnCreate;
begin
          showmessage('ÃÒ§ҹ¤èÒÃÑ¡ÉÒ¾ÂÒºÒżÙé»èǹ͡ ẺÃÒ§ҹ ¹¤.1 '+'Ẻ·Õè 1 ᡵÒÁ¡ÅØèÁÊÔ·¸Ô UC ¹Í¡à¢µ·Ñé§ËÁ´');


    pttype_in :=' "74" ';
    pttype_name := getsqlsubquerydata('select concat(pttype," ",name)as pttname from pttype where pttype in ('+pttype_in+') order by pttype');
    showmessage('¤Ø³àÅ×Í¡ÊÔ·¸Ô = '+pttype_name);

       GetDateRangeDialog(date1, date2);
       ds1:=formatdatetime('yyyy-mm-dd',date1);
    ds2:=formatdatetime('yyyy-mm-dd',date2);

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

    ChangeReportSQL('select v.* from vn_stat v '+
   ' left outer join ovst o on o.vn = v.vn '+
   ' where v.pttype in ('+pttype_in+') and v.vstdate between "'+ds1+'" and "'+ds2+'" '+
   ' and v.hospmain="'+copy(hospcode_list,1,5)+'" and o.an is null order by v.vn ');


end;

117
อยากเพิ่มข้อความเตือนพิมพ์ใบนี้ตรับ โดยถ้าผู้ป่วยใช้สิทธิ์ประกันสังคม (17) ให้แสดงข้อความเตือน 'กรุณาตรวจสอบใบแรกรับ จากแพทย์' จะต้องเพิ่มคำสั่งตรงไหนครับ (REPORT-RG501)ช่วยชี้แนะด้วยครับ

118
ที่ รพ. ก็ใช้ลักษณะนี้เหมือนกัน แล้วก็ให้ ผู้ป่วย/ผู้รับยาแทน เซ็นต์ชื่อที่ใบสั่งยาเลย

ผมใช้การพิมพ์คำว่า "จ่ายตรง" ตัวใหญ่ ๆ แล้วใช้วาง variable ตัวหนึ่งลงไปในแบบฟอร์มใบสั่งยา หรือหัวฉลากยาก็ได้ ว่า

text1.visible:=dbpipeline['pttype']='23';

เท่านี้ ห้องยาก็จะเห็นว่าเป็นสิทธิจ่ายตรงแล้วครับ



120
ได้แล้วครับเอาไปใส่ก่อน order by  ตอนแรกเอาไปใส่ต่อจาก order by

ลองเพิ่ม

group by d1.icode ดูครับ

121
ตามqueryนี้ครับ ค่ายามีเพิ่มเป็น 2 เท่า ค่าบริการไม่มีปัญหา

select d1.*,v1.*,o1.*,p.drugallergy,i1.name as pdx_name ,concat(v1.hospmain,"  ",hc.hosptype,hc.name)
as hospname,v1.pttype,pa.name as pay,pt.paidst as paycode,concat(pc.name," , ",pa.name) as pcname,concat("***",c.name,"***") as inname
from doctor_order_print d1
left outer join vn_stat v1 on v1.vn=d1.vn
left outer join ovst o1 on o1.vn=d1.vn
left outer join patient p on p.hn = v1.hn
left outer join hospcode hc on hc.hospcode=o1.hospmain
left outer join icd101 i1 on i1.code=v1.main_pdx
left outer join opdscreen os on os.vn=o1.vn
left outer join pttype pt on pt.pttype=v1.pttype
left outer join paidst pa on pa.paidst=pt.paidst
left outer join pcode pc on pc.code =pt.pcode
left outer join service_time st on st.vn =d1.vn
left outer join s_drugitems s on d1.icode = s.icode
left outer join income c on c.income = s.income
where d1.vn="540908081755"


order by s.income

122
ขอฟอร์มนี้หน่อยครับจะลองไปศึกษาดู

123
ลอง  select * from rcpt_print

select * from rcpt_arrear

select * from rcpt_debt



ลองดูก่อนครับ..ไม่แน่ใจเหมือนกัน   

ได้แล้วครับอยู่ที่ rcpt_print ขอบคุณมากครับ

124
ลองดูในตาราง incoth แล้ว rcpno ว่าง ต้องไปเอามาจากตารางไหนเพิ่มเติมครับ

125
select i.vn,i.hn,rcpno,i.incdate
,concat(pt.pname,pt.fname," ",pt.lname) as ptname
,sum(if(paidst="00",i.rcptamt,0)) 'money0'
,sum(if(paidst="01",i.rcptamt,0)) 'money1'
,sum(if(paidst="02",i.rcptamt,0)) 'money2'
,sum(if(paidst="03",i.rcptamt,0)) 'money3'
,sum(i.rcptamt) 'total'
from incoth i
left join patient pt on pt.hn=i.hn
where i.incdate between '2011-8-1' and '2011-8-31'
group by i.vn
order by i.rcpno,i.incdate,i.hn
ประมาณนี้รึป่าว

ครับถูกต้องเลยครับ แต่ rcpno ไม่ขึ้นครับ เดี๋ยวตรวจสอบตารางดูก่อนครับ ขอบคุณมากครับ

126
error  varchar(20),i1.incdate,121)+convert(varchar(20),i1.inctime,121)
as id,i1.hn,i1.rcpno,i1. at line 1


select distinct(i1.hn+convert(varchar(20),i1.incdate,121)+convert(varchar(20),i1.inctime,121))
as id,i1.hn,i1.rcpno,i1.incdate,
rtrim(rtrim(pt.pname)+rtrim(pt.fname)+" "+rtrim(pt.lname)) as ptname,
(select sum(rcptamt)  from incoth where hn=i1.hn and incdate=i1.incdate and inctime=i1.inctime and paidst="00") as money0,
(select sum(rcptamt)  from incoth where hn=i1.hn and incdate=i1.incdate and inctime=i1.inctime and paidst="01") as money1,
(select sum(rcptamt)  from incoth where hn=i1.hn and incdate=i1.incdate and inctime=i1.inctime and paidst="02") as money2,
(select sum(rcptamt)  from incoth where hn=i1.hn and incdate=i1.incdate and inctime=i1.inctime ) as totmoney

from incoth i1
left outer join patient pt on pt.hn=i1.hn

where convert(char(7),i1.incdate,121)="2011-08" and rtrim(i1.rcpno) <> ""

group by i1.hn,i1.incdate,i1.inctime,i1.paidst,i1.rcpno,pt.pname,pt.fname,pt.lname
order by i1.rcpno,i1.incdate,i1.hn

รบกวนตรวจสอบให้ด้วยครับ ขอบคุณครับ

127
ได้แล้วค่ะ  ขาด print_server

รบกวนคุณ s@u ผลรวมยานอก ยาใน ไม่แสดงครับ ขอแนวทางด้วยครับ

128
ขอบคุณมากครับหนังสือมาถึงตอนสายๆ นี้เองครับ    ???(ตอบไวดีจัง)

129
รพ.ได้หนังสือด่วน ของกรมบัญชีกลาง เรื่องการออกเอกสารแสดงค่าใช้จ่ายเบิกจ่ายตรงบ้าง ลืมไปขอแนะนำตัวก่อนจาก รพ.จิตเวชนครสวรรค์ราชนครินทร์ครับ ขึ้นระบบ มีนาคม 54 ยังไม่ได้อบรม รบกวน รพ.ไดเขียน repot ตัวนี้เสร็จแล้วรบกวนช่วยเผยแพร่ด้วยครับ

หน้า: 1 2 [3]