|
@@ -7803,10 +7803,12 @@
|
|
</select>
|
|
</select>
|
|
<!-- 离院病人评分详情页-->
|
|
<!-- 离院病人评分详情页-->
|
|
<select id="leaveHosMRPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
<select id="leaveHosMRPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
- SELECT
|
|
|
|
- t.*
|
|
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ t.*,
|
|
|
|
+ t4.operation_doctor_id,
|
|
|
|
+ t4.operation_level
|
|
FROM
|
|
FROM
|
|
- (SELECT DISTINCT
|
|
|
|
|
|
+ (SELECT
|
|
t1.hospital_id AS hospitalId,
|
|
t1.hospital_id AS hospitalId,
|
|
t1.behospital_code AS behospitalCode,
|
|
t1.behospital_code AS behospitalCode,
|
|
t1.bed_code AS bedCode,
|
|
t1.bed_code AS bedCode,
|
|
@@ -8011,8 +8013,40 @@
|
|
AND t1.hospital_id = t2.hospital_id
|
|
AND t1.hospital_id = t2.hospital_id
|
|
AND t1.behospital_code = t2.behospital_code
|
|
AND t1.behospital_code = t2.behospital_code
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType == 6">
|
|
|
|
+ ,med_home_page t2
|
|
|
|
+ WHERE
|
|
|
|
+ t2.is_deleted = 'N'
|
|
|
|
+ AND t1.hospital_id = t2.hospital_id
|
|
|
|
+ AND t1.behospital_code = t2.behospital_code
|
|
|
|
+ AND
|
|
|
|
+ ( t2.blood_fee != 0
|
|
|
|
+ or t2.blood_fee != 0.00
|
|
|
|
+ or t2.blood_fee != null
|
|
|
|
+ )
|
|
|
|
+ </if>
|
|
|
|
+ <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType == 7">
|
|
|
|
+ ,med_home_page t2
|
|
|
|
+ ,med_doctor_advice b
|
|
|
|
+ WHERE
|
|
|
|
+ t2.is_deleted = 'N'
|
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
|
+ AND t1.hospital_id = t2.hospital_id
|
|
|
|
+ AND t1.hospital_id = b.hospital_id
|
|
|
|
+ AND t1.behospital_code = t2.behospital_code
|
|
|
|
+ AND t1.behospital_code = b.behospital_code
|
|
|
|
+ AND t2.behospital_code = b.behospital_code
|
|
|
|
+ AND b.da_item_name like '癌痛%'
|
|
|
|
+ AND b.da_status != '作废'
|
|
|
|
+ </if>
|
|
)t
|
|
)t
|
|
|
|
+ ,med_home_page t3
|
|
|
|
+ ,med_home_operation_info t4
|
|
where 1=1
|
|
where 1=1
|
|
|
|
+ AND t.hospitalId = t3.hospital_id
|
|
|
|
+ AND t.hospitalId = t4.hospital_id
|
|
|
|
+ AND t.behospitalCode = t3.behospital_code
|
|
|
|
+ AND t3.home_page_id = t4.home_page_id
|
|
<if test="qcResultShortPageVO.checkStatus != null">
|
|
<if test="qcResultShortPageVO.checkStatus != null">
|
|
and t.checkStatus = #{qcResultShortPageVO.checkStatus}
|
|
and t.checkStatus = #{qcResultShortPageVO.checkStatus}
|
|
</if>
|
|
</if>
|
|
@@ -8040,6 +8074,12 @@
|
|
<if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
<if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
AND t.`level` = #{qcResultShortPageVO.level}
|
|
AND t.`level` = #{qcResultShortPageVO.level}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="qcResultShortPageVO.operationDoctor != null and qcResultShortPageVO.operationDoctor != ''">
|
|
|
|
+ AND t4.`operation_doctor_id` = #{qcResultShortPageVO.operationDoctor}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="qcResultShortPageVO.operationLevel != null and qcResultShortPageVO.operationLevel != ''">
|
|
|
|
+ AND t4.`operation_level` = #{qcResultShortPageVO.operationLevel}
|
|
|
|
+ </if>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- 离院病人评分详情页-科室-->
|
|
<!-- 离院病人评分详情页-科室-->
|
|
@@ -21558,4 +21598,282 @@
|
|
k1.behospital_code
|
|
k1.behospital_code
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <!--输血患者人数-->
|
|
|
|
+ <select id="bloodCount" resultType="int" parameterType="com.diagbot.vo.FilterVO">
|
|
|
|
+ SELECT
|
|
|
|
+ distinct
|
|
|
|
+ count(*)
|
|
|
|
+ FROM
|
|
|
|
+ med_behospital_info a,
|
|
|
|
+ med_home_page 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
|
|
|
|
+ And
|
|
|
|
+ ( b.blood_fee != 0
|
|
|
|
+ or b.blood_fee != 0.00
|
|
|
|
+ or b.blood_fee != null
|
|
|
|
+ )
|
|
|
|
+ <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>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!--癌痛患者人数-->
|
|
|
|
+ <select id="cancerCount" resultType="int" parameterType="com.diagbot.vo.FilterVO">
|
|
|
|
+ SELECT
|
|
|
|
+ count(*)
|
|
|
|
+ FROM
|
|
|
|
+ med_behospital_info a,
|
|
|
|
+ med_doctor_advice 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
|
|
|
|
+ AND b.da_item_name like '癌痛%'
|
|
|
|
+ AND b.da_status != '作废'
|
|
|
|
+ <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>
|
|
|
|
+ </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>
|
|
</mapper>
|