Browse Source

1、病案首页质控病历统计
2、病案首页完整率统计

zhaops 5 years ago
parent
commit
f0204113e0

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

@@ -101,6 +101,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/console/qcResultShortPage").permitAll()
                 .antMatchers("/console/resultStatistics").permitAll()
                 .antMatchers("/console/resultStatisticsByDeptPage").permitAll()
+                .antMatchers("/console/homePageMRCount").permitAll()
                 .antMatchers("/consoleByDept/entryCountGroupByCaseAndDept").permitAll()
                 .antMatchers("/consoleByDept/entryCountGroupByCaseAndDeptPage").permitAll()
                 .antMatchers("/consoleByDept/entryCountGroupByEntryAndDept").permitAll()

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

@@ -144,6 +144,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/console/qcResultShortPage", request)
                 || matchers("/console/resultStatistics", request)
                 || matchers("/console/resultStatisticsByDeptPage", request)
+                || matchers("/console/homePageMRCount", request)
                 || matchers("/consoleByDept/entryCountGroupByCaseAndDept", request)
                 || matchers("/consoleByDept/entryCountGroupByCaseAndDeptPage", request)
                 || matchers("/consoleByDept/entryCountGroupByEntryAndDept", request)

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

@@ -777,4 +777,29 @@ public class ConsoleFacade {
         }
         return record;
     }
+
+    /**
+     * 病案首页合格率、完整率、改善率统计
+     * @param filterVO
+     * @return
+     */
+    public Map<String,Object> homePageMRCount(FilterVO filterVO) {
+        Map<String, Object> retMap = new HashMap<>();
+        retMap.put("合格率", null);
+        retMap.put("完整率", null);
+        retMap.put("改善率", null);
+        filterFacade.filterVOSet(filterVO);
+        HomePageNumDTO qcNumDTO = behospitalInfoFacade.homePageQcPercent(filterVO);
+        HomePageNumDTO emptyNumDTO = behospitalInfoFacade.hmEmptyEntryPercent(filterVO);
+
+        /*qcNumDTO.setEntryTotleNum(emptyNumDTO.getEntryTotleNum());
+        qcNumDTO.setEmptyNum(emptyNumDTO.getEmptyNum());
+        qcNumDTO.setEmptyPercent(emptyNumDTO.getEmptyPercent());
+        qcNumDTO.setEmptyPercentStr(emptyNumDTO.getEmptyPercentStr());*/
+
+        retMap.put("合格率", qcNumDTO);
+        retMap.put("完整率", emptyNumDTO);
+        retMap.put("改善率", null);
+        return retMap;
+    }
 }

+ 16 - 0
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -270,4 +270,20 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
     public int get31DaysBehospitalCount(FilterVO filterVO);
+
+    /**
+     * 病案首页质控病历数统计-全院(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+    public HomePageNumDTO homePageQcPercent(FilterVO filterVO);
+
+    /**
+     * 病案首页完整率统计-全院(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+    public HomePageNumDTO hmEmptyEntryPercent(FilterVO filterVO);
 }

+ 16 - 0
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -263,4 +263,20 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public int get31DaysBehospitalCount(FilterVO filterVO);
+
+    /**
+     * 病案首页质控病历数统计-全院(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+    public HomePageNumDTO homePageQcPercent(FilterVO filterVO);
+
+    /**
+     * 病案首页完整率统计-全院(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+    public HomePageNumDTO hmEmptyEntryPercent(FilterVO filterVO);
 }

+ 22 - 0
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -358,4 +358,26 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public int get31DaysBehospitalCount(FilterVO filterVO) {
         return baseMapper.get31DaysBehospitalCount(filterVO);
     }
+
+    /**
+     * 病案首页质控病历数统计-全院(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public HomePageNumDTO homePageQcPercent(FilterVO filterVO) {
+        return baseMapper.homePageQcPercent(filterVO);
+    }
+
+    /**
+     * 病案首页完整率统计-全院(首页)
+     *
+     * @param filterVO
+     * @return
+     */
+    @Override
+    public HomePageNumDTO hmEmptyEntryPercent(FilterVO filterVO) {
+        return baseMapper.hmEmptyEntryPercent(filterVO);
+    }
 }

+ 15 - 0
src/main/java/com/diagbot/web/ConsoleController.java

@@ -492,4 +492,19 @@ public class ConsoleController {
     public RespDTO<List<EntryStatisticsDTO>> entryStatistics(@RequestBody @Valid EntryStatisticsVO entryStatisticsVO) {
         return RespDTO.onSuc(consoleFacade.entryStatistics(entryStatisticsVO));
     }
+
+    /**
+     * 病案首页病历统计
+     *
+     * @param filterVO
+     * @return
+     */
+    @ApiOperation(value = "病案首页病历统计[by:zhaops]",
+            notes = "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>")
+    @PostMapping("/homePageMRCount")
+    @SysLogger("homePageMRCount")
+    public RespDTO<Map<String, Object>> homePageMRCount(@RequestBody @Valid FilterVO filterVO) {
+        return RespDTO.onSuc(consoleFacade.homePageMRCount(filterVO));
+    }
 }

+ 94 - 3
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -1525,7 +1525,7 @@
         AND a.behospital_code = c.behospital_code
         AND c.cases_id = 243
         AND a.is_placefile = '1'
-        <![CDATA[AND a.qc_type_id <>0 ]]>
+        AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
@@ -1569,7 +1569,7 @@
         AND d.cases_entry_id = e.id
         AND d.cases_id = 243
         AND a.is_placefile = '1'
-        <![CDATA[AND a.qc_type_id <>0 ]]>
+        AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
@@ -1628,7 +1628,7 @@
         AND c.cases_entry_id = d.id
         AND a.is_placefile = '1'
         AND d.cases_id = 243
-        <![CDATA[AND a.qc_type_id <>0 ]]>
+        AND a.qc_type_id != 0
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
         </if>
@@ -3628,4 +3628,95 @@
         AND ( TIMESTAMPDIFF( DAY, DATE( t2.leave_hospital_date ), DATE( t1.behospital_date )) BETWEEN 0 AND 31 )) bc2
         ) t
     </select>
+
+    <!-- 病案首页质控病历数统计-全院(首页)-->
+    <select id="homePageQcPercent" resultType="com.diagbot.dto.HomePageNumDTO" parameterType="com.diagbot.vo.FilterVO">
+        SELECT
+        count( * ) AS mrNum,
+        ROUND( sum( CAST( c.score_res AS DECIMAL ( 18, 2 )) ), 2 ) AS totleValue,
+        ROUND( avg( CAST( c.score_res AS DECIMAL ( 18, 2 )) ), 2 ) AS averageValue,
+        SUM( c.`level` = '合格' ) AS firstLevelNum,
+        SUM( c.`level` = '不合格' ) AS secondLevelNum,
+        ROUND( SUM( c.`level` = '合格' )/ count( * ), 4 ) AS firstLevelPercent,
+        ROUND( SUM( c.`level` = '不合格' )/ count( * ), 4 ) AS secondLevelPercent,
+        concat( ROUND( SUM( c.`level` = '合格' )/ count( * )* 100, 2 ), '%' ) AS firstLevelPercentStr,
+        concat( ROUND( SUM( c.`level` = '不合格' )/ count( * )* 100, 2 ), '%' ) AS secondLevelPercentStr
+        FROM
+        med_behospital_info a,
+        med_qcresult_cases 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 c.cases_id = 243
+        AND a.is_placefile = '1'
+        AND a.qc_type_id != 0
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="startDate != null">
+            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+        </if>
+        <if test="endDate != null">
+            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        </if>
+    </select>
+
+    <!-- 病案首页完整率统计-全院(首页)-->
+    <select id="hmEmptyEntryPercent" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.HomePageNumDTO">
+        SELECT
+        h1.emptyNum,
+        h1.mrNum,
+        h2.entryNum,
+        h1.mrNum * h2.entryNum AS entryTotleNum,
+        ROUND( ( h1.mrNum * h2.entryNum - h1.emptyNum ) / ( h1.mrNum * h2.entryNum ), 4 ) AS emptyPercent,
+        CONCAT(
+        ROUND( ( h1.mrNum * h2.entryNum - h1.emptyNum ) / ( h1.mrNum * h2.entryNum )* 100, 2 ),
+        '%'
+        ) AS emptyPercentStr
+        FROM
+        (
+        SELECT
+        sum( d.rule_type = 1 ) AS emptyNum,
+        count( DISTINCT a.behospital_code ) AS mrNum
+        FROM
+        med_behospital_info a,
+        med_qcresult_cases b,
+        med_qcresult_detail c,
+        qc_cases_entry d
+        WHERE
+        a.is_deleted = 'N'
+        AND b.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND a.hospital_id = b.hospital_id
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = b.behospital_code
+        AND a.behospital_code = c.behospital_code
+        AND b.cases_id = c.cases_id
+        AND c.cases_id = d.cases_id
+        AND c.cases_entry_id = d.id
+        AND a.is_placefile = '1'
+        AND d.cases_id = 243
+        AND a.qc_type_id != 0
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="startDate != null">
+            <![CDATA[ AND a.leave_hospital_date >= DATE(#{startDate})]]>
+        </if>
+        <if test="endDate != null">
+            <![CDATA[AND a.leave_hospital_date < DATE(#{endDate})]]>
+        </if>
+        ) h1,(
+        SELECT
+        count(*) AS entryNum
+        FROM
+        qc_cases_entry
+        WHERE
+        is_deleted = 'N'
+        AND cases_id = 243
+        ) h2
+    </select>
 </mapper>