|
@@ -2910,7 +2910,7 @@
|
|
|
|
|
|
<!-- 病案首页合格率占比-科室 -->
|
|
|
<select id="homePageLevelStatisticsByDept" parameterType="com.diagbot.vo.FilterOrderByDeptVO"
|
|
|
- resultType="com.diagbot.dto.HomePageNumDTO">
|
|
|
+ resultType="com.diagbot.dto.HomePageByDeptDTO">
|
|
|
SELECT
|
|
|
t1.doctorId,
|
|
|
t1.doctorName,
|
|
@@ -7571,7 +7571,298 @@
|
|
|
d.NAME
|
|
|
</select>
|
|
|
|
|
|
- <!-- 不合格/合格数病历号(内页)-->
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 不合格/合格数病历号(内页)科室-->
|
|
|
+ <select id="getIsGoodLevelByDept" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
|
+ SELECT t.*
|
|
|
+ FROM
|
|
|
+ (SELECT DISTINCT
|
|
|
+ t1.hospital_id AS hospitalId,
|
|
|
+ t1.behospital_code AS behospitalCode,
|
|
|
+ t1.bed_code AS bedCode,
|
|
|
+ t1.LEVEL AS LEVEL,
|
|
|
+ t1.grade_type AS gradeType,
|
|
|
+ t1.score_res AS scoreRes,
|
|
|
+ t1.scoreBn,
|
|
|
+ t1.NAME AS NAME,
|
|
|
+ t1.sex AS sex,
|
|
|
+ t1.beh_dept_id AS behDeptId,
|
|
|
+ t1.beh_dept_name AS behDeptName,
|
|
|
+ t1.doctor_id AS doctorId,
|
|
|
+ t1.doctor_name AS doctorName,
|
|
|
+ t1.beh_doctor_id AS behDoctorId,
|
|
|
+ t1.beh_doctor_name AS behDoctorName,
|
|
|
+ t1.director_doctor_id AS directorDoctorId,
|
|
|
+ t1.director_doctor_name AS directorDoctorName,
|
|
|
+ t1.birthday AS birthday,
|
|
|
+ t1.behospital_date AS behospitalDate,
|
|
|
+ t1.leave_hospital_date AS leaveHospitalDate,
|
|
|
+ t1.placefile_date AS placefileDate,
|
|
|
+ t1.gmt_create AS gradeTime,
|
|
|
+ t1.diagnose,
|
|
|
+ t1.ward_name AS wardName,
|
|
|
+ CONCAT( ifnull(t2.age,'') ,ifnull(t2.age_unit,'') )as age,
|
|
|
+ t1.file_code AS fileCode,
|
|
|
+ t1.checkStatus,
|
|
|
+ t1.mrStatus,
|
|
|
+ t1.chName,
|
|
|
+ t1.mrName,
|
|
|
+ t1.chTime,
|
|
|
+ t1.mrTime
|
|
|
+ FROM
|
|
|
+ (SELECT
|
|
|
+ be.*,
|
|
|
+ b.LEVEL,
|
|
|
+ b.grade_type,
|
|
|
+ b.score_res,
|
|
|
+ b.gmt_create,
|
|
|
+ ifnull(mci.status,0) AS checkStatus,
|
|
|
+ ifnull(hm_mci.status,0) AS mrStatus,
|
|
|
+ mci.check_name as chName,
|
|
|
+ hm_mci.check_name as mrName,
|
|
|
+ mci.gmt_create as chTime,
|
|
|
+ hm_mci.gmt_create as mrTime
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ SELECT DISTINCT
|
|
|
+ a.hospital_id,
|
|
|
+ a.behospital_code,
|
|
|
+ a.bed_code,
|
|
|
+ a.file_code,
|
|
|
+ e.score_res as scoreBn,
|
|
|
+ a.NAME,
|
|
|
+ a.sex,
|
|
|
+ a.beh_dept_id,
|
|
|
+ a.beh_dept_name,
|
|
|
+ a.birthday,
|
|
|
+ a.behospital_date,
|
|
|
+ a.leave_hospital_date,
|
|
|
+ a.doctor_id,
|
|
|
+ a.doctor_name,
|
|
|
+ a.beh_doctor_id,
|
|
|
+ a.beh_doctor_name,
|
|
|
+ a.director_doctor_id,
|
|
|
+ a.director_doctor_name,
|
|
|
+ a.diagnose,
|
|
|
+ a.placefile_date,
|
|
|
+ a.ward_name
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ sys_user_dept c,
|
|
|
+ med_qcresult_cases e
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND e.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = c.hospital_id
|
|
|
+ AND a.hospital_id = e.hospital_id
|
|
|
+ AND a.beh_dept_id = c.dept_id
|
|
|
+ AND a.behospital_code = e.behospital_code
|
|
|
+ AND a.qc_type_id != 0
|
|
|
+ AND e.cases_id = 243
|
|
|
+ <if test="userId!=null">
|
|
|
+ AND c.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="deptName != null and deptName != ''">
|
|
|
+ and a.beh_dept_name = #{deptName}
|
|
|
+ </if>
|
|
|
+ <if test="deptClass != null and deptClass != ''">
|
|
|
+ and a.beh_dept_id = #{deptClass}
|
|
|
+ </if>
|
|
|
+ <if test="titleName != null and titleName != '' ">
|
|
|
+ <if test="titleName == '不合格数'">
|
|
|
+ AND e.`level`='不合格'
|
|
|
+ </if>
|
|
|
+ <if test="titleName == '合格数'">
|
|
|
+ AND e.`level`='合格'
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{isPlacefile}
|
|
|
+ </if>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 0">
|
|
|
+ <if test="startDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 1">
|
|
|
+ <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>
|
|
|
+ <if test="diagnose != null and diagnose != ''">
|
|
|
+ AND a.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="behospitalCode != null and behospitalCode != ''">
|
|
|
+ AND a.behospital_code LIKE CONCAT( '%', #{behospitalCode}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="patName != null and patName != ''">
|
|
|
+ AND a.NAME LIKE CONCAT( '%', #{patName}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="doctorId != null and doctorId != ''">
|
|
|
+ AND (a.doctor_id LIKE CONCAT( '%', #{doctorId}, '%' )
|
|
|
+ OR a.beh_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' )
|
|
|
+ OR a.director_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' ))
|
|
|
+ </if>
|
|
|
+ <if test="doctorName != null and doctorName != ''">
|
|
|
+ AND (a.doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
|
|
|
+ OR a.beh_doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
|
|
|
+ OR a.director_doctor_name LIKE CONCAT( '%', #{doctorName}, '%' ))
|
|
|
+ </if>
|
|
|
+ )be
|
|
|
+ left join med_check_info mci
|
|
|
+ on mci.is_deleted = 'N'
|
|
|
+ and mci.check_type = 0
|
|
|
+ and be.hospital_id = mci.hospital_id
|
|
|
+ and be.behospital_code = mci.behospital_code
|
|
|
+ left join med_check_info hm_mci
|
|
|
+ on hm_mci.is_deleted = 'N'
|
|
|
+ and hm_mci.check_type = 1
|
|
|
+ and be.hospital_id = hm_mci.hospital_id
|
|
|
+ and be.behospital_code = hm_mci.behospital_code
|
|
|
+ left join med_qcresult_info b
|
|
|
+ on b.is_deleted = 'N'
|
|
|
+ AND be.hospital_id = b.hospital_id
|
|
|
+ AND be.behospital_code = b.behospital_code
|
|
|
+ where
|
|
|
+ 1=1
|
|
|
+ <if test="level != null and level != ''">
|
|
|
+ AND b.`level` = #{level}
|
|
|
+ </if>
|
|
|
+ ) t1
|
|
|
+ LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
|
|
|
+ AND t1.behospital_code = t2.behospital_code
|
|
|
+ AND t2.is_deleted = 'N'
|
|
|
+ ) t,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.doctor_id as doctorId,
|
|
|
+ a.doctor_name as doctorName
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ sys_user_dept b,
|
|
|
+ med_qcresult_cases c,
|
|
|
+ med_qcresult_detail d,
|
|
|
+ qc_cases_entry e
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND d.is_deleted = 'N'
|
|
|
+ AND e.is_deleted = 'N'
|
|
|
+ AND a.hospital_id = b.hospital_id
|
|
|
+ AND a.hospital_id = c.hospital_id
|
|
|
+ AND a.hospital_id = d.hospital_id
|
|
|
+ AND a.behospital_code = c.behospital_code
|
|
|
+ AND a.behospital_code = d.behospital_code
|
|
|
+ AND a.beh_dept_id = b.dept_id
|
|
|
+ AND c.cases_id = d.cases_id
|
|
|
+ AND d.cases_id = e.cases_id
|
|
|
+ AND d.cases_entry_id = e.id
|
|
|
+ AND d.cases_id = 243
|
|
|
+ AND a.qc_type_id != 0
|
|
|
+ <!-- <if test="titleName != null ">-->
|
|
|
+ <!-- <if test="titleName == '不合格数'">-->
|
|
|
+ <!-- AND c.`level`='不合格'-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- <if test="titleName == '合格数'">-->
|
|
|
+ <!-- AND c.`level`='合格'-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <if test="userId!=null">
|
|
|
+ AND b.user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="deptName != null and deptName != ''">
|
|
|
+ and a.beh_dept_name = #{deptName}
|
|
|
+ </if>
|
|
|
+ <if test="deptClass != null and deptClass != ''">
|
|
|
+ and a.beh_dept_id = #{deptClass}
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{isPlacefile}
|
|
|
+ </if>
|
|
|
+ <if test="hospitalId != null and hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 0">
|
|
|
+ <if test="startDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 1">
|
|
|
+ <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>
|
|
|
+ <if test="diagnose != null and diagnose != ''">
|
|
|
+ AND a.diagnose LIKE CONCAT( '%', #{diagnose}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="behospitalCode != null and behospitalCode != ''">
|
|
|
+ AND a.behospital_code LIKE CONCAT( '%', #{behospitalCode}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="patName != null and patName != ''">
|
|
|
+ AND a.NAME LIKE CONCAT( '%', #{patName}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="doctorId != null and doctorId != ''">
|
|
|
+ AND (a.doctor_id LIKE CONCAT( '%', #{doctorId}, '%' )
|
|
|
+ OR a.beh_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' )
|
|
|
+ OR a.director_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' ))
|
|
|
+ </if>
|
|
|
+ <if test="doctorName != null and doctorName != ''">
|
|
|
+ AND (a.doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
|
|
|
+ OR a.beh_doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
|
|
|
+ OR a.director_doctor_name LIKE CONCAT( '%', #{doctorName}, '%' ))
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ a.doctor_id,
|
|
|
+ a.doctor_name
|
|
|
+ ) t2
|
|
|
+ where
|
|
|
+ t.doctorId = t2.doctorId
|
|
|
+ AND t.doctorName = t2.doctorName
|
|
|
+ <if test="checkStatus != null">
|
|
|
+ AND t.checkStatus = #{checkStatus}
|
|
|
+ </if>
|
|
|
+ <if test="mrStatus != null">
|
|
|
+ AND t.mrStatus = #{mrStatus}
|
|
|
+ </if>
|
|
|
+ <if test="chName != null and chName!=''">
|
|
|
+ AND t.chName like concat('%', #{chName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="mrName != null and mrName!=''">
|
|
|
+ AND t.mrName like concat('%', #{mrName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="chTimeStart != null ">
|
|
|
+ <![CDATA[ AND t.chTime >= #{chTimeStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="chTimeEnd != null ">
|
|
|
+ <![CDATA[ AND t.chTime <= #{chTimeEnd}]]>
|
|
|
+ </if>
|
|
|
+ <if test="mrTimeStart != null ">
|
|
|
+ <![CDATA[ AND t.mrTime >= #{mrTimeStart}]]>
|
|
|
+ </if>
|
|
|
+ <if test="mrTimeEnd != null ">
|
|
|
+ <![CDATA[ AND t.mrTime <= #{mrTimeEnd}]]>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 不合格/合格数病历号(内页)全院-->
|
|
|
<select id="badLevelPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
|
SELECT t.*
|
|
|
FROM
|
|
@@ -7839,6 +8130,7 @@
|
|
|
<![CDATA[ AND t.mrTime <= #{qcResultPageVO.mrTimeEnd}]]>
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
<!-- 未整改病历质控评分页(内页)-->
|
|
|
<select id="unModifyMRPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
|
SELECT t.*
|