Browse Source

厦门五院个性化需求 根据手术级别统计人数

hecc 3 years ago
parent
commit
a2925218ab

+ 53 - 1
src/main/java/com/diagbot/aggregate/LeaveHosStatisticsAggregate.java

@@ -38,7 +38,11 @@ public class LeaveHosStatisticsAggregate {
             @DataConsumer("getNonAdviceCount") Integer nonAdviceNum,
             @DataConsumer("get31DaysBehospitalCount") Integer reBehospitalNum,
             @DataConsumer("getBloodCount") Integer bloodNum,
-            @DataConsumer("getCancerCount") Integer cancerNum) {
+            @DataConsumer("getCancerCount") Integer cancerNum,
+            @DataConsumer("getOperationLevelOneCount") Integer operationLevelOneNum,
+            @DataConsumer("getOperationLevelTwoCount") Integer operationLevelTwoNum,
+            @DataConsumer("getOperationLevelThreeCount") Integer operationLevelThreeNum,
+            @DataConsumer("getOperationLevelFourCount") Integer operationLevelFourNum) {
 
         Map<String, Object> retMap = new LinkedHashMap<>();
         retMap.put("总人数", totleNum);
@@ -49,6 +53,10 @@ public class LeaveHosStatisticsAggregate {
         retMap.put("31日再入院病历数", reBehospitalNum);
         retMap.put("输血患者人数", bloodNum);
         retMap.put("癌痛患者人数", cancerNum);
+        retMap.put("一级手术等级人数", operationLevelOneNum );
+        retMap.put("二级手术等级人数", operationLevelTwoNum );
+        retMap.put("三级手术等级人数", operationLevelThreeNum );
+        retMap.put("四级手术等级人数", operationLevelFourNum );
         return retMap;
 
     }
@@ -97,6 +105,50 @@ public class LeaveHosStatisticsAggregate {
         return behospitalInfoFacade.operationCount(filterVO);
     }
 
+    /**
+     * 一级手术级别人数
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("getOperationLevelOneCount")
+    public Integer getOperationLevelOneCount(@InvokeParameter("filterVO") FilterVO filterVO) {
+        return behospitalInfoFacade.operationLevelOneCount(filterVO);
+    }
+
+    /**
+     * 二级手术级别人数
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("getOperationLevelTwoCount")
+    public Integer getOperationLevelTwoCount(@InvokeParameter("filterVO") FilterVO filterVO) {
+        return behospitalInfoFacade.operationLevelTwoCount(filterVO);
+    }
+
+    /**
+     * 三级手术级别人数
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("getOperationLevelThreeCount")
+    public Integer getOperationLevelThreeCount(@InvokeParameter("filterVO") FilterVO filterVO) {
+        return behospitalInfoFacade.operationLevelThreeCount(filterVO);
+    }
+
+    /**
+     * 四级手术级别人数
+     *
+     * @param filterVO
+     * @return
+     */
+    @DataProvider("getOperationLevelFourCount")
+    public Integer getOperationLevelFourCount(@InvokeParameter("filterVO") FilterVO filterVO) {
+        return behospitalInfoFacade.operationLevelFourCount(filterVO);
+    }
+
     /**
      * 非医嘱离院
      *

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

@@ -85,6 +85,38 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public int operationCount(FilterVO filterVO);
 
+    /**
+     * 一级手术级别人数-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int operationLevelOneCount(FilterVO filterVO);
+
+    /**
+     * 二级手术级别人数-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int operationLevelTwoCount(FilterVO filterVO);
+
+    /**
+     * 三级手术级别人数-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int operationLevelThreeCount(FilterVO filterVO);
+
+    /**
+     * 四级手术级别人数-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int operationLevelFourCount(FilterVO filterVO);
+
     /**
      * 出院总人数统计-科室-首页
      *

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

@@ -121,6 +121,46 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.operationCount(filterVO);
     }
 
+    /**
+     * 一级手术级别人数-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int operationLevelOneCount(FilterVO filterVO) {
+        return baseMapper.operationLevelOneCount(filterVO);
+    }
+
+    /**
+     * 二级手术级别人数-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int operationLevelTwoCount(FilterVO filterVO) {
+        return baseMapper.operationLevelTwoCount(filterVO);
+    }
+
+    /**
+     * 三级手术级别人数-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int operationLevelThreeCount(FilterVO filterVO) {
+        return baseMapper.operationLevelThreeCount(filterVO);
+    }
+
+    /**
+     * 四级手术级别人数-全院-首页
+     *
+     * @param filterVO
+     * @return
+     */
+    public int operationLevelFourCount(FilterVO filterVO) {
+        return baseMapper.operationLevelFourCount(filterVO);
+    }
+
     /**
      * 出院总人数统计-科室-首页
      *

+ 196 - 0
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -21640,4 +21640,200 @@
         </if>
     </select>
 
+    <!--一级手术级别人数-->
+    <select id="operationLevelOneCount" resultType="int" parameterType="com.diagbot.vo.FilterVO">
+        SELECT
+        COUNT(DISTINCT a.behospital_code , case when f.operation_level ='1' then '1' end)
+        FROM
+        med_behospital_info a,
+        med_medical_record c,
+        qc_mode d,
+        med_home_page e,
+        med_home_operation_info f
+        WHERE
+        a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND e.is_deleted = 'N'
+        AND f.is_deleted = 'N'
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = c.behospital_code
+        AND c.mode_id = d.id
+        AND a.hospital_id = e.hospital_id
+        AND a.hospital_id = f.hospital_id
+        AND a.behospital_code = e.behospital_code
+        AND e.home_page_id = f.home_page_id
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND d.`name` = '手术记录'
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+
+    </select>
+
+    <!--二级手术级别人数-->
+    <select id="operationLevelTwoCount" resultType="int" parameterType="com.diagbot.vo.FilterVO">
+        SELECT
+        COUNT(DISTINCT a.behospital_code , case when f.operation_level ='2' then '1' end)
+        FROM
+        med_behospital_info a,
+        med_medical_record c,
+        qc_mode d,
+        med_home_page e,
+        med_home_operation_info f
+        WHERE
+        a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND e.is_deleted = 'N'
+        AND f.is_deleted = 'N'
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = c.behospital_code
+        AND c.mode_id = d.id
+        AND a.hospital_id = e.hospital_id
+        AND a.hospital_id = f.hospital_id
+        AND a.behospital_code = e.behospital_code
+        AND e.home_page_id = f.home_page_id
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND d.`name` = '手术记录'
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+    </select>
+
+    <!--三级手术级别人数-->
+    <select id="operationLevelThreeCount" resultType="int" parameterType="com.diagbot.vo.FilterVO">
+        SELECT
+        COUNT(DISTINCT a.behospital_code , case when f.operation_level ='3' then '1' end)
+        FROM
+        med_behospital_info a,
+        med_medical_record c,
+        qc_mode d,
+        med_home_page e,
+        med_home_operation_info f
+        WHERE
+        a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND e.is_deleted = 'N'
+        AND f.is_deleted = 'N'
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = c.behospital_code
+        AND c.mode_id = d.id
+        AND a.hospital_id = e.hospital_id
+        AND a.hospital_id = f.hospital_id
+        AND a.behospital_code = e.behospital_code
+        AND e.home_page_id = f.home_page_id
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND d.`name` = '手术记录'
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+    </select>
+
+    <!--四级手术级别人数-->
+    <select id="operationLevelFourCount" resultType="int" parameterType="com.diagbot.vo.FilterVO">
+        SELECT
+        COUNT(DISTINCT a.behospital_code , case when f.operation_level ='4' then '1' end)
+        FROM
+        med_behospital_info a,
+        med_medical_record c,
+        qc_mode d,
+        med_home_page e,
+        med_home_operation_info f
+        WHERE
+        a.is_deleted = 'N'
+        AND c.is_deleted = 'N'
+        AND d.is_deleted = 'N'
+        AND e.is_deleted = 'N'
+        AND f.is_deleted = 'N'
+        AND a.hospital_id = c.hospital_id
+        AND a.behospital_code = c.behospital_code
+        AND c.mode_id = d.id
+        AND a.hospital_id = e.hospital_id
+        AND a.hospital_id = f.hospital_id
+        AND a.behospital_code = e.behospital_code
+        AND e.home_page_id = f.home_page_id
+        <if test="isPlacefile != null and isPlacefile != ''">
+            and a.is_placefile = #{isPlacefile}
+        </if>
+        AND d.`name` = '手术记录'
+        <![CDATA[AND a.qc_type_id <>0 ]]>
+        <if test="hospitalId != null and hospitalId != ''">
+            AND a.hospital_id = #{hospitalId}
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 0">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.behospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.behospital_date <= #{endDate}]]>
+            </if>
+        </if>
+        <if test="isPlacefile != null and isPlacefile == 1">
+            <if test="startDate != null and startDate != ''">
+                <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
+            </if>
+            <if test="endDate != null and endDate != ''">
+                <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
+            </if>
+        </if>
+    </select>
 </mapper>