CREATE OR REPLACE PROCEDURE SP_ZH_MZFYHSXMTSCL ( Pczrq00 in char default to_char(sysdate-1,'YYYYMMDD') ) -- MODIFICATION HISTORY -- Person Date Comments -- jlg 2018.03.01 created 在开单科室为手麻科室时,门诊费用药品核算项目改为'手术用药'核算项目 YZCX9-20180202-001 -- jlg 2018.03.02 增加住院系统对应的处理 YZCX9-20180302-001 --lxy 2018 03.20 将门诊手术室,手术室,麻醉科所开单的项目单独统计到核算项目中的【手术治疗】、【手术材料】上 YZCX9-20180320-002 -- --------- ---------- ------- as Vparams varchar2(255); --参数变量 Verrmsg varchar2(255); --错误提示变量 Ecustom exception; --错误变量 Vyyid00 XT_YYXX00.YYID00%type; --医院ID Vczrq00 char(8); --操作日期 begin Vparams:=''; Verrmsg:=''; Vczrq00 := Pczrq00; select max(YYID00) into Vyyid00 from XT_YYXX00 where rownum=1; if Vyyid00 in ('920009','920010') then --福州新莲花医院特殊处理:定时将手术麻醉科室的药品核算项目改为'手术用药'的核算项目 --手术麻醉科室ID:39,40,42 --手术用药核算ID:3800 --药品核算项目ID:300,400,500 update SF_FYMX00 set HSXMID = 3800 where CZRQ00=Vczrq00 and KDKS00 in (39,40,42) and HSXMID in (300,400,500); commit; update ZY_FYMX00 set HSXMID = 3800 where CZRQ00=Vczrq00 and KDKS00 in (39,40,42) and HSXMID in (300,400,500); commit; --手术材料3900 手术治疗4000 update SF_FYMX00 set HSXMID = 3900 where CZRQ00=Vczrq00 and ZXKS00 in(39,40,42) and HSXMID = 2500; commit; update SF_FYMX00 set HSXMID = 4000 where CZRQ00=Vczrq00 and ZXKS00 in(39,40,42) and HSXMID = 2400; commit; update ZY_FYMX00 set HSXMID = 3900 where CZRQ00=Vczrq00 and ZXKS00 in(39,40,42) and HSXMID = 2500; commit; update ZY_FYMX00 set HSXMID = 4000 where CZRQ00=Vczrq00 and ZXKS00 in (39,40,42) and HSXMID = 2400; commit; end if; exception when no_data_found then raise_application_error(-20001,substrb('数据没有找到!*'||sqlerrm||','||Vparams,1,220)); when Ecustom then raise_application_error(-20010,substrb(Verrmsg||'!*'||Vparams,1,220)); when others then raise_application_error(-20002,substrb(nvl(sqlerrm, '原因不明出错')||'!*'||Vparams,1,220)); rollback; end;