ソースを参照

1、各科室甲级、乙级、丙级病历占比

zhaops 5 年 前
コミット
9cf36ab0a2

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -66,6 +66,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/qc/behospitalInfo/exportQcresultByDept").permitAll()
                 .antMatchers("/console/entryRejectPercent").permitAll()
                 .antMatchers("/qc/abnormal/getQcAnnormalMode").permitAll()
+                .antMatchers("/console/qcResultLevelPercent").permitAll()
                 .antMatchers("/**").authenticated();
 //                .antMatchers("/**").permitAll();
     }

+ 1 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -109,6 +109,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/qc/behospitalInfo/exportQcresultByDept", request)
                 || matchers("/console/entryRejectPercent", request)
                 || matchers("/qc/abnormal/getQcAnnormalMode", request)
+                || matchers("/console/qcResultLevelPercent", request)
                 || matchers("/", request)) {
             return true;
         }

+ 26 - 0
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -6,6 +6,7 @@ import com.diagbot.aggregate.MrStatisticsAggregate;
 import com.diagbot.aggregate.ResultStatisticsAggregate;
 import com.diagbot.dto.AverageStatisticsDTO;
 import com.diagbot.dto.CaseNumDTO;
+import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.NumDTO;
@@ -14,6 +15,7 @@ import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterPageByAverageVO;
@@ -317,6 +319,30 @@ public class ConsoleFacade {
         return retList;
     }
 
+    /**
+     * 各科室甲/乙/丙级病历占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO) {
+        if (StringUtil.isBlank(filterVO.getLevel())) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入病历等级");
+        }
+        List<DeptNumDTO> retList = Lists.newLinkedList();
+        filterVOSet(filterVO);
+        Integer limitCount = filterVO.getLimitCount();
+        List<DeptNumDTO> numDTOList = qcresultInfoFacade.qcResultLevelPercent(filterVO);
+        if (ListUtil.isNotEmpty(numDTOList)) {
+            if (numDTOList.size() <= limitCount) {
+                retList = numDTOList;
+            } else {
+                retList = numDTOList.subList(0, limitCount);
+            }
+        }
+        return retList;
+    }
+
     /**
      * 各科室缺陷占比
      *

+ 8 - 0
src/main/java/com/diagbot/mapper/QcresultInfoMapper.java

@@ -180,4 +180,12 @@ public interface QcresultInfoMapper extends BaseMapper<QcresultInfo> {
      * @return
      */
     public List<EntryNumDTO> entryRejectPercent(FilterVO filterVO);
+
+    /**
+     * 各科室甲/乙/丙级病历占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO);
 }

+ 8 - 0
src/main/java/com/diagbot/service/QcresultInfoService.java

@@ -181,4 +181,12 @@ public interface QcresultInfoService extends IService<QcresultInfo> {
      * @return
      */
     public List<EntryNumDTO> entryRejectPercent(FilterVO filterVO);
+
+    /**
+     * 各科室甲/乙/丙级病历占比
+     *
+     * @param filterVO
+     * @return
+     */
+    public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO);
 }

+ 11 - 0
src/main/java/com/diagbot/service/impl/QcresultInfoServiceImpl.java

@@ -242,4 +242,15 @@ public class QcresultInfoServiceImpl extends ServiceImpl<QcresultInfoMapper, Qcr
     public List<EntryNumDTO> entryRejectPercent(FilterVO filterVO) {
         return baseMapper.entryRejectPercent(filterVO);
     }
+
+    /**
+     * 各科室甲/乙/丙级病历占比
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public List<DeptNumDTO> qcResultLevelPercent(FilterVO filterVO) {
+        return baseMapper.qcResultLevelPercent(filterVO);
+    }
 }

+ 2 - 0
src/main/java/com/diagbot/vo/FilterVO.java

@@ -47,4 +47,6 @@ public class FilterVO {
      * 科室分类
      */
     private String deptClass;
+
+    private String level;
 }

+ 3 - 1
src/main/java/com/diagbot/web/ConsoleByDeptController.java

@@ -151,7 +151,9 @@ public class ConsoleByDeptController {
     @ApiOperation(value = "条目缺陷占比-内页(分页)-内页[by:zhaops]",
             notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
                     "name: 缺陷名称<br>" +
-                    "deptName: 科室名称(必填)<br>")
+                    "deptName: 科室名称(必填)<br>" +
+                    "isReject: 单项否决 1-否决,0-非<br>" +
+                    "casesName: 模块名称<br>")
     @PostMapping("/entryGroupByEntryAndDeptInnerPage")
     @SysLogger("entryGroupByEntryAndDeptInnerPage")
     public RespDTO<IPage<DeptEntryNumDTO>> entryGroupByEntryAndDeptInnerPage(@RequestBody @Valid FilterPageByDeptVO filterPageByDeptVO) {

+ 22 - 3
src/main/java/com/diagbot/web/ConsoleController.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.AverageStatisticsDTO;
 import com.diagbot.dto.CaseNumDTO;
+import com.diagbot.dto.DeptNumDTO;
 import com.diagbot.dto.EntryNumDTO;
 import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.NumDTO;
@@ -124,7 +125,7 @@ public class ConsoleController {
      */
     @ApiOperation(value = "各科室质控平均分(首页)-根据内外科系统统计[by:zhaops]",
             notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
-                    "deptClass: 科室分类:内科/外科,全部不传 <br>" )
+                    "deptClass: 科室分类:内科/外科,全部不传 <br>")
     @PostMapping("/getAverageScoreByDeptClass")
     @SysLogger("getAverageScoreByDeptClass")
     public RespDTO<Map<String, Object>> getAverageScoreByDeptClass(@RequestBody @Valid FilterVO filterVO) {
@@ -194,7 +195,9 @@ public class ConsoleController {
      * @return
      */
     @ApiOperation(value = "条目缺陷占比(首页)[by:zhaops]",
-            notes = "type: 统计维度 1-本月,2-本年(必填)<br>")
+            notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
+                    "isReject: 单项否决 1-否决,0-非<br>" +
+                    "casesName: 模块名称<br>")
     @PostMapping("/entryCountGroupByEntry")
     @SysLogger("entryCountGroupByEntry")
     public RespDTO<Map<String, Object>> entryCountGroupByEntry(@RequestBody @Valid FilterVO filterVO) {
@@ -215,6 +218,21 @@ public class ConsoleController {
         return RespDTO.onSuc(consoleFacade.entryRejectPercent(filterVO));
     }
 
+    /**
+     * 单项否决缺陷占比
+     *
+     * @param filterVO
+     * @return
+     */
+    @ApiOperation(value = "各科室甲/乙/丙级病历占比(首页)[by:zhaops]",
+            notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
+                    "level: 病历等级 甲、乙、丙(必填)<br>")
+    @PostMapping("/qcResultLevelPercent")
+    @SysLogger("qcResultLevelPercent")
+    public RespDTO<List<DeptNumDTO>> qcResultLevelPercent(@RequestBody @Valid FilterVO filterVO) {
+        return RespDTO.onSuc(consoleFacade.qcResultLevelPercent(filterVO));
+    }
+
     /**
      * 各科室缺陷占比
      *
@@ -256,7 +274,8 @@ public class ConsoleController {
             notes = "type: 统计维度 1-本月,2-本年(必填)<br>" +
                     "deptName: 科室名称 <br>" +
                     "casesId: 模块id:243=病案首页 <br>" +
-                    "casesName: 模块名称 <br>")
+                    "casesName: 模块名称 <br>" +
+                    "isReject: 单项否决 1-否决,0-非<br>")
     @PostMapping("/entryCountGroupByEntryPage")
     @SysLogger("entryCountGroupByEntryPage")
     public RespDTO<IPage<CaseNumDTO>> entryCountGroupByEntryPage(@RequestBody @Valid FilterPageVO filterPageVO) {

+ 37 - 0
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -115,6 +115,43 @@
         a.beh_dept_name
     </select>
 
+    <!-- 各科室甲/乙/丙级病历占比 -->
+    <select id="qcResultLevelPercent" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.DeptNumDTO">
+        SELECT
+        a.beh_dept_id AS deptId,
+        a.beh_dept_name AS deptName,
+        <if test="level != null and level != ''">
+            sum( c.`level` = #{level} ) AS num,
+            ROUND( sum( c.`level` = #{level} )/ count(*), 4 ) AS percent,
+            concat( ROUND( sum( c.`level` = #{level} )/ count(*)* 100, 2 ), '%' ) AS percentStr,
+        </if>
+        count(*) AS totleNum
+        FROM
+        med_behospital_info a,
+        med_qcresult_info c
+        WHERE
+        a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = c.behospital_code
+        AND a.is_placefile = '1'
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="startDate != null and startDate != ''">
+            <![CDATA[ and a.leave_hospital_date >= DATE(#{startDate})]]>
+        </if>
+        <if test="endDate != null and endDate != ''">
+            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        </if>
+        GROUP BY
+        a.beh_dept_id,
+        a.beh_dept_name
+        ORDER  BY
+        percent DESC
+    </select>
+
     <!-- 按模块统计质控缺陷数 -->
     <select id="entryCountGroupByCase" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.NumDTO">
         SELECT