|
@@ -90,26 +90,15 @@ public interface UpIdCollectionDao {
|
|
|
" (select yb_code\n" +
|
|
|
" from a_employee_mi\n" +
|
|
|
" where code = main_doctor) as chfpdr_code/*主诊医师代码*/,\n" +
|
|
|
- " a.admiss_date as adm_time/*入院时间*/,\n" +
|
|
|
- " a.admiss_date as setl_begn_date /*结算开始日期*/,\n" +
|
|
|
" (select rtrim(si_caty)\n" +
|
|
|
" from zd_unit_code\n" +
|
|
|
" where code = b.small_dept) as adm_caty/*入院科别*/,\n" +
|
|
|
" (select rtrim(si_caty)\n" +
|
|
|
" from zd_unit_code\n" +
|
|
|
" where code = b.zk_ward) as refldept_dept /*转科科别*/,\n" +
|
|
|
- " dismiss_date as dscg_time/*出院时间*/,\n" +
|
|
|
" (select rtrim(si_caty)\n" +
|
|
|
" from zd_unit_code\n" +
|
|
|
" where code = isnull(zk_ward, small_dept)) as dscg_caty /*出院科别*/,\n" +
|
|
|
- " case\n" +
|
|
|
- " when datediff(day,\n" +
|
|
|
- " a.admiss_date,\n" +
|
|
|
- " dismiss_date) <= 0 then 1\n" +
|
|
|
- " else datediff(day,\n" +
|
|
|
- " a.admiss_date,\n" +
|
|
|
- " dismiss_date)\n" +
|
|
|
- " end as act_ipt_days,\n" +
|
|
|
" /*实际住院天数*/\n" +
|
|
|
" zy_serial_no as biz_sn /*业务流水号*/,\n" +
|
|
|
" case age_days\n" +
|
|
@@ -142,6 +131,30 @@ public interface UpIdCollectionDao {
|
|
|
" and b.admiss_times = #{times};")
|
|
|
SetlinfoUpld setlinfo2(@Param("patNo") String patNo, @Param("times") Integer times);
|
|
|
|
|
|
+ @Select("select yb_register_date as adm_time,\n" +
|
|
|
+ " yb_register_date as setl_begn_date,\n" +
|
|
|
+ " endtime as dscg_time,\n" +
|
|
|
+ " yb_register_date,\n" +
|
|
|
+ " case\n" +
|
|
|
+ " when datediff(day,\n" +
|
|
|
+ " yb_register_date,\n" +
|
|
|
+ " endtime) <= 0 then 1\n" +
|
|
|
+ " else datediff(day,\n" +
|
|
|
+ " yb_register_date,\n" +
|
|
|
+ " endtime)\n" +
|
|
|
+ " end as act_ipt_days\n" +
|
|
|
+ "from t_si_setlinfo,\n" +
|
|
|
+ " zy_inactpatient\n" +
|
|
|
+ "where pat_no = #{patNo}\n" +
|
|
|
+ " and times = #{times}\n" +
|
|
|
+ " and ledger_sn = #{ledgerSn}\n" +
|
|
|
+ " and revoked = 0\n" +
|
|
|
+ " and inpatient_no = pat_no\n" +
|
|
|
+ " and admiss_times = times")
|
|
|
+ SetlinfoUpld setlinfo5(@Param("patNo") String patNo,
|
|
|
+ @Param("times") Integer times,
|
|
|
+ @Param("ledgerSn") Integer ledgerSn);
|
|
|
+
|
|
|
|
|
|
@Select("select home_street as currAddr," +
|
|
|
"(select wjw_code from zd_nation_code where code = nation_code) as naty/*民族*/,\n" +
|
|
@@ -163,10 +176,10 @@ public interface UpIdCollectionDao {
|
|
|
|
|
|
@Select("select (select si_code from zd_country_code where code = country) as ntly, " +
|
|
|
" dis_date as setl_end_date, " +
|
|
|
- " admiss_date as setl_begn_date, " +
|
|
|
- " admiss_date as adm_time," +
|
|
|
- " case " + " when datediff(day, admiss_date, dis_date) <= 0 then 1 " +
|
|
|
- " else datediff(day, admiss_date, dis_date) end as act_ipt_days,/*实际住院天数*/ " +
|
|
|
+ " yb_register_date as setl_begn_date, " +
|
|
|
+ " yb_register_date as adm_time," +
|
|
|
+ " case " + " when datediff(day, yb_register_date, dis_date) <= 0 then 1 " +
|
|
|
+ " else datediff(day, yb_register_date, dis_date) end as act_ipt_days,/*实际住院天数*/ " +
|
|
|
" dis_date as dscg_time, " +
|
|
|
" isnull(nullif(occupation_code, ''), 90) as prfs," +
|
|
|
" adm_way = '2' " +
|