|
@@ -2728,7 +2728,7 @@
|
|
|
SELECT
|
|
|
t1.hospital_id AS hospitalId,
|
|
|
t1.behospital_code AS behospitalCode,
|
|
|
- t1.LEVEL AS level,
|
|
|
+ t1.LEVEL AS LEVEL,
|
|
|
t1.score_res AS scoreRes,
|
|
|
t1.NAME AS patName,
|
|
|
t1.sex AS sex,
|
|
@@ -2738,6 +2738,10 @@
|
|
|
t2.age
|
|
|
FROM
|
|
|
(
|
|
|
+ SELECT
|
|
|
+ DISTINCT tt1.*
|
|
|
+ FROM
|
|
|
+ (
|
|
|
SELECT DISTINCT
|
|
|
a.hospital_id,
|
|
|
a.behospital_code,
|
|
@@ -2799,6 +2803,28 @@
|
|
|
<if test="qcResultShortPageVO.ruleType != null">
|
|
|
AND d.rule_type = #{qcResultShortPageVO.ruleType}
|
|
|
</if>
|
|
|
+ <if test="qcResultShortPageVO.casesEntryId != null and qcResultShortPageVO.casesEntryId==2495">
|
|
|
+ AND TIMESTAMPDIFF(
|
|
|
+ DAY,
|
|
|
+ DATE( a.behospital_date ),
|
|
|
+ DATE( a.leave_hospital_date ))> 30
|
|
|
+ </if>
|
|
|
+ ) tt1
|
|
|
+ <if test="qcResultShortPageVO.casesEntryId != null and qcResultShortPageVO.casesEntryId==2511">
|
|
|
+ ,med_medical_record tt2
|
|
|
+ WHERE
|
|
|
+ tt2.is_deleted = 'N'
|
|
|
+ AND tt1.hospital_id = tt2.hospital_id
|
|
|
+ AND tt1.behospital_code = tt2.behospital_code
|
|
|
+ AND tt2.mode_id = 30
|
|
|
+ </if>
|
|
|
+ <if test="qcResultShortPageVO.casesEntryId != null and qcResultShortPageVO.casesEntryId==2419">
|
|
|
+ ,med_crisis_info tt2
|
|
|
+ WHERE
|
|
|
+ tt2.is_deleted = 'N'
|
|
|
+ AND tt1.hospital_id = tt2.hospital_id
|
|
|
+ AND tt1.behospital_code = tt2.behospital_code
|
|
|
+ </if>
|
|
|
) t1
|
|
|
<if test="qcResultShortPageVO.casesEntryId == null or (qcResultShortPageVO.casesEntryId!=2594 and qcResultShortPageVO.casesEntryId!=2973 and qcResultShortPageVO.casesEntryId!=2166)">
|
|
|
LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
|