浏览代码

在违规收费分析中查询患者住院时间

xiaochan 3 年之前
父节点
当前提交
b0ae8f4d96

+ 7 - 0
src/main/java/thyyxxk/webserver/controller/reports/IllegalChargesAnalysisController.java

@@ -68,4 +68,11 @@ public class IllegalChargesAnalysisController {
     public ResultVo<List<IllegalChargeData>> queryHuanZheLiangCiRuYuanRiQi(@RequestBody IllegalChargeTemplate param) {
         return service.queryHuanZheLiangCiRuYuanRiQi(param);
     }
+
+    @GetMapping("/chaXunHuanZheZhuYuanJianGe")
+    public ResultVo<List<IllegalChargeData>> chaXunHuanZheZhuYuanJianGe(@RequestParam("startTime") String startTime,
+                                                                        @RequestParam("endTime") String endTime,
+                                                                        @RequestParam("tianShu") Integer tianShu) {
+        return service.chaXunHuanZheZhuYuanJianGe(startTime, endTime, tianShu);
+    }
 }

+ 18 - 0
src/main/java/thyyxxk/webserver/dao/his/reports/IllegalChargesAnalysisDao.java

@@ -126,4 +126,22 @@ public interface IllegalChargesAnalysisDao {
             " and dis_diag_no = 1" +
             "</script>")
     List<IllegalChargeData> queryZhenDuan(@Param("inpatientNoList") List<IllegalChargeData> inpatientNoList);
+
+
+    @Select("select inpatient_no, " +
+            "       rtrim(name) name, " +
+            "       dept_name   = (select rtrim(name) name from zd_unit_code where code = small_dept), " +
+            "       admiss_date, " +
+            "       dis_date, " +
+            "       differ_date = DATEDIFF(day, admiss_date, dis_date) " +
+            "from zy_inactpatient " +
+            "where DATEDIFF(day, admiss_date, dis_date) <= #{tianShu} " +
+            "  and admiss_date >= #{startTime} " +
+            "  and admiss_date < #{endTime} " +
+            "  and inpatient_no not like 'S%' " +
+            "  order by differ_date")
+    List<IllegalChargeData> zhuYuanTianShu(@Param("startTime") String startTime,
+                                           @Param("endTime") String endTime,
+                                           @Param("tianShu") Integer tianShu);
 }
+

+ 6 - 0
src/main/java/thyyxxk/webserver/service/reports/IllegalChargesAnalysisService.java

@@ -257,4 +257,10 @@ public class IllegalChargesAnalysisService {
         }
         return ResultVoUtil.success(list);
     }
+
+    public ResultVo<List<IllegalChargeData>> chaXunHuanZheZhuYuanJianGe(String startTime, String endTime, Integer tianShu) {
+        return ResultVoUtil.success(dao.zhuYuanTianShu(startTime, endTime, tianShu));
+    }
 }
+
+

+ 1 - 1
src/main/resources/application.yml

@@ -8,7 +8,7 @@ spring:
     cache: false
   datasource:
     dynamic:
-      primary: dev
+      primary: his
       strict: false
       datasource:
         his: