|
@@ -3381,25 +3381,15 @@
|
|
|
SELECT
|
|
|
a.beh_dept_id AS deptId,
|
|
|
a.beh_dept_name AS deptName,
|
|
|
- d.id AS casesEntryId,
|
|
|
- d.NAME AS casesEntryName,
|
|
|
+ a.cases_entry_id AS casesEntryId,
|
|
|
+ a.msg AS casesEntryName,
|
|
|
count(*) AS casesEntryNum
|
|
|
FROM
|
|
|
- med_behospital_info a,
|
|
|
- med_qcresult_info b,
|
|
|
- med_qcresult_detail c,
|
|
|
- qc_cases_entry d
|
|
|
+ med_qcresult_report a
|
|
|
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_entry_id = d.id
|
|
|
AND a.qc_type_id != 0
|
|
|
+ AND a.cases_id is not null
|
|
|
<if test="isPlacefile != null and isPlacefile != ''">
|
|
|
and a.is_placefile = #{isPlacefile}
|
|
|
</if>
|
|
@@ -3426,7 +3416,7 @@
|
|
|
AND a.beh_dept_name like CONCAT('%', #{deptName}, '%')
|
|
|
</if>
|
|
|
<if test="casesEntryIds != null and casesEntryIds.size()>0">
|
|
|
- AND c.cases_entry_id IN
|
|
|
+ AND a.cases_entry_id IN
|
|
|
<foreach collection="casesEntryIds" item="item" open="(" close=")" separator=",">
|
|
|
#{item}
|
|
|
</foreach>
|
|
@@ -3434,8 +3424,8 @@
|
|
|
GROUP BY
|
|
|
a.beh_dept_id,
|
|
|
a.beh_dept_name,
|
|
|
- c.cases_entry_id,
|
|
|
- d.NAME
|
|
|
+ a.cases_entry_id,
|
|
|
+ a.msg
|
|
|
</select>
|
|
|
|
|
|
<!-- 病历稽查表-->
|
|
@@ -3445,45 +3435,35 @@
|
|
|
a.beh_dept_name AS deptName,
|
|
|
a.doctor_name as doctorGroup,
|
|
|
a.doctor_name as doctorName,
|
|
|
- sum(c.cases_entry_id = 2658) as entry_2658_num,
|
|
|
- sum(c.cases_entry_id = 2686) as entry_2686_num,
|
|
|
- sum(c.cases_entry_id = 2657) as entry_2657_num,
|
|
|
- sum(c.cases_entry_id = 3010) as entry_3010_num,
|
|
|
- sum(c.cases_entry_id = 2655) as entry_2655_num,
|
|
|
- sum(c.cases_entry_id = 2654) as entry_2654_num,
|
|
|
- sum(c.cases_entry_id = 2852) as entry_2852_num,
|
|
|
- sum(c.cases_entry_id = 2287) as entry_2287_num,
|
|
|
- sum(c.cases_entry_id = 3025) as entry_3025_num,
|
|
|
- sum(c.cases_entry_id = 2170) as entry_2170_num,
|
|
|
- sum(c.cases_entry_id = 2930) as entry_2930_num,
|
|
|
- sum(c.cases_entry_id = 2900) as entry_2900_num,
|
|
|
- sum(c.cases_entry_id = 2229) as entry_2229_num,
|
|
|
- sum(c.cases_entry_id = 2217) as entry_2217_num,
|
|
|
- sum(c.cases_entry_id = 2218) as entry_2218_num,
|
|
|
- sum(c.cases_entry_id = 2220) as entry_2220_num,
|
|
|
- sum(c.cases_entry_id = 2486) as entry_2486_num,
|
|
|
- sum(c.cases_entry_id = 3063) as entry_3063_num,
|
|
|
- sum(c.cases_entry_id = 3062) as entry_3062_num,
|
|
|
- sum(c.cases_entry_id = 2495) as entry_2495_num
|
|
|
+ sum(a.cases_entry_id = 2658) as entry_2658_num,
|
|
|
+ sum(a.cases_entry_id = 2686) as entry_2686_num,
|
|
|
+ sum(a.cases_entry_id = 2657) as entry_2657_num,
|
|
|
+ sum(a.cases_entry_id = 3010) as entry_3010_num,
|
|
|
+ sum(a.cases_entry_id = 2655) as entry_2655_num,
|
|
|
+ sum(a.cases_entry_id = 2654) as entry_2654_num,
|
|
|
+ sum(a.cases_entry_id = 2852) as entry_2852_num,
|
|
|
+ sum(a.cases_entry_id = 2287) as entry_2287_num,
|
|
|
+ sum(a.cases_entry_id = 3025) as entry_3025_num,
|
|
|
+ sum(a.cases_entry_id = 2170) as entry_2170_num,
|
|
|
+ sum(a.cases_entry_id = 2930) as entry_2930_num,
|
|
|
+ sum(a.cases_entry_id = 2900) as entry_2900_num,
|
|
|
+ sum(a.cases_entry_id = 2229) as entry_2229_num,
|
|
|
+ sum(a.cases_entry_id = 2217) as entry_2217_num,
|
|
|
+ sum(a.cases_entry_id = 2218) as entry_2218_num,
|
|
|
+ sum(a.cases_entry_id = 2220) as entry_2220_num,
|
|
|
+ sum(a.cases_entry_id = 2486) as entry_2486_num,
|
|
|
+ sum(a.cases_entry_id = 3063) as entry_3063_num,
|
|
|
+ sum(a.cases_entry_id = 3062) as entry_3062_num,
|
|
|
+ sum(a.cases_entry_id = 2495) as entry_2495_num
|
|
|
FROM
|
|
|
- med_behospital_info a,
|
|
|
- med_qcresult_info b,
|
|
|
- med_qcresult_detail c,
|
|
|
- qc_cases_entry d,
|
|
|
+ med_qcresult_report a,
|
|
|
bas_doctor_info e
|
|
|
WHERE
|
|
|
a.is_deleted = 'N'
|
|
|
- AND b.is_deleted = 'N'
|
|
|
- AND c.is_deleted = 'N'
|
|
|
- AND d.is_deleted = 'N'
|
|
|
+ AND a.cases_id is not null
|
|
|
AND e.is_deleted = 'N'
|
|
|
- AND a.hospital_id = b.hospital_id
|
|
|
- AND a.hospital_id = c.hospital_id
|
|
|
AND a.hospital_id = e.hospital_id
|
|
|
- AND a.behospital_code = b.behospital_code
|
|
|
- AND a.behospital_code = c.behospital_code
|
|
|
AND a.beh_dept_id = e.dept_id
|
|
|
- AND c.cases_entry_id = d.id
|
|
|
and a.doctor_id=e.doctor_id
|
|
|
and e.group_id is not NULL
|
|
|
AND LENGTH(e.group_id)>0
|
|
@@ -3569,45 +3549,35 @@
|
|
|
a.beh_dept_id AS deptId,
|
|
|
a.beh_dept_name AS deptName,
|
|
|
GROUP_CONCAT( DISTINCT a.doctor_name) as doctorName,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2658 THEN a.behospital_code else null END ) as RYJLW_24,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2686 THEN a.behospital_code else null END ) as SCBCJLW_8H,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2657 THEN a.behospital_code else null END ) as ZRSCCFW_72H,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3010 THEN a.behospital_code else null END ) as RYHLJBCW_3D,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2655 THEN a.behospital_code else null END ) as ZRCFW_2W,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2654 THEN a.behospital_code else null END ) as ZZCFW_3W,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2852 THEN a.behospital_code else null END ) as QJJLW_6H,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2287 THEN a.behospital_code else null END ) as HZJLW_24H,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3025 THEN a.behospital_code else null END ) as SQTLXJW,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2170 THEN a.behospital_code else null END ) as SXJLSW_24H,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2930 THEN a.behospital_code else null END ) as XHSCW_30M,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2900 THEN a.behospital_code else null END ) as SHZDCFW_24H,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2229 THEN a.behospital_code else null END ) as SHJBCW_3D,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2217 THEN a.behospital_code else null END ) as ZKJBCW_3D,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2218 THEN a.behospital_code else null END ) as ZKJLW_24,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2220 THEN a.behospital_code else null END ) as BWZHJLBCW_MD,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2486 THEN a.behospital_code else null END ) as SXHWJL,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3063 THEN a.behospital_code else null END ) as SXPJW_24,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 3062 THEN a.behospital_code else null END ) as WJZWJL,
|
|
|
- GROUP_CONCAT(DISTINCT case when c.cases_entry_id = 2495 THEN a.behospital_code else null END ) as WYWWCXJ
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2658 THEN a.behospital_code else null END ) as RYJLW_24,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2686 THEN a.behospital_code else null END ) as SCBCJLW_8H,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2657 THEN a.behospital_code else null END ) as ZRSCCFW_72H,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 3010 THEN a.behospital_code else null END ) as RYHLJBCW_3D,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2655 THEN a.behospital_code else null END ) as ZRCFW_2W,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2654 THEN a.behospital_code else null END ) as ZZCFW_3W,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2852 THEN a.behospital_code else null END ) as QJJLW_6H,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2287 THEN a.behospital_code else null END ) as HZJLW_24H,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 3025 THEN a.behospital_code else null END ) as SQTLXJW,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2170 THEN a.behospital_code else null END ) as SXJLSW_24H,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2930 THEN a.behospital_code else null END ) as XHSCW_30M,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2900 THEN a.behospital_code else null END ) as SHZDCFW_24H,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2229 THEN a.behospital_code else null END ) as SHJBCW_3D,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2217 THEN a.behospital_code else null END ) as ZKJBCW_3D,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2218 THEN a.behospital_code else null END ) as ZKJLW_24,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2220 THEN a.behospital_code else null END ) as BWZHJLBCW_MD,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2486 THEN a.behospital_code else null END ) as SXHWJL,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 3063 THEN a.behospital_code else null END ) as SXPJW_24,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 3062 THEN a.behospital_code else null END ) as WJZWJL,
|
|
|
+ GROUP_CONCAT(DISTINCT case when a.cases_entry_id = 2495 THEN a.behospital_code else null END ) as WYWWCXJ
|
|
|
FROM
|
|
|
- med_behospital_info a,
|
|
|
- med_qcresult_info b,
|
|
|
- med_qcresult_detail c,
|
|
|
- qc_cases_entry d,
|
|
|
+ med_qcresult_report a,
|
|
|
bas_doctor_info e
|
|
|
WHERE
|
|
|
a.is_deleted = 'N'
|
|
|
- AND b.is_deleted = 'N'
|
|
|
- AND c.is_deleted = 'N'
|
|
|
- AND d.is_deleted = 'N'
|
|
|
+ AND a.cases_id is not null
|
|
|
AND e.is_deleted = 'N'
|
|
|
- AND a.hospital_id = b.hospital_id
|
|
|
- AND a.hospital_id = c.hospital_id
|
|
|
AND a.hospital_id = e.hospital_id
|
|
|
- AND a.behospital_code = b.behospital_code
|
|
|
- AND a.behospital_code = c.behospital_code
|
|
|
AND a.beh_dept_id = e.dept_id
|
|
|
- AND c.cases_entry_id = d.id
|
|
|
and a.doctor_id=e.doctor_id
|
|
|
and e.group_id is not NULL
|
|
|
AND LENGTH(e.group_id)>0
|