|
@@ -143,162 +143,6 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
- <!-- <select id="getQualityCase" resultType="com.diagbot.dto.QualityControlDTO">
|
|
|
- SELECT
|
|
|
- m1.* ,
|
|
|
- m2.score_res as totalScore
|
|
|
- from(
|
|
|
- SELECT DISTINCT
|
|
|
- m1.hospital_id,
|
|
|
- m1.behospital_code,
|
|
|
- SUM(CASE WHEN m1.mode_id =1 THEN m1.cases_score ELSE 0 END) AS admissionNoteTolScore,
|
|
|
- SUM(CASE WHEN m1.mode_id =2 THEN m1.cases_score ELSE 0 END) AS firstCourseNoteTolScore,
|
|
|
- SUM(CASE WHEN m1.mode_id =6 THEN m1.cases_score ELSE 0 END) AS medHomePageTolScore,
|
|
|
- SUM(CASE WHEN m1.mode_id =8 THEN m1.cases_score ELSE 0 END) AS docAdviceNoteTolScore,
|
|
|
- SUM(CASE WHEN m1.mode_id =56 THEN m1.cases_score ELSE 0 END) AS courseRecordTolScore,
|
|
|
- SUM(CASE WHEN m1.mode_id =17 THEN m1.cases_score ELSE 0 END) AS operationInfoTolScore,
|
|
|
- SUM(CASE WHEN m1.mode_id =5 THEN m1.cases_score ELSE 0 END) AS dischargeNoteTolScore
|
|
|
- FROM (
|
|
|
- SELECT
|
|
|
- c.behospital_code,
|
|
|
- a.mode_id,
|
|
|
- c.cases_score,
|
|
|
- c.cases_id,
|
|
|
- c.hospital_id
|
|
|
- FROM
|
|
|
- `qc_cases_entry` a,
|
|
|
- qc_mode b,
|
|
|
- med_qcresult_detail c,
|
|
|
- qc_cases_hospital d,
|
|
|
- med_behospital_info 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.id = c.cases_entry_id
|
|
|
- AND a.mode_id = b.id
|
|
|
- AND c.cases_id = d.cases_id
|
|
|
- AND c.hospital_id = d.hospital_id
|
|
|
- AND c.behospital_code = e.behospital_code
|
|
|
- AND c.hospital_id = e.hospital_id
|
|
|
- <if test="hospitalId != null">
|
|
|
- and c.hospital_id = #{hospitalId}
|
|
|
- </if>
|
|
|
- <if test="deptName != null and deptName != ''">
|
|
|
- and e.beh_dept_name= #{deptName}
|
|
|
- </if>
|
|
|
- <if test="behospitalCode != null and behospitalCode != ''">
|
|
|
- and e.behospital_code like CONCAT('%',#{behospitalCode},'%')
|
|
|
- </if>
|
|
|
- <if test="isPlacefile != null and isPlacefile != ''">
|
|
|
- and e.is_placefile = #{isPlacefile}
|
|
|
- </if>
|
|
|
- <if test="behosDateStart != null">
|
|
|
- <![CDATA[ and e.behospital_date >= #{behosDateStart}]]>
|
|
|
- </if>
|
|
|
- <if test="behosDateEnd != null">
|
|
|
- <![CDATA[ and e.behospital_date < #{behosDateEnd}]]>
|
|
|
- </if>
|
|
|
- <if test="leaveHosDateStart != null">
|
|
|
- <![CDATA[ and e.leave_hospital_date >= #{leaveHosDateStart}]]>
|
|
|
- </if>
|
|
|
- <if test="leaveHosDateEnd != null">
|
|
|
- <![CDATA[ and e.leave_hospital_date < #{leaveHosDateEnd}]]>
|
|
|
- </if>
|
|
|
- <if test="level != null and level != ''">
|
|
|
- and e.level = #{level}
|
|
|
- </if>
|
|
|
- <if test="level != null and level != ''">
|
|
|
- and e.level = #{level}
|
|
|
- </if>
|
|
|
- ORDER BY b.order_no, c.grade_type DESC, a.order_no
|
|
|
- )m1 GROUP BY behospital_code)m1 LEFT JOIN med_qcresult_info m2
|
|
|
- ON m2.is_deleted = 'N'
|
|
|
- AND m1.hospital_id = m2.hospital_id
|
|
|
- AND m1.behospital_code = m2.behospital_code
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getQualitySorce" resultType="com.diagbot.dto.QualityControlDTO">
|
|
|
- SELECT
|
|
|
- t1.behospital_code,
|
|
|
- t1.hospital_id,
|
|
|
- GROUP_CONCAT(DISTINCT CASE WHEN t1.mode_id = 1 THEN t1.msg ELSE NULL END SEPARATOR ';' ) AS admissionNote,
|
|
|
- SUM(CASE WHEN t1.mode_id =1 AND t1.is_reject = 0 THEN t1.score ELSE 0 END) AS admissionNoteScoreOn,
|
|
|
- SUM(CASE WHEN t1.mode_id =1 THEN t1.score ELSE 0 END) AS admissionNoteScoreTw,
|
|
|
- GROUP_CONCAT(DISTINCT CASE WHEN t1.mode_id = 2 THEN t1.msg ELSE NULL END SEPARATOR ';' ) AS firstCourseNote,
|
|
|
- SUM(CASE WHEN t1.mode_id =2 AND t1.is_reject = 0 THEN t1.score ELSE 0 END) AS firstCourseNoteScoreOn,
|
|
|
- SUM(CASE WHEN t1.mode_id =2 THEN t1.score ELSE 0 END) AS firstCourseNoteScoreTw,
|
|
|
- GROUP_CONCAT(DISTINCT CASE WHEN t1.mode_id = 6 THEN t1.msg ELSE NULL END SEPARATOR ';' ) AS medHomePage,
|
|
|
- SUM(CASE WHEN t1.mode_id =6 AND t1.is_reject = 0 THEN t1.score ELSE 0 END) AS medHomePageScoreOn,
|
|
|
- SUM(CASE WHEN t1.mode_id =6 THEN t1.score ELSE 0 END) AS medHomePageScoreTw,
|
|
|
- GROUP_CONCAT(DISTINCT CASE WHEN t1.mode_id = 8 THEN t1.msg ELSE NULL END SEPARATOR ';' ) AS docAdviceNote,
|
|
|
- SUM(CASE WHEN t1.mode_id =8 AND t1.is_reject = 0 THEN t1.score ELSE 0 END) AS docAdviceNoteScoreOn,
|
|
|
- SUM(CASE WHEN t1.mode_id =8 THEN t1.score ELSE 0 END) AS docAdviceNoteScoreTw,
|
|
|
- GROUP_CONCAT(DISTINCT CASE WHEN t1.mode_id = 56 THEN t1.msg ELSE NULL END SEPARATOR ';' ) AS courseRecord,
|
|
|
- SUM(CASE WHEN t1.mode_id =56 AND t1.is_reject = 0 THEN t1.score ELSE 0 END) AS courseRecordScoreOn,
|
|
|
- SUM(CASE WHEN t1.mode_id =56 THEN t1.score ELSE 0 END) AS courseRecordScoreTw,
|
|
|
- GROUP_CONCAT(DISTINCT CASE WHEN t1.mode_id = 17 THEN t1.msg ELSE NULL END SEPARATOR ';' ) AS operationInfo,
|
|
|
- SUM(CASE WHEN t1.mode_id =17 AND t1.is_reject = 0 THEN t1.score ELSE 0 END) AS operationInfoScoreOn,
|
|
|
- SUM(CASE WHEN t1.mode_id =17 THEN t1.score ELSE 0 END) AS operationInfoScoreTw,
|
|
|
- GROUP_CONCAT(DISTINCT CASE WHEN t1.mode_id = 5 THEN t1.msg ELSE NULL END SEPARATOR ';' ) AS dischargeNote,
|
|
|
- SUM(CASE WHEN t1.mode_id =5 AND t1.is_reject = 0 THEN t1.score ELSE 0 END) AS dischargeNoteScoreOn,
|
|
|
- SUM(CASE WHEN t1.mode_id =5 THEN t1.score ELSE 0 END) AS dischargeNoteScoreTw,
|
|
|
- GROUP_CONCAT(DISTINCT CASE WHEN t1.mode_id != 1 AND t1.mode_id != 2 AND t1.mode_id != 6 AND t1.mode_id != 8 AND t1.mode_id != 156 AND t1.mode_id != 17 AND t1.mode_id != 5 THEN t1.msg ELSE NULL END SEPARATOR ';' ) AS otherCase
|
|
|
- FROM (
|
|
|
- SELECT
|
|
|
- c.behospital_code,
|
|
|
- c.hospital_id,
|
|
|
- a.mode_id,
|
|
|
- c.cases_score,
|
|
|
- c.score,
|
|
|
- c.msg,
|
|
|
- c.is_reject,
|
|
|
- c.cases_id
|
|
|
- FROM
|
|
|
- `qc_cases_entry` a,
|
|
|
- qc_mode b,
|
|
|
- med_qcresult_detail c,
|
|
|
- qc_cases_hospital d,
|
|
|
- med_behospital_info 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.id = c.cases_entry_id
|
|
|
- AND a.mode_id = b.id
|
|
|
- AND c.cases_id = d.cases_id
|
|
|
- AND c.hospital_id = d.hospital_id
|
|
|
- AND c.behospital_code = e.behospital_code
|
|
|
- AND c.hospital_id = e.hospital_id
|
|
|
- <if test="hospitalId != null">
|
|
|
- and c.hospital_id = #{hospitalId}
|
|
|
- </if>
|
|
|
- <if test="deptName != null and deptName != ''">
|
|
|
- and e.beh_dept_name= #{deptName}
|
|
|
- </if>
|
|
|
- <if test="behospitalCode != null and behospitalCode != ''">
|
|
|
- and e.behospital_code like CONCAT('%',#{behospitalCode},'%')
|
|
|
- </if>
|
|
|
- <if test="isPlacefile != null and isPlacefile != ''">
|
|
|
- and e.is_placefile = #{isPlacefile}
|
|
|
- </if>
|
|
|
- <if test="behosDateStart != null">
|
|
|
- <![CDATA[ and e.behospital_date >= #{behosDateStart}]]>
|
|
|
- </if>
|
|
|
- <if test="behosDateEnd != null">
|
|
|
- <![CDATA[ and e.behospital_date < #{behosDateEnd}]]>
|
|
|
- </if>
|
|
|
- <if test="leaveHosDateStart != null">
|
|
|
- <![CDATA[ and e.leave_hospital_date >= #{leaveHosDateStart}]]>
|
|
|
- </if>
|
|
|
- <if test="leaveHosDateEnd != null">
|
|
|
- <![CDATA[ and e.leave_hospital_date < #{leaveHosDateEnd}]]>
|
|
|
- </if>
|
|
|
- <if test="level != null and level != ''">
|
|
|
- and e.level = #{level}
|
|
|
- </if>
|
|
|
- <if test="level != null and level != ''">
|
|
|
- and e.level = #{level}
|
|
|
- </if>
|
|
|
- ORDER BY b.order_no, c.grade_type DESC, a.order_no
|
|
|
- )t1 GROUP BY behospital_code
|
|
|
- </select>
|
|
|
--->
|
|
|
-
|
|
|
<select id="getQualityCaseSorce" resultType="com.diagbot.dto.CaseScoreDTO">
|
|
|
SELECT a.cases_id as casesId,c.cases_entry_id as casesEntryId,c.behospital_code as behospitalCode,a.mode_id as modelId,c.score,c.cases_score as casesScore,c.msg,c.is_reject as isReject
|
|
|
FROM `qc_cases_entry` a, med_qcresult_detail c,med_behospital_info e
|
|
@@ -380,6 +224,7 @@
|
|
|
t.beh_dept_id AS deptId,
|
|
|
t.leave_hospital_date AS leaveHospitalDate,
|
|
|
t.level,
|
|
|
+ t.age,
|
|
|
t.score_res as totalScore,
|
|
|
t.is_deleted,
|
|
|
g.check_name AS chName,
|
|
@@ -388,10 +233,13 @@
|
|
|
select a.*,
|
|
|
ifnull(b.level,'未评分') as level,
|
|
|
b.grade_type,
|
|
|
+ IF(c.age is null, null,CONCAT( ifnull(c.age,'') ,ifnull(c.age_unit,'') ))as age,
|
|
|
b.score_res
|
|
|
from med_behospital_info a
|
|
|
LEFT JOIN med_qcresult_info b
|
|
|
on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
|
|
|
+ left join med_home_page c
|
|
|
+ on a.behospital_code = c.behospital_code and c.is_deleted = 'N'
|
|
|
) t
|
|
|
LEFT JOIN (SELECT * FROM med_check_info WHERE is_deleted = 'N' AND check_type = 0 ) g
|
|
|
ON t.behospital_code = g.behospital_code
|
|
@@ -466,15 +314,18 @@
|
|
|
t.beh_dept_id AS deptId,
|
|
|
t.leave_hospital_date AS leaveHospitalDate,
|
|
|
t.level,
|
|
|
+ t.age,
|
|
|
t.score_res as totalScore,
|
|
|
t.is_deleted,
|
|
|
g.check_name AS chName,
|
|
|
h.check_name AS mrName
|
|
|
from (
|
|
|
- select a.*, ifnull(b.level,'未评分') as level, b.grade_type,d.user_id, b.score_res, b.gmt_create as
|
|
|
+ select a.*, ifnull(b.level,'未评分') as level, IF(c.age is null, null,CONCAT( ifnull(c.age,''),ifnull(c.age_unit,'') ))as age, b.grade_type,d.user_id, b.score_res, b.gmt_create as
|
|
|
grade_time from med_behospital_info a
|
|
|
LEFT JOIN med_qcresult_info b
|
|
|
on a.behospital_code = b.behospital_code and b.is_deleted = 'N'
|
|
|
+ left join med_home_page c
|
|
|
+ on a.behospital_code = c.behospital_code and c.is_deleted = 'N'
|
|
|
LEFT JOIN sys_user_dept d
|
|
|
ON a.hospital_id = d.hospital_id
|
|
|
AND a.beh_dept_id = d.dept_id
|