|
@@ -1525,7 +1525,7 @@
|
|
AND a.behospital_code = c.behospital_code
|
|
AND a.behospital_code = c.behospital_code
|
|
AND c.cases_id = 243
|
|
AND c.cases_id = 243
|
|
AND a.is_placefile = '1'
|
|
AND a.is_placefile = '1'
|
|
- <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
|
|
|
+ AND a.qc_type_id != 0
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
AND a.hospital_id = #{hospitalId}
|
|
AND a.hospital_id = #{hospitalId}
|
|
</if>
|
|
</if>
|
|
@@ -1569,7 +1569,7 @@
|
|
AND d.cases_entry_id = e.id
|
|
AND d.cases_entry_id = e.id
|
|
AND d.cases_id = 243
|
|
AND d.cases_id = 243
|
|
AND a.is_placefile = '1'
|
|
AND a.is_placefile = '1'
|
|
- <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
|
|
|
+ AND a.qc_type_id != 0
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
AND a.hospital_id = #{hospitalId}
|
|
AND a.hospital_id = #{hospitalId}
|
|
</if>
|
|
</if>
|
|
@@ -1628,7 +1628,7 @@
|
|
AND c.cases_entry_id = d.id
|
|
AND c.cases_entry_id = d.id
|
|
AND a.is_placefile = '1'
|
|
AND a.is_placefile = '1'
|
|
AND d.cases_id = 243
|
|
AND d.cases_id = 243
|
|
- <![CDATA[AND a.qc_type_id <>0 ]]>
|
|
|
|
|
|
+ AND a.qc_type_id != 0
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
AND a.hospital_id = #{hospitalId}
|
|
AND a.hospital_id = #{hospitalId}
|
|
</if>
|
|
</if>
|
|
@@ -3628,4 +3628,95 @@
|
|
AND ( TIMESTAMPDIFF( DAY, DATE( t2.leave_hospital_date ), DATE( t1.behospital_date )) BETWEEN 0 AND 31 )) bc2
|
|
AND ( TIMESTAMPDIFF( DAY, DATE( t2.leave_hospital_date ), DATE( t1.behospital_date )) BETWEEN 0 AND 31 )) bc2
|
|
) t
|
|
) t
|
|
</select>
|
|
</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>
|
|
</mapper>
|