CREATE OR REPLACE PROCEDURE SP_YS_GETCFXXSTR ( p_ghh000 in varchar2, --挂号号 p_brid00 in number, --病人ID p_cxsj00 in varchar2, --查询时间 p_cfxx00 out varchar2 -- 处方信息 ) as v_return varchar2(8000);--函数返回值 vCount0 number(5);--计数器 vCflsh0 varchar2(40);--上一处方的处方流水号 vString varchar(200); vHCount number(5);--标题计数器 vLhCount number(5);--小标题计数器 vTitle varchar(200); vZb0000 char(1); --同组号 VTzcount number(5); --同组计数器 VIsFirst char(1); --判断是否是第一次 VIsHaveCf char(1); --是否存在处方 cursor C_YS_CFXXHIS_XCY is --西药成药处方信息 select A.CFMC00,A.CFDW00,trim(A.JLDW00) JLDW00,A.YPZSL0,A.CSL000,A.YYSJ00,A.YYSJDW,A.YPYFMC,A.PCMC00,A.YPGG00,A.CFLSH0,A.CFLBMC,A.ZYMRCS,A.YYZF00,A.ZB0000,decode(A.SFZBY0,'Y','(自备)','') SFZBY0,A.PSMC00 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.CFBZ00 = '1' and A.CFLB00 in ('0','1') and A.SFLB00='-1' and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认') order by CFBZ00,CFLSH0 desc,KDRQSJ,CFLB00,MXID00; cursor C_YS_CFXXHIS_ZY is --中药处方信息 select A.CFMC00,A.CFDW00,trim(A.JLDW00) JLDW00,A.YPZSL0,A.CSL000,A.YYSJ00,A.YPYFMC,A.PCMC00,A.YPGG00,A.CFLSH0,A.CFLBMC,A.ZYMRCS,A.ZYTS00,A.XMYFMC,(select B.JYFSMC from YS_JYFS00 B where B.BH0000 = A.JYFS00) JYFSMC,decode(A.YPCZFL,'0','草药','1','颗粒药','2','全成分') YPCZFL,A.CFSM00 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.CFBZ00 = '1' and A.CFLB00 = '2' and A.SFLB00='-1' and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认') order by CFBZ00,CFLSH0 desc,KDRQSJ,CFLB00,MXID00; cursor C_YS_YJHIS_JC is --检查信息 select A.CFMC00,A.SL0000,A.BZ0000,A.BWMC00 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.CFBZ00 = '2' and A.CFLB00 in ('3') and A.SFLB00='-1' and A.DCBZ00 = '0' and (A.FJDJBZ = '0' or A.FJDJBZ = '9') and A.YPNM00 not in(select a.ZLXMID from BM_ZLZD00 a,BM_YSLB00 b where a.ZLXMID=b.ZLXMID) and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认') order by CFBZ00,CFLSH0 desc,KDRQSJ,CFLB00,MXID00; cursor C_YS_YJHIS_JY is --检验信息 select A.CFMC00,A.SL0000,A.BZ0000,A.BWMC00 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.CFBZ00 = '2' and A.CFLB00 in ('4') and A.SFLB00='-1' and A.DCBZ00 = '0' and (A.FJDJBZ = '0' or A.FJDJBZ = '9') and A.YPNM00 not in(select a.ZLXMID from BM_ZLZD00 a,BM_YSLB00 b where a.ZLXMID=b.ZLXMID) and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认') order by CFBZ00,CFLSH0 desc,KDRQSJ,CFLB00,MXID00; cursor C_YS_YJHIS_ZLSS is --治疗手术信息 select A.CFMC00,A.SL0000,A.BZ0000,A.BWMC00 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.CFBZ00 = '2' and A.CFLB00 in ('6','5') and A.SFLB00='-1' and A.DCBZ00 = '0' and (A.FJDJBZ = '0' or A.FJDJBZ = '9') and A.YPNM00 not in(select a.ZLXMID from BM_ZLZD00 a,BM_YSLB00 b where a.ZLXMID=b.ZLXMID) and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认') order by CFBZ00,CFLSH0 desc,KDRQSJ,CFLB00,MXID00; begin -- MODIFICATION HISTORY -- Person Date Comments -- cyhong 2018.12.13 create 获取挂号处方信息 for MZDZBLS-20181214-001 -- cyhong 2018.12.26 update 获取诊疗项目信息并且重新定义格式 for MZDZBLS-20181226-001 -- cyhong 2019.01.10 update 构造信息时自动排除带出项目 for MZDZBLS-20190110-001 -- cyhong 2019.01.17 update 重新调整字符串内容,以及排除辩证论治费 fro MZDZBLS-20190117-002 -- cyhong 2019.01.23 update 草药一行放置三个 for MZDZBLS-20190114-001 -- cyhong 2019.06.03 update 修改西药处方格式,增加诊疗项目备注 for MZYSSJ5-20190531-004 -- cyhong 2019.07.17 update 处方信息开头增加'处方:' for MZYSSJ5-20190702-002 -- cyhong 2019.07.19 update 西药处方去末尾空格避免因记录中的空格问题导致换行 for MZYSSJ5-20190701-002 -- cyhong 2019.09.02 update 增加参数CXSJ00查询时间过滤上次更新的处方 for MZYSSJ5-20190729-001 -- cyhong 2019.09.06 update 过滤已经退费或者作废的处方信息 for MZYSSJ5-20190902-003. -- ruanbh 2019.09.10 update 去掉颗粒药多余的逗号 for MZYSSJ5-20190809-001 -- cyhong 2019.12.13 update 处方信息中的JLDW00去空格 for MZYSSJ5-20191209-001 -- caobin 2020.09.23 update 开检查时,医生开的检查部位在点击更新诊疗后没有体现在病历中 for MZYS9-20200915-007 -- caobin 2020.09.23 update 分类选项卡分类划分类别呈现各诊疗信息,如检验: 检查: 处方:for MZYS9-20200915-013 -- ruanbh 2021.01.25 update 增加处方说明 MZYSSJ5-20210105-002 -- caobin 2021.07.13 update 添加皮试MZYSSJ5-20210708-002 -- caobin 2021-10-20 v_return 字符长度2000 改 8000 MZYSSJ5-20210926-002 -- ruanbh 2023.07.12 增加药品规格、总量 MZYSSJ5-20230712-002 v_return := ''; vCflsh0 :=''; vLhCount := 1; VIsHaveCf := 0; --如果该病人有诊疗信息的话,在进行获取诊疗信息字符串 select count(1) into vCount0 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认'); if vCount0>0 then --如果存在检查检验项目 select count(*) into vCount0 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.CFBZ00 = '2' and A.cflb00 ='3' and A.SFLB00='-1' and A.DCBZ00 = '0' and (A.FJDJBZ = '0' or A.FJDJBZ = '9') and A.YPNM00 not in(select a.ZLXMID from BM_ZLZD00 a,BM_YSLB00 b where a.ZLXMID=b.ZLXMID) and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认') order by CFBZ00,CFLSH0 desc,KDRQSJ,CFLB00,MXID00; if vCount0>0 then -- if VIsHaveCf <> '1' then v_return := chr(10)||v_return || '检查处方:'||chr(10); -- VIsHaveCf := '1'; -- end if; for JCMC00 in C_YS_YJHIS_JC loop --构造检查信息 v_return := v_return || to_char(vLhCount) || ' ' || JCMC00.CFMC00 || ' ' || JCMC00.BZ0000||' ' ||JCMC00.BWMC00 ||chr(10); --小标题加1 vLhCount := vLhCount + 1; end loop; end if; select count(*) into vCount0 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.CFBZ00 = '2' and A.cflb00 ='4' and A.SFLB00='-1' and A.DCBZ00 = '0' and (A.FJDJBZ = '0' or A.FJDJBZ = '9') and A.YPNM00 not in(select a.ZLXMID from BM_ZLZD00 a,BM_YSLB00 b where a.ZLXMID=b.ZLXMID) and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认') order by CFBZ00,CFLSH0 desc,KDRQSJ,CFLB00,MXID00; if vCount0>0 then -- if VIsHaveCf <> '1' then v_return := v_return || '检验处方:'||chr(10); -- VIsHaveCf := '1'; -- end if; for JYMC00 in C_YS_YJHIS_JY loop --构造检查信息 v_return := v_return || to_char(vLhCount) || ' ' || JYMC00.CFMC00 || ' ' || JYMC00.BZ0000||' ' ||JYMC00.BWMC00 ||chr(10); --小标题加1 vLhCount := vLhCount + 1; end loop; end if; --如果存在治疗手术项目 select count(*) into vCount0 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.CFBZ00 = '2' and A.cflb00 in ('6','5') and A.SFLB00='-1' and A.DCBZ00 = '0' and (A.FJDJBZ = '0' or A.FJDJBZ = '9') and A.YPNM00 not in(select a.ZLXMID from BM_ZLZD00 a,BM_YSLB00 b where a.ZLXMID=b.ZLXMID) and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认') order by CFBZ00,CFLSH0 desc,KDRQSJ,CFLB00,MXID00; if vCount0>0 then if VIsHaveCf <> '1' then v_return := v_return || '处方:'||chr(10); VIsHaveCf := '1'; end if; for ZLSSMC in C_YS_YJHIS_ZLSS loop --构造治疗手术信息 v_return := v_return || to_char(vLhCount) || ' ' || ZLSSMC.CFMC00 || ' ' || ZLSSMC.SL0000 || ' ' || ZLSSMC.BZ0000 || ' ' ||ZLSSMC.BWMC00 || chr(10); --小标题加1 vLhCount := vLhCount + 1; end loop; end if; --如果存在西成药处方信息 select count(*) into vCount0 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.CFBZ00 = '1' and A.CFLB00 in ('0','1') and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认') order by CFBZ00,CFLSH0 desc,KDRQSJ,CFLB00,MXID00; if vCount0>0 then vCflsh0 := ''; if VIsHaveCf <> '1' then v_return := v_return || '处方:'||chr(10); VIsHaveCf := '1'; end if; for XYYPMC in C_YS_CFXXHIS_XCY loop VIsFirst := '0'; if XYYPMC.ZB0000 is null then vCflsh0 := XYYPMC.CFLSH0; vZb0000 := '-'; v_return := v_return || rtrim(to_char(vLhCount) || ' ' || XYYPMC.CFMC00 ||'['||XYYPMC.YPGG00||']' || ' ' || to_char(XYYPMC.CSL000,'fm99990.0099') || XYYPMC.JLDW00 || ' ' || XYYPMC.PCMC00 || ' ' || XYYPMC.YYSJ00 || XYYPMC.YYSJDW || ' ' || XYYPMC.YPYFMC || ' ' || XYYPMC.YYZF00 || ' ' || XYYPMC.SFZBY0 ||' '||XYYPMC.PSMC00) ||' 共'||XYYPMC.YPZSL0||XYYPMC.CFDW00 ||chr(10); --小标题加1 vLhCount := vLhCount + 1; else if vCflsh0 is null then --查询该条处方相同的处方相同的组别是不是存在两条以上的数据 select count(A.ZB0000) into vCount0 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.CFLSH0 = XYYPMC.CFLSH0 and A.ZB0000 = XYYPMC.ZB0000 and A.CFBZ00 = '1'and A.CFLB00 in ('0', '1')and A.SFLB00 = '-1' and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认') group by A.CFLSH0,A.ZB0000; --如果存在 if vCount0>1 then vCflsh0 := XYYPMC.CFLSH0; VTzcount := vCount0 - 1; vZb0000 := XYYPMC.ZB0000; v_return := v_return || rtrim(to_char(vLhCount) || '┏'|| XYYPMC.CFMC00 ||'['||XYYPMC.YPGG00||']' || ' ' || to_char(XYYPMC.CSL000,'fm99990.0099') || XYYPMC.JLDW00 || ' ' || XYYPMC.PCMC00 || ' ' || XYYPMC.YYSJ00 || XYYPMC.YYSJDW || ' ' || XYYPMC.YPYFMC || ' ' || XYYPMC.YYZF00 || ' ' || XYYPMC.SFZBY0)||' 共'||XYYPMC.YPZSL0||XYYPMC.CFDW00 || chr(10); --小标题加1 vLhCount := vLhCount + 1; else--如果不存在 vCflsh0 := XYYPMC.CFLSH0; vZb0000 := XYYPMC.ZB0000; v_return := v_return || rtrim(to_char(vLhCount) || ' ' || XYYPMC.CFMC00 ||'['||XYYPMC.YPGG00||']' || ' ' || to_char(XYYPMC.CSL000,'fm99990.0099') || XYYPMC.JLDW00 || ' ' || XYYPMC.PCMC00 || ' ' || XYYPMC.YYSJ00 || XYYPMC.YYSJDW || ' ' || XYYPMC.YPYFMC || ' ' || XYYPMC.YYZF00 || ' ' || XYYPMC.SFZBY0)||' 共'||XYYPMC.YPZSL0||XYYPMC.CFDW00 || chr(10); --小标题加1 vLhCount := vLhCount + 1; end if; VIsFirst := '1'; end if; --如果处方号不同的话 if XYYPMC.CFLSH0 <> vCflsh0 and VIsFirst = '0' then --查询该条处方相同的处方相同的组别是不是存在两条以上的数据 select count(A.ZB0000) into vCount0 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.CFLSH0 = XYYPMC.CFLSH0 and A.ZB0000 = XYYPMC.ZB0000 and A.CFBZ00 = '1'and A.CFLB00 in ('0', '1')and A.SFLB00 = '-1' and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认') group by A.CFLSH0,A.ZB0000; --如果存在 if vCount0>1 then vCflsh0 := XYYPMC.CFLSH0; VTzcount := vCount0 - 1; vZb0000 := XYYPMC.ZB0000; v_return := v_return || rtrim(to_char(vLhCount) || '┏'|| XYYPMC.CFMC00 ||'['||XYYPMC.YPGG00||']' || ' ' || to_char(XYYPMC.CSL000,'fm99990.0099') || XYYPMC.JLDW00 || ' ' || XYYPMC.PCMC00 || ' ' || XYYPMC.YYSJ00 || XYYPMC.YYSJDW || ' ' || XYYPMC.YPYFMC || ' ' || XYYPMC.YYZF00 || ' ' || XYYPMC.SFZBY0||' 共'||XYYPMC.YPZSL0||XYYPMC.CFDW00) || chr(10); --小标题加1 vLhCount := vLhCount + 1; else--如果不存在 vCflsh0 := XYYPMC.CFLSH0; vZb0000 := XYYPMC.ZB0000; v_return := v_return || rtrim(to_char(vLhCount) || ' ' || XYYPMC.CFMC00 ||'['||XYYPMC.YPGG00||']' || ' ' || to_char(XYYPMC.CSL000,'fm99990.0099') || XYYPMC.JLDW00 || ' ' || XYYPMC.PCMC00 || ' ' || XYYPMC.YYSJ00 || XYYPMC.YYSJDW || ' ' || XYYPMC.YPYFMC || ' ' || XYYPMC.YYZF00 || ' ' || XYYPMC.SFZBY0||' 共'||XYYPMC.YPZSL0||XYYPMC.CFDW00) || chr(10); --小标题加1 vLhCount := vLhCount + 1; end if; elsif XYYPMC.ZB0000 <> vZb0000 and VIsFirst = '0' then --如果组别不同的话 --查询该条处方相同的处方相同的组别是不是存在两条以上的数据 select count(A.ZB0000) into vCount0 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.CFLSH0 = XYYPMC.CFLSH0 and A.ZB0000 = XYYPMC.ZB0000 and A.CFBZ00 = '1'and A.CFLB00 in ('0', '1')and A.SFLB00 = '-1' and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认') group by A.CFLSH0,A.ZB0000; --如果存在 if vCount0>1 then vCflsh0 := XYYPMC.CFLSH0; VTzcount := vCount0 - 1; vZb0000 := XYYPMC.ZB0000; v_return := v_return || rtrim(to_char(vLhCount) || '┏'|| XYYPMC.CFMC00 ||'['||XYYPMC.YPGG00||']' || ' ' || to_char(XYYPMC.CSL000,'fm99990.0099') || XYYPMC.JLDW00 || ' ' || XYYPMC.PCMC00 || ' ' || XYYPMC.YYSJ00 || XYYPMC.YYSJDW || ' ' || XYYPMC.YPYFMC || ' ' || XYYPMC.YYZF00 || ' ' || XYYPMC.SFZBY0||' 共'||XYYPMC.YPZSL0||XYYPMC.CFDW00) || chr(10); --小标题加1 vLhCount := vLhCount + 1; else--如果不存在 vCflsh0 := XYYPMC.CFLSH0; vZb0000 := XYYPMC.ZB0000; v_return := v_return || rtrim(to_char(vLhCount) || ' ' || XYYPMC.CFMC00 ||'['||XYYPMC.YPGG00||']' || ' ' || to_char(XYYPMC.CSL000,'fm99990.0099') || XYYPMC.JLDW00 || ' ' || XYYPMC.PCMC00 || ' ' || XYYPMC.YYSJ00 || XYYPMC.YYSJDW || ' ' || XYYPMC.YPYFMC || ' ' || XYYPMC.YYZF00 || ' ' || XYYPMC.SFZBY0||' 共'||XYYPMC.YPZSL0||XYYPMC.CFDW00) || chr(10); --小标题加1 vLhCount := vLhCount + 1; end if; elsif VIsFirst = '0' then --如果处方号相同组别也相同的话 if VTzcount >1 then v_return := v_return || rtrim(' ' || '┃'|| XYYPMC.CFMC00 ||'['||XYYPMC.YPGG00||']' || ' ' || to_char(XYYPMC.CSL000,'fm99990.0099') || XYYPMC.JLDW00 || ' ' || XYYPMC.PCMC00 || ' ' || XYYPMC.YYSJ00 || XYYPMC.YYSJDW || ' ' || XYYPMC.YPYFMC || ' ' || XYYPMC.YYZF00 || ' ' || XYYPMC.SFZBY0||' 共'||XYYPMC.YPZSL0||XYYPMC.CFDW00) || chr(10); VTzcount := VTzcount - 1; else v_return := v_return || rtrim(' ' || '┗'|| XYYPMC.CFMC00 ||'['||XYYPMC.YPGG00||']' || ' ' || to_char(XYYPMC.CSL000,'fm99990.0099') || XYYPMC.JLDW00 || ' ' || XYYPMC.PCMC00 || ' ' || XYYPMC.YYSJ00 || XYYPMC.YYSJDW || ' ' || XYYPMC.YPYFMC || ' ' || XYYPMC.YYZF00 || ' ' || XYYPMC.SFZBY0||' 共'||XYYPMC.YPZSL0||XYYPMC.CFDW00) || chr(10); end if; end if; end if; end loop; end if; --如果存在中药处方信息 select count(*) into vCount0 from VW_YS_YJCFHISTORY_MZDZBL A where A.GHH000 = p_ghh000 and A.BRID00 = p_brid00 and A.KDRQSJ > p_cxsj00 and A.CFBZ00 = '1' and A.CFLB00 = '2' and A.ZT0000 not in('已作废','退费申请','已退药','已退费','退费确认') order by CFBZ00,CFLSH0 desc,KDRQSJ,CFLB00,MXID00; if vCount0>0 then vCflsh0 := ''; if VIsHaveCf <> '1' then v_return := v_return || '处方:'||chr(10); VIsHaveCf := '1'; end if; for ZYYPMC in C_YS_CFXXHIS_ZY loop vHCount := 0; --构造中药处方信息 if vCflsh0 is null then vHCount := 1; v_return := v_return || to_char(vLhCount) || ' '; --小标题加1 vLhCount := vLhCount + 1; vCflsh0 := ZYYPMC.CFLSH0; vString := 'X'|| ZYYPMC.ZYTS00 || '剂,'; if nvl(ZYYPMC.JYFSMC,' ')<>' ' then vString :=vString|| ZYYPMC.JYFSMC|| ','; end if; if nvl(ZYYPMC.YPYFMC,' ')<>' ' then vString :=vString|| ZYYPMC.YPYFMC|| ','; end if; vString :=vString|| '每日' || ZYYPMC.ZYMRCS || '次(' || ZYYPMC.YPCZFL || ')'; if nvl(ZYYPMC.CFSM00,' ')<>' ' then vString :=vString||','|| ZYYPMC.CFSM00; end if; vCount0 := 1; end if; --如果处方流水号不同则换行 if ZYYPMC.CFLSH0 <> vCflsh0 then vHCount := 1; vCflsh0 := ZYYPMC.CFLSH0; v_return := v_return || chr(10) || vString || chr(10) ; vString := 'X'|| ZYYPMC.ZYTS00 || '剂,'; if nvl(ZYYPMC.JYFSMC,' ')<>' ' then vString :=vString|| ZYYPMC.JYFSMC|| ','; end if; if nvl(ZYYPMC.YPYFMC,' ')<>' ' then vString :=vString|| ZYYPMC.YPYFMC|| ','; end if; vString :=vString|| '每日' || ZYYPMC.ZYMRCS || '次(' || ZYYPMC.YPCZFL || ')'; if nvl(ZYYPMC.CFSM00,' ')<>' ' then vString :=vString||','|| ZYYPMC.CFSM00; end if; vCount0 := 1; v_return := v_return || to_char(vLhCount) || ' '; --小标题加1 vLhCount := vLhCount + 1; end if; --每四个药品换一行 if vCount0 > 3 then vCount0 := 1; v_return := v_return || chr(10) || ' '; end if; if vHCount = 1 then vTitle := ZYYPMC.CFMC00 || ZYYPMC.CSL000 || ZYYPMC.JLDW00 || replace(replace(ZYYPMC.XMYFMC,'(','('),')',')'); v_return := v_return || rpad(vTitle,20); else vTitle := ZYYPMC.CFMC00 || ZYYPMC.CSL000 || ZYYPMC.JLDW00 || replace(replace(ZYYPMC.XMYFMC,'(','('),')',')'); v_return := v_return || rpad(vTitle,20); end if; vCount0 := vCount0 + 1; end loop; end if; v_return := v_return || chr(10) || vString; end if; p_cfxx00 := v_return; EXCEPTION when others then raise_application_error(-20002,substrb(nvl(sqlerrm, '原因不明出错')||'!*',1,220)); end;