包没有调试的选项,调试是灰色的,其他的存储过程都正常,这个存储过程也能编译成功....
procedure Up_补偿单_云南洱源(Str_传入_机构编码 in varchar2,
                        Str_就诊类型 in varchar2,
                        Str_病历号 in varchar2,
                        I_返回值  out integer,
                        Str_返回信息 out varchar2,
                        cur_票据明细 out cur_票据打印明细) is
  begin
    --重打印标志,总费用,大写金额为必须字段
  if Str_就诊类型='农合' then
  
    OPEN cur_票据明细 FOR
    
      select (select 病人姓名
                from 出院病人信息
               where 机构编码 = Str_传入_机构编码
                 and 住院病历号 = Str_病历号) as 姓名,
             (select 性别
                from 出院病人信息
               where 机构编码 = Str_传入_机构编码
                 and 住院病历号 = Str_病历号) as 性别,
             (select 年龄
                from 出院病人信息
               where 机构编码 = Str_传入_机构编码
                 and 住院病历号 = Str_病历号) as 年龄,
             c_7 as 结算单编号,
             c_4 as 医疗卡号,
             (select 家庭地址
                from 出院病人信息
               where 机构编码 = Str_传入_机构编码
                 and 住院病历号 = Str_病历号) as 病人住址,
             (select 科室名称
                from 科室资料
               where 科室编码 = (select 病人科室编码
                               from 出院病人信息
                              where 住院病历号 = Str_病历号
                                and 机构编码 = Str_传入_机构编码)) as 住院科室,
             病历号,
             (select 入院方式编码
                from 出院病人信息
               where 机构编码 = Str_传入_机构编码
                 and 住院病历号 = Str_病历号) as 入院诊断,
             (select 出院方式
                from 出院病人信息
               where 机构编码 = Str_传入_机构编码
                 and 住院病历号 = Str_病历号) as 出院诊断,
             (select sum(c_6)
                from 接口补偿信息
               where 机构编码 = Str_传入_机构编码
                 and 病历号 = Str_病历号) as 医药费总额,
             ((select sum(总金额)
                 from 出院病人处方明细
                where 机构编码 = Str_传入_机构编码
                  and 住院病历号 = Str_病历号
                  and 大类编码 = 2
                  and 农合类别 = 3) + (select sum(总金额)
                                      from 出院病人处方明细
                                     where 机构编码 = Str_传入_机构编码
                                       and 住院病历号 = Str_病历号
                                       and 大类编码 = 1
                                       and 农合类别 = 3)) as 自费医药合计,
             (select sum(总金额)
                from 出院病人处方明细
               where 机构编码 = Str_传入_机构编码
                 and 住院病历号 = Str_病历号
                 and 大类编码 = 2
                 and 农合类别 = 3) as 自费药品,
             (select sum(总金额)
                from 出院病人处方明细
               where 机构编码 = Str_传入_机构编码
                 and 住院病历号 = Str_病历号
                 and 大类编码 = 1
                 and 农合类别 = 3) as 自费检查,
             c_13 as 起付线,
             c_10 as 自付金额,
             c_12 as 农合补偿金额,
             c_14 as 超限额自付金额,
             (c_6 - c_5) as 个人自付合计,
             c_8 as 分娩项目补偿金额,
             c_9 as 低保补偿金额,
             c_15 as 血防补偿金额,
             (select 缴费金额
                from 出院病人预交金
               where 机构编码 = Str_传入_机构编码
                 and 住院病历号 = Str_病历号) as 预交款合计,
             ((select 缴费金额
                 from 出院病人预交金
                where 机构编码 = Str_传入_机构编码
                  and 住院病历号 = Str_病历号) - (c_6 - c_5)) as 应退医疗费,
             (select 操作员姓名
                from 出院病人处方明细
               where 机构编码 = Str_传入_机构编码
                 and 住院病历号 = Str_病历号) as 结算人,
             (select to_char(sysdate, 'yyyy-mm-dd') from dual) as 结算日期
        from 接口补偿信息
       where 机构编码 = Str_传入_机构编码
         and 病历号 = Str_病历号;
  
    if sqlcode <> 0 then
      I_返回值     := 0;
      Str_返回信息 := sqlerrm;
      return;
    end if;
  
    I_返回值     := 1;
    Str_返回信息 := 'OK';
    end if;
  
  end Up_补偿单_云南洱源;