|
@@ -6800,7 +6800,7 @@
|
|
|
d.NAME
|
|
|
</select>
|
|
|
|
|
|
- <!-- 不合格数病历号(内页)-->
|
|
|
+ <!-- 不合格/合格数病历号(内页)-->
|
|
|
<select id="badLevelPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
|
SELECT t.*
|
|
|
FROM
|
|
@@ -6840,6 +6840,10 @@
|
|
|
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,
|
|
@@ -6853,9 +6857,6 @@
|
|
|
a.behospital_code,
|
|
|
a.bed_code,
|
|
|
a.file_code,
|
|
|
- b.LEVEL,
|
|
|
- b.grade_type,
|
|
|
- b.score_res,
|
|
|
e.score_res as scoreBn,
|
|
|
a.NAME,
|
|
|
a.sex,
|
|
@@ -6872,23 +6873,25 @@
|
|
|
a.director_doctor_name,
|
|
|
a.diagnose,
|
|
|
a.placefile_date,
|
|
|
- a.ward_name,
|
|
|
- b.gmt_create
|
|
|
+ a.ward_name
|
|
|
FROM
|
|
|
med_behospital_info a,
|
|
|
- med_qcresult_info b,
|
|
|
med_qcresult_cases e
|
|
|
WHERE
|
|
|
a.is_deleted = 'N'
|
|
|
- AND b.is_deleted = 'N'
|
|
|
AND e.is_deleted = 'N'
|
|
|
- AND a.hospital_id = b.hospital_id
|
|
|
AND a.hospital_id = e.hospital_id
|
|
|
- AND a.behospital_code = b.behospital_code
|
|
|
AND a.behospital_code = e.behospital_code
|
|
|
AND a.qc_type_id != 0
|
|
|
- AND e.`level`='不合格'
|
|
|
- AND e.cases_id= 243
|
|
|
+ AND e.cases_id = 243
|
|
|
+ <if test="qcResultPageVO.titleName != null ">
|
|
|
+ <if test="qcResultPageVO.titleName == '不合格数'">
|
|
|
+ AND e.`level`='不合格'
|
|
|
+ </if>
|
|
|
+ <if test="qcResultPageVO.titleName == '合格数'">
|
|
|
+ AND e.`level`='合格'
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
<if test="qcResultPageVO.isPlacefile != null and qcResultPageVO.isPlacefile != ''">
|
|
|
and a.is_placefile = #{qcResultPageVO.isPlacefile}
|
|
|
</if>
|
|
@@ -6914,9 +6917,7 @@
|
|
|
<if test="qcResultPageVO.behDeptName != null and qcResultPageVO.behDeptName != ''">
|
|
|
AND a.beh_dept_name = #{qcResultPageVO.behDeptName}
|
|
|
</if>
|
|
|
- <if test="qcResultPageVO.level != null and qcResultPageVO.level != ''">
|
|
|
- AND b.`level` = #{qcResultPageVO.level}
|
|
|
- </if>
|
|
|
+
|
|
|
<if test="qcResultPageVO.behospitalCode != null and qcResultPageVO.behospitalCode != ''">
|
|
|
AND a.behospital_code LIKE CONCAT( '%', #{qcResultPageVO.behospitalCode}, '%' )
|
|
|
</if>
|
|
@@ -6944,12 +6945,100 @@
|
|
|
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="qcResultPageVO.level != null and qcResultPageVO.level != ''">
|
|
|
+ AND b.`level` = #{qcResultPageVO.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
|
|
|
- where 1=1
|
|
|
+ ) t,
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ a.beh_dept_id AS deptId,
|
|
|
+ a.beh_dept_name AS deptName
|
|
|
+ FROM
|
|
|
+ med_behospital_info a,
|
|
|
+ med_qcresult_cases c,
|
|
|
+ med_qcresult_detail d,
|
|
|
+ qc_cases_entry e
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
+ AND d.is_deleted = 'N'
|
|
|
+ AND e.is_deleted = 'N'
|
|
|
+ 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 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="qcResultPageVO.titleName != null ">
|
|
|
+ <if test="qcResultPageVO.titleName == '不合格数'">
|
|
|
+ AND c.`level`='不合格'
|
|
|
+ </if>
|
|
|
+ <if test="qcResultPageVO.titleName == '合格数'">
|
|
|
+ AND c.`level`='合格'
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="qcResultPageVO.isPlacefile != null and qcResultPageVO.isPlacefile != ''">
|
|
|
+ and a.is_placefile = #{qcResultPageVO.isPlacefile}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultPageVO.hospitalId != null and qcResultPageVO.hospitalId != ''">
|
|
|
+ AND a.hospital_id = #{qcResultPageVO.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultPageVO.isPlacefile != null and qcResultPageVO.isPlacefile == 0">
|
|
|
+ <if test="qcResultPageVO.startDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{qcResultPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="qcResultPageVO.endDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{qcResultPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="qcResultPageVO.isPlacefile != null and qcResultPageVO.isPlacefile == 1">
|
|
|
+ <if test="qcResultPageVO.startDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{qcResultPageVO.startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="qcResultPageVO.endDate != null">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{qcResultPageVO.endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="qcResultPageVO.behDeptName != null and qcResultPageVO.behDeptName != ''">
|
|
|
+ AND a.beh_dept_name = #{qcResultPageVO.behDeptName}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="qcResultPageVO.behospitalCode != null and qcResultPageVO.behospitalCode != ''">
|
|
|
+ AND a.behospital_code LIKE CONCAT( '%', #{qcResultPageVO.behospitalCode}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="qcResultPageVO.patName != null and qcResultPageVO.patName != ''">
|
|
|
+ AND a.NAME LIKE CONCAT( '%', #{qcResultPageVO.patName}, '%' )
|
|
|
+ </if>
|
|
|
+ <if test="qcResultPageVO.doctorId != null and qcResultPageVO.doctorId != ''">
|
|
|
+ AND (a.doctor_id LIKE CONCAT( '%', #{qcResultPageVO.doctorId}, '%' )
|
|
|
+ OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultPageVO.doctorId}, '%' )
|
|
|
+ OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultPageVO.doctorId}, '%' ))
|
|
|
+ </if>
|
|
|
+ <if test="qcResultPageVO.doctorName != null and qcResultPageVO.doctorName != ''">
|
|
|
+ AND (a.doctor_name LIKE CONCAT( '%', #{qcResultPageVO.doctorName}, '%' )
|
|
|
+ OR a.beh_doctor_name LIKE CONCAT( '%', #{qcResultPageVO.doctorName}, '%' )
|
|
|
+ OR a.director_doctor_name LIKE CONCAT( '%', #{qcResultPageVO.doctorName}, '%' ))
|
|
|
+ </if>
|
|
|
+ GROUP BY
|
|
|
+ a.beh_dept_id,
|
|
|
+ a.beh_dept_name
|
|
|
+ ) t2
|
|
|
+ where
|
|
|
+ t.behDeptId = t2.deptId
|
|
|
+ AND t.behDeptName = t2.deptName
|
|
|
<if test="qcResultPageVO.checkStatus != null">
|
|
|
AND t.checkStatus = #{qcResultPageVO.checkStatus}
|
|
|
</if>
|
|
@@ -7170,7 +7259,7 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
- <!-- 病案首页不合格数病历详情页导出-->
|
|
|
+ <!-- 病案首页不合格/合格数病历详情页导出-->
|
|
|
<select id="badLevelPagePageExport" resultMap="ExportExcelMap">
|
|
|
SELECT
|
|
|
f1.behDeptId,
|
|
@@ -7249,6 +7338,10 @@
|
|
|
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,
|
|
@@ -7262,10 +7355,8 @@
|
|
|
a.behospital_code,
|
|
|
a.bed_code,
|
|
|
a.file_code,
|
|
|
- b.LEVEL,
|
|
|
- b.grade_type,
|
|
|
- b.score_res,
|
|
|
c.score_res as scoreBn,
|
|
|
+ c.cases_id,
|
|
|
a.NAME,
|
|
|
a.sex,
|
|
|
a.beh_dept_id,
|
|
@@ -7281,25 +7372,25 @@
|
|
|
a.director_doctor_name,
|
|
|
a.diagnose,
|
|
|
a.placefile_date,
|
|
|
- a.ward_name,
|
|
|
- b.gmt_create
|
|
|
+ a.ward_name
|
|
|
FROM
|
|
|
med_behospital_info a,
|
|
|
- med_qcresult_info b,
|
|
|
- med_qcresult_cases c,
|
|
|
- qc_cases_entry d
|
|
|
+ med_qcresult_cases c
|
|
|
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 c.cases_id = d.cases_id
|
|
|
AND a.qc_type_id != 0
|
|
|
- AND c.`level`='不合格'
|
|
|
+ AND c.cases_id = 243
|
|
|
+ <if test="qcResultShortPageVO.titleName != null ">
|
|
|
+ <if test="qcResultShortPageVO.titleName == '不合格数'">
|
|
|
+ AND c.`level`='不合格'
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.titleName == '合格数'">
|
|
|
+ AND c.`level`='合格'
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
<if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
|
|
|
and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
|
|
|
</if>
|
|
@@ -7325,9 +7416,6 @@
|
|
|
<if test="qcResultShortPageVO.behDeptName != null and qcResultShortPageVO.behDeptName != ''">
|
|
|
AND a.beh_dept_name = #{qcResultShortPageVO.behDeptName}
|
|
|
</if>
|
|
|
- <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
|
- AND b.`level` = #{qcResultShortPageVO.level}
|
|
|
- </if>
|
|
|
<if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
|
|
|
AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
|
|
|
</if>
|
|
@@ -7344,18 +7432,6 @@
|
|
|
OR a.beh_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
|
|
|
OR a.director_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' ))
|
|
|
</if>
|
|
|
- <if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
|
|
|
- AND d.NAME = #{qcResultShortPageVO.casesEntryName}
|
|
|
- </if>
|
|
|
- <if test="qcResultShortPageVO.casesEntryId != null ">
|
|
|
- AND d.id = #{qcResultShortPageVO.casesEntryId}
|
|
|
- </if>
|
|
|
-<!-- <if test="qcResultShortPageVO.isReject != null">-->
|
|
|
-<!-- AND c.is_reject = #{qcResultShortPageVO.isReject}-->
|
|
|
-<!-- </if>-->
|
|
|
- <if test="qcResultShortPageVO.ruleType != null">
|
|
|
- AND d.rule_type = #{qcResultShortPageVO.ruleType}
|
|
|
- </if>
|
|
|
)be
|
|
|
left join med_check_info mci
|
|
|
on mci.is_deleted = 'N'
|
|
@@ -7367,6 +7443,25 @@
|
|
|
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
|
|
|
+ <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
|
+ AND b.`level` = #{qcResultPageVO.level}
|
|
|
+ </if>
|
|
|
+ left join qc_cases_entry d
|
|
|
+ on d.is_deleted = 'N'
|
|
|
+ AND be.cases_id = d.cases_id
|
|
|
+ <if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
|
|
|
+ AND d.NAME = #{qcResultShortPageVO.casesEntryName}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.casesEntryId != null ">
|
|
|
+ AND d.id = #{qcResultShortPageVO.casesEntryId}
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.ruleType != null">
|
|
|
+ AND d.rule_type = #{qcResultShortPageVO.ruleType}
|
|
|
+ </if>
|
|
|
) t1
|
|
|
LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
|
|
|
AND t1.behospital_code = t2.behospital_code
|
|
@@ -7455,6 +7550,10 @@
|
|
|
FROM
|
|
|
(SELECT
|
|
|
be.*,
|
|
|
+ b.grade_type,
|
|
|
+ b.score_res,
|
|
|
+ b.gmt_create,
|
|
|
+ b.LEVEL,
|
|
|
ifnull(mci.status,0) AS checkStatus,
|
|
|
ifnull(hm_mci.status,0) AS mrStatus,
|
|
|
mci.check_name as chName,
|
|
@@ -7468,9 +7567,6 @@
|
|
|
a.behospital_code,
|
|
|
a.bed_code,
|
|
|
a.file_code,
|
|
|
- b.LEVEL,
|
|
|
- b.grade_type,
|
|
|
- b.score_res,
|
|
|
a.NAME,
|
|
|
a.sex,
|
|
|
a.beh_dept_id,
|
|
@@ -7486,24 +7582,32 @@
|
|
|
a.director_doctor_name,
|
|
|
a.diagnose,
|
|
|
a.placefile_date,
|
|
|
- a.ward_name,
|
|
|
- b.gmt_create
|
|
|
+ a.ward_name
|
|
|
FROM
|
|
|
med_behospital_info a,
|
|
|
- med_qcresult_info b,
|
|
|
+ med_qcresult_detail k,
|
|
|
med_qcresult_cases 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 c.cases_id = d.cases_id
|
|
|
- AND c.`level`='不合格'
|
|
|
+ AND a.hospital_id = k.hospital_id
|
|
|
+ AND a.behospital_code = k.behospital_code
|
|
|
+ AND c.cases_id = k.cases_id
|
|
|
+ AND k.cases_id = d.cases_id
|
|
|
+ AND k.cases_entry_id = d.id
|
|
|
+ <if test="qcResultShortPageVO.titleName != null ">
|
|
|
+ <if test="qcResultShortPageVO.titleName == '不合格数'">
|
|
|
+ AND c.`level`='不合格'
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.titleName == '合格数'">
|
|
|
+ AND c.`level`='合格'
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
AND a.qc_type_id != 0
|
|
|
<if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
|
|
|
and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
|
|
@@ -7530,9 +7634,6 @@
|
|
|
<if test="qcResultShortPageVO.behDeptName != null and qcResultShortPageVO.behDeptName != ''">
|
|
|
AND a.beh_dept_name = #{qcResultShortPageVO.behDeptName}
|
|
|
</if>
|
|
|
- <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
|
- AND b.`level` = #{qcResultShortPageVO.level}
|
|
|
- </if>
|
|
|
<if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
|
|
|
AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
|
|
|
</if>
|
|
@@ -7555,9 +7656,6 @@
|
|
|
<if test="qcResultShortPageVO.casesEntryId != null ">
|
|
|
AND d.id = #{qcResultShortPageVO.casesEntryId}
|
|
|
</if>
|
|
|
-<!-- <if test="qcResultShortPageVO.isReject != null">-->
|
|
|
-<!-- AND c.is_reject = #{qcResultShortPageVO.isReject}-->
|
|
|
-<!-- </if>-->
|
|
|
<if test="qcResultShortPageVO.ruleType != null">
|
|
|
AND d.rule_type = #{qcResultShortPageVO.ruleType}
|
|
|
</if>
|
|
@@ -7572,6 +7670,13 @@
|
|
|
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
|
|
|
+ <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
|
+ AND b.`level` = #{qcResultPageVO.level}
|
|
|
+ </if>
|
|
|
) t1
|
|
|
LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
|
|
|
AND t1.behospital_code = t2.behospital_code
|