瀏覽代碼

病种报表的三个分页接口添加检索字段

JammeyJiang 3 周之前
父節點
當前提交
4b1067f490

+ 6 - 3
src/main/java/com/kcim/dao/mapper/ComputePatientCostAccountMapper.java

@@ -22,25 +22,28 @@ public interface ComputePatientCostAccountMapper extends BaseMapper<ComputePatie
      * 获取疾病成本明细
      * @param computeDate
      * @param hospId
+     * @param diseaseFilter
      * @return
      */
-    List<DiseaseCostDetailVO> getDiseaseCostDetailList(@Param("computeDate") String computeDate, @Param("hospId") Long hospId);
+    List<DiseaseCostDetailVO> getDiseaseCostDetailList(@Param("computeDate") String computeDate, @Param("hospId") Long hospId, String diseaseFilter);
 
     /**
      * 获取疾病成本构成明细
      * @param computeDate
      * @param hospId
+     * @param diseaseFilter
      * @return
      */
-    List<DiseaseCostDetailVO> getDiseaseCostCompositionDetail(@Param("computeDate") String computeDate, @Param("hospId") Long hospId);
+    List<DiseaseCostDetailVO> getDiseaseCostCompositionDetail(@Param("computeDate") String computeDate, @Param("hospId") Long hospId, String diseaseFilter);
 
     /**
      * 获取服务单元疾病成本构成明细
      * @param computeDate
      * @param hospId
+     * @param diseaseFilter
      * @return
      */
-    List<DiseaseCostDetailVO> getDeptDiseaseCostCompositionDetail(@Param("computeDate") String computeDate, @Param("hospId") Long hospId);
+    List<DiseaseCostDetailVO> getDeptDiseaseCostCompositionDetail(@Param("computeDate") String computeDate, @Param("hospId") Long hospId, String diseaseFilter);
 
     /**
      * 获取DRG成本明细

+ 6 - 6
src/main/java/com/kcim/dao/repository/ComputePatientCostAccountRepository.java

@@ -25,16 +25,16 @@ public class ComputePatientCostAccountRepository extends ServiceImpl<ComputePati
         return this.list(queryWrapper);
     }
 
-    public List<DiseaseCostDetailVO> getDiseaseCostDetailList(String computeDate) {
-        return this.baseMapper.getDiseaseCostDetailList(computeDate, UserContext.getHospId());
+    public List<DiseaseCostDetailVO> getDiseaseCostDetailList(String computeDate, String diseaseFilter) {
+        return this.baseMapper.getDiseaseCostDetailList(computeDate, UserContext.getHospId(), diseaseFilter);
     }
 
-    public List<DiseaseCostDetailVO> getDiseaseCostCompositionDetail(String computeDate) {
-        return this.baseMapper.getDiseaseCostCompositionDetail(computeDate, UserContext.getHospId());
+    public List<DiseaseCostDetailVO> getDiseaseCostCompositionDetail(String computeDate, String diseaseFilter) {
+        return this.baseMapper.getDiseaseCostCompositionDetail(computeDate, UserContext.getHospId(), diseaseFilter);
     }
 
-    public List<DiseaseCostDetailVO> getDeptDiseaseCostCompositionDetail(String computeDate) {
-        return this.baseMapper.getDeptDiseaseCostCompositionDetail(computeDate, UserContext.getHospId());
+    public List<DiseaseCostDetailVO> getDeptDiseaseCostCompositionDetail(String computeDate, String diseaseFilter) {
+        return this.baseMapper.getDeptDiseaseCostCompositionDetail(computeDate, UserContext.getHospId(), diseaseFilter);
     }
 
     public List<DiseaseCostDetailVO> getDrgCostDetailList(String computeDate) {

+ 6 - 3
src/main/java/com/kcim/service/StandardReportService.java

@@ -99,9 +99,10 @@ public interface StandardReportService {
      * @param current 当前页码
      * @param pageSize 每页大小
      * @param computeDate 核算年月
+     * @param diseaseFilter 病种筛选条件(编码或名称)
      * @return 分页数据
      */
-    Object getDiseaseCostDetailByPage(Integer current, Integer pageSize, String computeDate);
+    Object getDiseaseCostDetailByPage(Integer current, Integer pageSize, String computeDate, String diseaseFilter);
 
     /**
      * 获取病种成本构成明细表数据
@@ -115,9 +116,10 @@ public interface StandardReportService {
      * @param current 当前页码
      * @param pageSize 每页大小
      * @param computeDate 核算年月
+     * @param diseaseFilter 病种筛选条件(编码或名称)
      * @return 分页数据
      */
-    Object getDiseaseCostCompositionDetailByPage(Integer current, Integer pageSize, String computeDate);
+    Object getDiseaseCostCompositionDetailByPage(Integer current, Integer pageSize, String computeDate, String diseaseFilter);
 
     /**
      * 获取服务单元病种成本构成明细表数据
@@ -131,9 +133,10 @@ public interface StandardReportService {
      * @param current 当前页码
      * @param pageSize 每页大小
      * @param computeDate 核算年月
+     * @param diseaseFilter 病种筛选条件(编码或名称)
      * @return 分页数据
      */
-    Object getDeptDiseaseCostCompositionDetailByPage(Integer current, Integer pageSize, String computeDate);
+    Object getDeptDiseaseCostCompositionDetailByPage(Integer current, Integer pageSize, String computeDate, String diseaseFilter);
 
     /**
      * 获取DRG成本明细表数据

+ 80 - 29
src/main/java/com/kcim/service/impl/StandardReportServiceImpl.java

@@ -969,18 +969,15 @@ public class StandardReportServiceImpl implements StandardReportService {
         return medServiceCostDetailList;
     }
 
-
-    /**
-     * 获取医院病种成本明细表数据
-     *
-     * @return 病种成本明细列表
-     */
-    @Override
-    public List<DiseaseCostDetailVO> getDiseaseCostDetail(String computeDate) {
-        List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDiseaseCostDetailList(computeDate);
-        if(CollectionUtils.isEmpty(projectCostAccountList)){
-            throw new CostException("请先计算患者成本");
+    public List<DiseaseCostDetailVO> getDiseaseCostDetail(String computeDate, String diseaseFilter) {
+        List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDiseaseCostDetailList(computeDate,diseaseFilter);
+        if (CollectionUtils.isEmpty(projectCostAccountList)) {
+            throw new CostException("找不到满足条件的数据");
         }
+        return getDiseaseCostDetail( computeDate,projectCostAccountList);
+    }
+
+    public List<DiseaseCostDetailVO> getDiseaseCostDetail(String computeDate, List<DiseaseCostDetailVO> projectCostAccountList){
         // 获取所有的标准字典数据
         StandCostDictMapVO standCostDictMaps = getStandCostDictMaps();
         // 记录项目类别对象
@@ -1034,17 +1031,29 @@ public class StandardReportServiceImpl implements StandardReportService {
 
 
     /**
-     * 获取病种成本构成明细表数据
+     * 获取医院病种成本明细表数据
      *
-     * @return 病种成本明细列表,包含各病种的成本明细及总计行
+     * @return 病种成本明细列表
      */
     @Override
-    public List<DiseaseCostDetailVO> getDiseaseCostCompositionDetail(String computeDate) {
-
-        List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDiseaseCostCompositionDetail(computeDate);
+    public List<DiseaseCostDetailVO> getDiseaseCostDetail(String computeDate) {
+        List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDiseaseCostDetailList(computeDate,null);
         if(CollectionUtils.isEmpty(projectCostAccountList)){
             throw new CostException("请先计算患者成本");
         }
+        return getDiseaseCostDetail( computeDate,projectCostAccountList);
+    }
+
+    public List<DiseaseCostDetailVO> getDiseaseCostCompositionDetail(String computeDate, String diseaseFilter) {
+
+        List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDiseaseCostCompositionDetail(computeDate, diseaseFilter);
+        if (CollectionUtils.isEmpty(projectCostAccountList)) {
+            throw new CostException("找不到满足条件的数据");
+        }
+        return getDiseaseCostCompositionDetail(computeDate,projectCostAccountList);
+    }
+
+    public List<DiseaseCostDetailVO> getDiseaseCostCompositionDetail(String computeDate, List<DiseaseCostDetailVO> projectCostAccountList) {
         // 记录项目类别对象
         Map<String, DiseaseCostDetailVO> diseaseCostMap = new HashMap<>();
         for (DiseaseCostDetailVO projectCostAccount : projectCostAccountList) {
@@ -1070,20 +1079,35 @@ public class StandardReportServiceImpl implements StandardReportService {
         List<DiseaseCostDetailVO> diseaseCostDetailList =new ArrayList<>(diseaseCostMap.values());
         //按会计科目类型计算占比
         diseaseCostDetailList.forEach(vo -> setAccountTypeExpenseRatio(vo));
+        diseaseCostDetailList.sort(Comparator.comparing(DiseaseCostDetailVO::getItemCode));
         return diseaseCostDetailList;
     }
 
+
     /**
-     * 获取服务单元病种成本构成明细表数据
-     * @param computeDate
-     * @return
+     * 获取病种成本构成明细表数据
+     *
+     * @return 病种成本明细列表,包含各病种的成本明细及总计行
      */
     @Override
-    public StandardDeptCostCollectResponse getDeptDiseaseCostCompositionDetail(String computeDate) {
-        List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDeptDiseaseCostCompositionDetail(computeDate);
+    public List<DiseaseCostDetailVO> getDiseaseCostCompositionDetail(String computeDate) {
+
+        List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDiseaseCostCompositionDetail(computeDate,null);
         if(CollectionUtils.isEmpty(projectCostAccountList)){
             throw new CostException("请先计算患者成本");
         }
+       return getDiseaseCostCompositionDetail(computeDate,projectCostAccountList);
+    }
+
+    public StandardDeptCostCollectResponse getDeptDiseaseCostCompositionDetail(String computeDate, String diseaseFilter) {
+        List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDeptDiseaseCostCompositionDetail(computeDate,diseaseFilter);
+        if(CollectionUtils.isEmpty(projectCostAccountList)){
+            throw new CostException("找不到满足条件的数据");
+        }
+        return getDeptDiseaseCostCompositionDetail( computeDate,projectCostAccountList);
+    }
+
+    public StandardDeptCostCollectResponse getDeptDiseaseCostCompositionDetail(String computeDate,List<DiseaseCostDetailVO> projectCostAccountList) {
         //科室责任中心对照数据
         List<ResponsibilityDepartIdVO> responsibilityDepartment = responsibilityDepartmentRepository.getResponsibility(UserContext.getHospId());
         Map<String, List<ResponsibilityDepartIdVO>> deptRespMap = responsibilityDepartment.stream()
@@ -1183,6 +1207,20 @@ public class StandardReportServiceImpl implements StandardReportService {
         return response;
     }
 
+    /**
+     * 获取服务单元病种成本构成明细表数据
+     * @param computeDate
+     * @return
+     */
+    @Override
+    public StandardDeptCostCollectResponse getDeptDiseaseCostCompositionDetail(String computeDate) {
+        List<DiseaseCostDetailVO> projectCostAccountList = computePatientCostAccountRepository.getDeptDiseaseCostCompositionDetail(computeDate,null);
+        if(CollectionUtils.isEmpty(projectCostAccountList)){
+            throw new CostException("请先计算患者成本");
+        }
+        return getDeptDiseaseCostCompositionDetail( computeDate,projectCostAccountList);
+    }
+
     /**
      * 获取医院DRG成本明细表数据
      *
@@ -2358,9 +2396,14 @@ public class StandardReportServiceImpl implements StandardReportService {
     }
 
     @Override
-    public Object getDiseaseCostDetailByPage(Integer current, Integer pageSize, String computeDate) {
+    public Object getDiseaseCostDetailByPage(Integer current, Integer pageSize, String computeDate, String diseaseFilter) {
         // 获取完整数据列表
-        List<DiseaseCostDetailVO> fullList = getDiseaseCostDetail(computeDate);
+        List<DiseaseCostDetailVO> fullList;
+        if (StringUtils.isEmpty(diseaseFilter)) {
+            fullList = getDiseaseCostDetail(computeDate);
+        } else {
+            fullList = getDiseaseCostDetail(computeDate, diseaseFilter);
+        }
         
         // 手动分页
         int total = fullList.size();
@@ -2377,10 +2420,14 @@ public class StandardReportServiceImpl implements StandardReportService {
     }
 
     @Override
-    public Object getDiseaseCostCompositionDetailByPage(Integer current, Integer pageSize, String computeDate) {
+    public Object getDiseaseCostCompositionDetailByPage(Integer current, Integer pageSize, String computeDate, String diseaseFilter) {
         // 获取完整数据列表
-        List<DiseaseCostDetailVO> fullList = getDiseaseCostCompositionDetail(computeDate);
-        
+        List<DiseaseCostDetailVO> fullList ;
+        if (StringUtils.isEmpty(diseaseFilter)) {
+            fullList = getDiseaseCostCompositionDetail(computeDate);
+        } else {
+            fullList = getDiseaseCostCompositionDetail(computeDate,diseaseFilter);
+        }
         // 手动分页
         int total = fullList.size();
         int startIndex = (current - 1) * pageSize;
@@ -2396,10 +2443,14 @@ public class StandardReportServiceImpl implements StandardReportService {
     }
 
     @Override
-    public Object getDeptDiseaseCostCompositionDetailByPage(Integer current, Integer pageSize, String computeDate) {
+    public Object getDeptDiseaseCostCompositionDetailByPage(Integer current, Integer pageSize, String computeDate, String diseaseFilter) {
         // 获取完整数据
-        StandardDeptCostCollectResponse fullData = getDeptDiseaseCostCompositionDetail(computeDate);
-        
+        StandardDeptCostCollectResponse fullData ;
+        if (StringUtils.isEmpty(diseaseFilter)) {
+            fullData = getDeptDiseaseCostCompositionDetail(computeDate);
+        } else {
+            fullData = getDeptDiseaseCostCompositionDetail(computeDate,diseaseFilter);
+        }
         // 对数据进行分页
         List<StandardReportFormCustomVo> fullList = fullData.getData();
         int total = fullList.size();

+ 9 - 6
src/main/java/com/kcim/web/StandardReportController.java

@@ -105,8 +105,9 @@ public class StandardReportController extends AbstractController {
     @GetMapping("/getDiseaseCostDetailByPage")
     public Result getDiseaseCostDetailByPage(@RequestParam(defaultValue = "1") Integer current,
                                              @RequestParam(defaultValue = "10") Integer pageSize,
-                                             @RequestParam String computeDate) {
-        return Result.ok(standardReportService.getDiseaseCostDetailByPage(current, pageSize, computeDate));
+                                             @RequestParam String computeDate,
+                                             @RequestParam(required = false) String diseaseFilter) {
+        return Result.ok(standardReportService.getDiseaseCostDetailByPage(current, pageSize, computeDate, diseaseFilter));
     }
 
     @ApiOperation("医院病种成本构成明细表")
@@ -119,8 +120,9 @@ public class StandardReportController extends AbstractController {
     @GetMapping("/getDiseaseCostCompositionDetailByPage")
     public Result getDiseaseCostCompositionDetailByPage(@RequestParam(defaultValue = "1") Integer current,
                                                         @RequestParam(defaultValue = "10") Integer pageSize,
-                                                        @RequestParam String computeDate) {
-        return Result.ok(standardReportService.getDiseaseCostCompositionDetailByPage(current, pageSize, computeDate));
+                                                        @RequestParam String computeDate,
+                                                        @RequestParam(required = false) String diseaseFilter) {
+        return Result.ok(standardReportService.getDiseaseCostCompositionDetailByPage(current, pageSize, computeDate, diseaseFilter));
     }
 
     @ApiOperation("医院服务单元病种成本构成明细表")
@@ -133,8 +135,9 @@ public class StandardReportController extends AbstractController {
     @GetMapping("/getDeptDiseaseCostCompositionDetailByPage")
     public Result getDeptDiseaseCostCompositionDetailByPage(@RequestParam(defaultValue = "1") Integer current,
                                                             @RequestParam(defaultValue = "10") Integer pageSize,
-                                                            @RequestParam String computeDate) {
-        return Result.ok(standardReportService.getDeptDiseaseCostCompositionDetailByPage(current, pageSize, computeDate));
+                                                            @RequestParam String computeDate,
+                                                            @RequestParam(required = false) String diseaseFilter) {
+        return Result.ok(standardReportService.getDeptDiseaseCostCompositionDetailByPage(current, pageSize, computeDate, diseaseFilter));
     }
 
     @ApiOperation("医院DRG成本明细表")

+ 12 - 0
src/main/resources/mapper/ComputePatientCostAccountMapper.xml

@@ -43,6 +43,10 @@
             a.del_flag = 0
           AND a.hosp_id = #{hospId,jdbcType=BIGINT}
           AND a.compute_date = #{computeDate,jdbcType=VARCHAR}
+          <if test="diseaseFilter != null and diseaseFilter != ''">
+            AND (c.`primary_diag_code` LIKE CONCAT('%', #{diseaseFilter,jdbcType=VARCHAR}, '%') 
+                 OR c.`primary_diag_name` LIKE CONCAT('%', #{diseaseFilter,jdbcType=VARCHAR}, '%'))
+          </if>
         GROUP BY
 --             c.`primary_diag_code`,
             SUBSTR(c.`primary_diag_code`,1,3),
@@ -69,6 +73,10 @@
             a.del_flag = 0
           AND a.hosp_id = #{hospId,jdbcType=BIGINT}
           AND a.compute_date = #{computeDate,jdbcType=VARCHAR}
+          <if test="diseaseFilter != null and diseaseFilter != ''">
+            AND (c.`primary_diag_code` LIKE CONCAT('%', #{diseaseFilter,jdbcType=VARCHAR}, '%') 
+                 OR c.`primary_diag_name` LIKE CONCAT('%', #{diseaseFilter,jdbcType=VARCHAR}, '%'))
+          </if>
         GROUP BY
 --             c.`primary_diag_code`,
             SUBSTR(c.`primary_diag_code`,1,3),
@@ -96,6 +104,10 @@
             a.del_flag = 0
           AND a.hosp_id = #{hospId,jdbcType=BIGINT}
           AND a.compute_date = #{computeDate,jdbcType=VARCHAR}
+          <if test="diseaseFilter != null and diseaseFilter != ''">
+            AND (c.`primary_diag_code` LIKE CONCAT('%', #{diseaseFilter,jdbcType=VARCHAR}, '%') 
+                 OR c.`primary_diag_name` LIKE CONCAT('%', #{diseaseFilter,jdbcType=VARCHAR}, '%'))
+          </if>
         GROUP BY
 --             c.`primary_diag_code`,
             SUBSTR(c.`primary_diag_code`,1,3),