Browse Source

住院超过31天病人数

zhaops 4 years ago
parent
commit
38ff8ff613

+ 7 - 2
src/main/java/com/diagbot/dto/EntryStatisticsDTO.java

@@ -143,6 +143,11 @@ public class EntryStatisticsDTO {
      * 危急值记录病历数
      */
     private Integer crisisMRNum = 0;
+    /**
+     * 住院超过31日病人数
+     */
+    @Excel(name = "住院超过31日病人数", width = 15, orderNum = "12")
+    private Integer beHosGT31DaysMRNum;
     /**
      * 阶段小节未书写条目id
      */
@@ -154,7 +159,7 @@ public class EntryStatisticsDTO {
     /**
      * 阶段小节未书写数
      */
-    @Excel(name = "阶段小节未书写数", width = 15, orderNum = "12")
+    @Excel(name = "阶段小节未书写数", width = 15, orderNum = "13")
     private Integer stageSummaryNum = 0;
     /**
      * 阶段小节未书写率
@@ -163,7 +168,7 @@ public class EntryStatisticsDTO {
     /**
      * 阶段小节未书写率(百分比)
      */
-    @Excel(name = "阶段小节未书写率", width = 15, orderNum = "13")
+    @Excel(name = "阶段小节未书写率", width = 15, orderNum = "14")
     private String stageSummaryPercentStr = "0.00%";
     /**
      * 病人住院超过30天的病历数

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

@@ -807,6 +807,13 @@ public class ConsoleFacade {
             record.setStageSummaryPercent(stageSummaryPercent);
             record.setStageSummaryPercentStr(stageSummaryPercentStr);
         }
+        //住院超过31日病人数
+        Integer beHosGT31DaysMRNum = records
+                .stream()
+                .map(EntryStatisticsDTO::getBeHosGT31DaysMRNum)
+                .reduce(0, Integer::sum);
+        record.setBeHosGT31DaysMRNum(beHosGT31DaysMRNum);
+
         return record;
     }
 

+ 5 - 0
src/main/java/com/diagbot/vo/QcResultShortPageVO.java

@@ -117,4 +117,9 @@ public class QcResultShortPageVO extends Page {
      * 是否归档(0:未归档,1:已归档)
      */
     private String isPlacefile = "1";
+
+    /**
+     * 住院超过31日标志
+     */
+    private Integer beHosGT31Days;
 }

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

@@ -472,6 +472,7 @@ public class ConsoleController {
                     "doctorId:医生工号 <br>" +
                     "doctorName:医生姓名 <br>" +
                     "level: 病历等级 <br>" +
+                    "beHosGT31Days: 住院超过31日标志 <br>" +
                     "isReject: 单项否决 1-否决,0-非<br>" +
                     "ruleType: 规则类型 0:无,1:空项,2:错误<br>" +
                     "checkStatus: 核查状态(1:已核查,0:未核查) <br>" +

+ 1 - 0
src/main/java/com/diagbot/web/ConsoleExportController.java

@@ -215,6 +215,7 @@ public class ConsoleExportController {
                     "doctorId:医生工号 <br>" +
                     "doctorName:医生姓名 <br>" +
                     "level: 病历等级 <br>" +
+                    "beHosGT31Days: 住院超过31日标志 <br>" +
                     "isReject: 单项否决 1-否决,0-非<br>" +
                     "ruleType: 规则类型 0:无,1:空项,2:错误<br>" +
                     "checkStatus: 核查状态(1:已核查,0:未核查) <br>" +

+ 83 - 6
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -3195,6 +3195,12 @@
             DATE( a.behospital_date ),
             DATE( a.leave_hospital_date ))> 30
         </if>
+        <if test="qcResultShortPageVO.beHosGT31Days != null and qcResultShortPageVO.beHosGT31Days==1">
+            AND TIMESTAMPDIFF(
+            DAY,
+            DATE( a.behospital_date ),
+            DATE( a.leave_hospital_date ))> 31
+        </if>
         )be
         left join med_check_info mci
         on mci.is_deleted = 'N'
@@ -3527,7 +3533,8 @@
         stageSummaryMRNum,
         stageSummaryNum,
         ROUND( IFNULL( stageSummaryNum / stageSummaryMRNum, 0 ), 4 ) AS stageSummaryPercent,
-        CONCAT( ROUND( IFNULL( stageSummaryNum / stageSummaryMRNum, 0 ) * 100, 2 ), '%' ) AS stageSummaryPercentStr
+        CONCAT( ROUND( IFNULL( stageSummaryNum / stageSummaryMRNum, 0 ) * 100, 2 ), '%' ) AS stageSummaryPercentStr,
+        beHosGT31DaysMRNum
         FROM
         (
         SELECT
@@ -3542,7 +3549,8 @@
         sum( tt.crisisNum ) AS crisisNum,
         sum( tt.crisisMRNum ) AS crisisMRNum,
         sum( tt.stageSummaryNum ) AS stageSummaryNum,
-        sum( tt.stageSummaryMRNum ) AS stageSummaryMRNum
+        sum( tt.stageSummaryMRNum ) AS stageSummaryMRNum,
+        sum( tt.beHosGT31DaysMRNum ) AS beHosGT31DaysMRNum
         FROM
         (
         (
@@ -3558,7 +3566,8 @@
         0 AS crisisNum,
         0 AS crisisMRNum,
         0 AS stageSummaryNum,
-        0 AS stageSummaryMRNum
+        0 AS stageSummaryMRNum,
+        0 AS beHosGT31DaysMRNum
         FROM
         (
         SELECT DISTINCT
@@ -3612,7 +3621,8 @@
         0 AS crisisNum,
         0 AS crisisMRNum,
         0 AS stageSummaryNum,
-        0 AS stageSummaryMRNum
+        0 AS stageSummaryMRNum,
+        0 AS beHosGT31DaysMRNum
         FROM
         (
         SELECT DISTINCT
@@ -3669,7 +3679,8 @@
         sum( d.cases_entry_id = 2419 ) AS crisisNum,
         count( DISTINCT c.behospital_code ) AS crisisMRNum,
         0 AS stageSummaryNum,
-        0 AS stageSummaryMRNum
+        0 AS stageSummaryMRNum,
+        0 AS beHosGT31DaysMRNum
         FROM
         (
         SELECT DISTINCT
@@ -3722,7 +3733,8 @@
         0 AS crisisNum,
         0 AS crisisMRNum,
         sum( c.cases_entry_id = 2495 ) AS stageSummaryNum,
-        count( DISTINCT b.behospital_code ) AS stageSummaryMRNum
+        count( DISTINCT b.behospital_code ) AS stageSummaryMRNum,
+        0 AS beHosGT31DaysMRNum
         FROM
         (
         SELECT DISTINCT
@@ -3761,6 +3773,57 @@
         GROUP BY
         b.beh_dept_id,
         b.beh_dept_name
+        ) UNION
+        (
+        SELECT
+        b.beh_dept_id AS deptId,
+        b.beh_dept_name AS deptName,
+        0 AS consultationNum,
+        0 AS consultationMRNum,
+        0 AS operationNameNum,
+        0 AS operationTimeNum,
+        0 AS operation15MinuteNum,
+        0 AS operationMRNum,
+        0 AS crisisNum,
+        0 AS crisisMRNum,
+        0 AS stageSummaryNum,
+        0 AS stageSummaryMRNum,
+        count(*) AS beHosGT31DaysMRNum
+        FROM
+        (
+        SELECT DISTINCT
+        a.hospital_id,
+        a.behospital_code,
+        a.beh_dept_name,
+        a.beh_dept_id
+        FROM
+        med_behospital_info a
+        WHERE
+        a.is_deleted = 'N'
+        AND TIMESTAMPDIFF(
+        DAY,
+        DATE( behospital_date ),
+        DATE( leave_hospital_date ))> 31
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        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 >= #{startDate}]]>
+        </if>
+        <if test="endDate != null">
+            <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+        </if>
+        <if test="deptName != null and deptName != ''">
+            AND a.beh_dept_name = #{deptName}
+        </if>
+        ) b
+        GROUP BY
+        b.beh_dept_id,
+        b.beh_dept_name
         )
         ) tt
         GROUP BY
@@ -3794,6 +3857,7 @@
                 <when test='asc=="stageSummaryPercent"'>stageSummaryPercent asc</when>
                 <when test='asc=="stageSummaryPercentStr"'>stageSummaryPercent asc</when>
                 <when test='asc=="stageSummaryMRNum"'>stageSummaryMRNum asc</when>
+                <when test='asc=="beHosGT31DaysMRNum"'>beHosGT31DaysMRNum asc</when>
                 <otherwise>deptName asc</otherwise>
             </choose>
         </if>
@@ -3824,6 +3888,7 @@
                 <when test='desc=="stageSummaryPercent"'>stageSummaryPercent desc</when>
                 <when test='desc=="stageSummaryPercentStr"'>stageSummaryPercent desc</when>
                 <when test='desc=="stageSummaryMRNum"'>stageSummaryMRNum desc</when>
+                <when test='desc=="beHosGT31DaysMRNum"'>beHosGT31DaysMRNum desc</when>
                 <otherwise>deptName desc</otherwise>
             </choose>
         </if>
@@ -5379,6 +5444,12 @@
             DATE( a.behospital_date ),
             DATE( a.leave_hospital_date ))> 30
         </if>
+        <if test="qcResultShortPageVO.beHosGT31Days != null and qcResultShortPageVO.beHosGT31Days==1">
+            AND TIMESTAMPDIFF(
+            DAY,
+            DATE( a.behospital_date ),
+            DATE( a.leave_hospital_date ))> 31
+        </if>
         )be
         left join med_check_info mci
         on mci.is_deleted = 'N'
@@ -5608,6 +5679,12 @@
             DATE( a.behospital_date ),
             DATE( a.leave_hospital_date ))> 30
         </if>
+        <if test="qcResultShortPageVO.beHosGT31Days != null and qcResultShortPageVO.beHosGT31Days==1">
+            AND TIMESTAMPDIFF(
+            DAY,
+            DATE( a.behospital_date ),
+            DATE( a.leave_hospital_date ))> 31
+        </if>
         )be
         left join med_check_info mci
         on mci.is_deleted = 'N'