|
@@ -748,6 +748,12 @@
|
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
|
AND a.hospital_id = #{hospitalId}
|
|
|
</if>
|
|
|
+ <if test="deptName != null and deptName != ''">
|
|
|
+ AND a.beh_dept_name = #{deptName}
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null and deptId != ''">
|
|
|
+ AND a.beh_dept_id = #{deptId}
|
|
|
+ </if>
|
|
|
<if test="isPlacefile != null and isPlacefile == 0">
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
<![CDATA[ AND a.behospital_date >= #{startDate}]]>
|
|
@@ -796,6 +802,12 @@
|
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
|
AND a.hospital_id = #{hospitalId}
|
|
|
</if>
|
|
|
+ <if test="deptName != null and deptName != ''">
|
|
|
+ AND a.beh_dept_name = #{deptName}
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null and deptId != ''">
|
|
|
+ AND a.beh_dept_id = #{deptId}
|
|
|
+ </if>
|
|
|
<if test="isPlacefile != null and isPlacefile == 0">
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
<![CDATA[ AND a.behospital_date >= #{startDate}]]>
|
|
@@ -816,6 +828,7 @@
|
|
|
ORDER BY
|
|
|
percent DESC
|
|
|
</select>
|
|
|
+
|
|
|
<!-- 各科室质控平均分(首页) -->
|
|
|
<select id="getAverageScore" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.AverageStatisticsDTO">
|
|
|
select
|
|
@@ -2138,6 +2151,72 @@
|
|
|
ROUND( sum( c.`level` = '丙' )/ count(*)* 100, 2 ) DESC) t
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+ <!-- 按科室统计质控病历数(分页) -->
|
|
|
+ <select id="levelPercentByDept" resultType="com.diagbot.dto.LevelPercentDTO">
|
|
|
+ SELECT t.*
|
|
|
+ FROM
|
|
|
+ (SELECT
|
|
|
+ a.beh_dept_id AS deptId,
|
|
|
+ a.beh_dept_name AS deptName,
|
|
|
+ count(*) AS totleNum,
|
|
|
+ sum( c.`level` = '甲' ) AS firstLevelNum,
|
|
|
+ sum( c.`level` = '乙' ) AS secondLevelNum,
|
|
|
+ sum( c.`level` = '丙' ) AS thirdLevelNum,
|
|
|
+ ROUND( sum( c.`level` = '甲' )/ count(*), 4 ) AS firstPercent,
|
|
|
+ ROUND( sum( c.`level` = '乙' )/ count(*), 4 ) AS sencondPercent,
|
|
|
+ ROUND( sum( c.`level` = '丙' )/ count(*), 4 ) AS thirdPercent,
|
|
|
+ concat( ROUND( sum( c.`level` = '甲' )/ count(*)* 100, 2 ), '%' ) AS firstPercentStr,
|
|
|
+ concat( ROUND( sum( c.`level` = '乙' )/ count(*)* 100, 2 ), '%' ) AS sencondPercentStr,
|
|
|
+ concat( ROUND( sum( c.`level` = '丙' )/ count(*)* 100, 2 ), '%' ) AS thirdPercentStr
|
|
|
+ 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
|
|
|
+ <if test="isPlacefile != null and isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{isPlacefile}
|
|
|
+ </if>
|
|
|
+ <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="deptName != null and deptName != ''">
|
|
|
+ AND a.beh_dept_name = #{deptName}
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null and deptId != ''">
|
|
|
+ AND a.beh_dept_id = #{deptId}
|
|
|
+ </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>
|
|
|
+ <if test="level != null and level != ''">
|
|
|
+ AND c.`level` = #{level}
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ a.beh_dept_id,
|
|
|
+ a.beh_dept_name
|
|
|
+ order by firstPercent DESC,
|
|
|
+ sencondPercent DESC,
|
|
|
+ thirdPercent DESC) t
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 按模块统计质控缺陷数-科室(分页) -->
|
|
|
<select id="entryCountGroupByCaseAndDeptPage" resultType="com.diagbot.dto.NumDTO">
|
|
|
SELECT
|
|
@@ -2497,5 +2576,82 @@
|
|
|
)t
|
|
|
</select>
|
|
|
|
|
|
+ <!--病历扣分大于等于5分占比(H5)-->
|
|
|
+ <select id="deductGT5ByDept" parameterType="com.diagbot.vo.FilterVO" resultType="com.diagbot.dto.DeptNumDTO">
|
|
|
+ SELECT
|
|
|
+ t1.beh_dept_id AS deptId,
|
|
|
+ t1.beh_dept_name AS deptName,
|
|
|
+ sum( t2.totleScore - t1.score_res >= 5 ) AS num,
|
|
|
+ count(*) AS totleNum,
|
|
|
+ Round( sum( t2.totleScore - t1.score_res >= 5 ) / count(*), 4 ) AS percent,
|
|
|
+ CONCAT( Round( sum( t2.totleScore - t1.score_res >= 5 ) / count(*) * 100, 2 ), '%' ) AS percentStr
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.*,
|
|
|
+ b.score_res
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_qcresult_info b
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = b.hospital_id
|
|
|
+ AND a.behospital_code = b.behospital_code
|
|
|
+ <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="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>
|
|
|
+ <if test="deptName != null and deptName != ''">
|
|
|
+ AND a.beh_dept_name = #{deptName}
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null and deptId != ''">
|
|
|
+ AND a.beh_dept_id = #{deptId}
|
|
|
+ </if>
|
|
|
+ ) t1,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ `value`,
|
|
|
+ hospital_id,
|
|
|
+ CASE
|
|
|
+ `value`
|
|
|
+ WHEN 0 THEN
|
|
|
+ 120
|
|
|
+ WHEN 1 THEN
|
|
|
+ 100
|
|
|
+ END AS totleScore
|
|
|
+ FROM
|
|
|
+ `sys_hospital_set`
|
|
|
+ WHERE
|
|
|
+ CODE = 'score_type'
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ ) t2
|
|
|
+ GROUP BY
|
|
|
+ t1.beh_dept_id,
|
|
|
+ t1.beh_dept_name
|
|
|
+ ORDER BY
|
|
|
+ percent DESC
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|