|
@@ -50,7 +50,7 @@
|
|
h.check_name AS mr_name,
|
|
h.check_name AS mr_name,
|
|
g.check_time AS ch_time,
|
|
g.check_time AS ch_time,
|
|
h.check_time AS mr_time
|
|
h.check_time AS mr_time
|
|
- from (
|
|
|
|
|
|
+ from (
|
|
select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
|
|
select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
|
|
grade_time, c.age from med_behospital_info a
|
|
grade_time, c.age from med_behospital_info a
|
|
LEFT JOIN med_qcresult_info b
|
|
LEFT JOIN med_qcresult_info b
|
|
@@ -111,16 +111,16 @@
|
|
and t.qc_type_id != 0) p
|
|
and t.qc_type_id != 0) p
|
|
where p.is_deleted="N"
|
|
where p.is_deleted="N"
|
|
<if test="checkStatus != null ">
|
|
<if test="checkStatus != null ">
|
|
- and p.check_status = #{checkStatus}
|
|
|
|
|
|
+ and p.check_status = #{checkStatus}
|
|
</if>
|
|
</if>
|
|
<if test="mrStatus != null ">
|
|
<if test="mrStatus != null ">
|
|
- AND p.mr_status = #{mrStatus}
|
|
|
|
|
|
+ AND p.mr_status = #{mrStatus}
|
|
</if>
|
|
</if>
|
|
<if test="chName != null and chName !=''">
|
|
<if test="chName != null and chName !=''">
|
|
- AND p.ch_name like CONCAT('%',#{chName},'%')
|
|
|
|
|
|
+ AND p.ch_name like CONCAT('%',#{chName},'%')
|
|
</if>
|
|
</if>
|
|
<if test="mrName != null and mrName !=''">
|
|
<if test="mrName != null and mrName !=''">
|
|
- AND p.mr_name like CONCAT('%',#{mrName},'%')
|
|
|
|
|
|
+ AND p.mr_name like CONCAT('%',#{mrName},'%')
|
|
</if>
|
|
</if>
|
|
<if test="chTimeStart != null">
|
|
<if test="chTimeStart != null">
|
|
<![CDATA[ and p.ch_time >= #{chTimeStart}]]>
|
|
<![CDATA[ and p.ch_time >= #{chTimeStart}]]>
|
|
@@ -412,7 +412,7 @@
|
|
and p.check_status = #{checkStatus}
|
|
and p.check_status = #{checkStatus}
|
|
</if>
|
|
</if>
|
|
<if test="mrStatus != null ">
|
|
<if test="mrStatus != null ">
|
|
- AND p.mr_status = #{mrStatus}
|
|
|
|
|
|
+ AND p.mr_status = #{mrStatus}
|
|
</if>
|
|
</if>
|
|
<if test="chName != null and chName !=''">
|
|
<if test="chName != null and chName !=''">
|
|
AND p.ch_name like CONCAT('%',#{chName},'%')
|
|
AND p.ch_name like CONCAT('%',#{chName},'%')
|
|
@@ -446,7 +446,7 @@
|
|
h.check_name as mr_name,
|
|
h.check_name as mr_name,
|
|
g.check_time as ch_time,
|
|
g.check_time as ch_time,
|
|
h.check_time AS mr_time
|
|
h.check_time AS mr_time
|
|
- from (SELECT
|
|
|
|
|
|
+ from (SELECT
|
|
a.*,
|
|
a.*,
|
|
IFNULL(b.level, '未评分') AS `level`,
|
|
IFNULL(b.level, '未评分') AS `level`,
|
|
b.grade_type,
|
|
b.grade_type,
|
|
@@ -557,7 +557,7 @@
|
|
h.check_name as mr_name,
|
|
h.check_name as mr_name,
|
|
g.check_time as ch_time,
|
|
g.check_time as ch_time,
|
|
h.check_time AS mr_time
|
|
h.check_time AS mr_time
|
|
- from (
|
|
|
|
|
|
+ from (
|
|
select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
|
|
select a.*, ifnull(b.level,'未评分') as `level`, b.grade_type, b.score_res, b.gmt_create as
|
|
grade_time, c.age from med_behospital_info a
|
|
grade_time, c.age from med_behospital_info a
|
|
LEFT JOIN med_qcresult_info b
|
|
LEFT JOIN med_qcresult_info b
|
|
@@ -573,17 +573,17 @@
|
|
AND t.hospital_id = h.hospital_id
|
|
AND t.hospital_id = h.hospital_id
|
|
WHERE t.is_deleted = 'N'
|
|
WHERE t.is_deleted = 'N'
|
|
and
|
|
and
|
|
- t.doctor_id in (
|
|
|
|
- SELECT doctor_id FROM `bas_doctor_info`
|
|
|
|
- where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
|
|
|
|
- select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
|
|
|
|
- where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
|
|
|
|
- and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
|
|
|
|
- and c1.username = c3.doctor_id
|
|
|
|
- and c2.hospital_id = #{hospitalId}
|
|
|
|
- and c1.id = #{userId}
|
|
|
|
- )
|
|
|
|
- )
|
|
|
|
|
|
+ t.doctor_id in (
|
|
|
|
+ SELECT doctor_id FROM `bas_doctor_info`
|
|
|
|
+ where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
|
|
|
|
+ select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
|
|
|
|
+ where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
|
|
|
|
+ and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
|
|
|
|
+ and c1.username = c3.doctor_id
|
|
|
|
+ and c2.hospital_id = #{hospitalId}
|
|
|
|
+ and c1.id = #{userId}
|
|
|
|
+ )
|
|
|
|
+ )
|
|
<if test="deptId != null and deptId != ''">
|
|
<if test="deptId != null and deptId != ''">
|
|
and t.beh_dept_id = #{deptId}
|
|
and t.beh_dept_id = #{deptId}
|
|
</if>
|
|
</if>
|
|
@@ -734,13 +734,17 @@
|
|
COUNT(*)
|
|
COUNT(*)
|
|
FROM
|
|
FROM
|
|
med_behospital_info a,
|
|
med_behospital_info a,
|
|
- med_home_page b
|
|
|
|
|
|
+ med_medical_record b,
|
|
|
|
+ med_medical_record_content c
|
|
WHERE
|
|
WHERE
|
|
a.is_deleted = 'N'
|
|
a.is_deleted = 'N'
|
|
AND b.is_deleted = 'N'
|
|
AND b.is_deleted = 'N'
|
|
|
|
+ AND c.is_deleted = 'N'
|
|
AND a.hospital_id = b.hospital_id
|
|
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 = b.behospital_code
|
|
- AND b.return_to_type = '死亡'
|
|
|
|
|
|
+ AND b.rec_id = c.rec_id
|
|
|
|
+ and b.mode_id = '24'
|
|
<if test="isPlacefile != null and isPlacefile != ''">
|
|
<if test="isPlacefile != null and isPlacefile != ''">
|
|
and a.is_placefile = #{isPlacefile}
|
|
and a.is_placefile = #{isPlacefile}
|
|
</if>
|
|
</if>
|
|
@@ -2727,6 +2731,7 @@
|
|
</collection>
|
|
</collection>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
+
|
|
<select id="exportExcel" resultMap="ExportExcelMap">
|
|
<select id="exportExcel" resultMap="ExportExcelMap">
|
|
SELECT DISTINCT
|
|
SELECT DISTINCT
|
|
t1.beh_dept_name AS behDeptName,
|
|
t1.beh_dept_name AS behDeptName,
|
|
@@ -2775,7 +2780,7 @@
|
|
h.check_name AS mr_name,
|
|
h.check_name AS mr_name,
|
|
g.check_time AS ch_time,
|
|
g.check_time AS ch_time,
|
|
h.check_time AS mr_time
|
|
h.check_time AS mr_time
|
|
- FROM (
|
|
|
|
|
|
+ FROM (
|
|
SELECT
|
|
SELECT
|
|
t1.behDeptId,
|
|
t1.behDeptId,
|
|
t1.behDeptName,
|
|
t1.behDeptName,
|
|
@@ -2845,13 +2850,13 @@
|
|
</if>
|
|
</if>
|
|
<if test="doctorName != null and doctorName != ''">
|
|
<if test="doctorName != null and doctorName != ''">
|
|
AND (a.doctor_name like CONCAT('%',#{doctorName},'%')
|
|
AND (a.doctor_name like CONCAT('%',#{doctorName},'%')
|
|
- OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
|
|
|
|
- OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
|
|
|
|
|
|
+ OR a.beh_doctor_name like CONCAT('%',#{doctorName},'%')
|
|
|
|
+ OR a.director_doctor_name like CONCAT('%',#{doctorName},'%'))
|
|
</if>
|
|
</if>
|
|
<if test="doctorCode != null and doctorCode != ''">
|
|
<if test="doctorCode != null and doctorCode != ''">
|
|
AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
|
|
AND (a.doctor_id like CONCAT('%',#{doctorCode},'%')
|
|
- OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
|
|
|
|
- OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
|
|
|
|
|
|
+ OR a.beh_doctor_id like CONCAT('%',#{doctorCode},'%')
|
|
|
|
+ OR a.director_doctor_id like CONCAT('%',#{doctorCode},'%'))
|
|
</if>
|
|
</if>
|
|
<if test="deptId != null and deptId != ''">
|
|
<if test="deptId != null and deptId != ''">
|
|
AND a.beh_dept_id = #{deptId}
|
|
AND a.beh_dept_id = #{deptId}
|
|
@@ -2972,7 +2977,7 @@
|
|
h.check_name AS mr_name,
|
|
h.check_name AS mr_name,
|
|
g.check_time AS ch_time,
|
|
g.check_time AS ch_time,
|
|
h.check_time AS mr_time
|
|
h.check_time AS mr_time
|
|
- FROM (
|
|
|
|
|
|
+ FROM (
|
|
SELECT
|
|
SELECT
|
|
t1.behDeptId,
|
|
t1.behDeptId,
|
|
t1.behDeptName,
|
|
t1.behDeptName,
|
|
@@ -3183,7 +3188,7 @@
|
|
h.check_name AS mr_name,
|
|
h.check_name AS mr_name,
|
|
g.check_time AS ch_time,
|
|
g.check_time AS ch_time,
|
|
h.check_time AS mr_time
|
|
h.check_time AS mr_time
|
|
- FROM (
|
|
|
|
|
|
+ FROM (
|
|
SELECT
|
|
SELECT
|
|
t1.behDeptId,
|
|
t1.behDeptId,
|
|
t1.behDeptName,
|
|
t1.behDeptName,
|
|
@@ -3230,15 +3235,15 @@
|
|
and a.is_placefile = #{isPlacefile}
|
|
and a.is_placefile = #{isPlacefile}
|
|
</if>
|
|
</if>
|
|
AND a.doctor_id in
|
|
AND a.doctor_id in
|
|
- (SELECT doctor_id FROM `bas_doctor_info`
|
|
|
|
- where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
|
|
|
|
- select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
|
|
|
|
- where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
|
|
|
|
- and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
|
|
|
|
- and c1.username = c3.doctor_id
|
|
|
|
- and c2.hospital_id = #{hospitalId}
|
|
|
|
- and c1.id = #{userId}
|
|
|
|
- ))
|
|
|
|
|
|
+ (SELECT doctor_id FROM `bas_doctor_info`
|
|
|
|
+ where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
|
|
|
|
+ select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
|
|
|
|
+ where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
|
|
|
|
+ and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
|
|
|
|
+ and c1.username = c3.doctor_id
|
|
|
|
+ and c2.hospital_id = #{hospitalId}
|
|
|
|
+ and c1.id = #{userId}
|
|
|
|
+ ))
|
|
<![CDATA[AND a.qc_type_id <>0 ]]>
|
|
<![CDATA[AND a.qc_type_id <>0 ]]>
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
<if test="hospitalId != null and hospitalId != ''">
|
|
AND a.hospital_id = #{hospitalId}
|
|
AND a.hospital_id = #{hospitalId}
|
|
@@ -3289,15 +3294,15 @@
|
|
WHERE
|
|
WHERE
|
|
a.is_deleted = 'N'
|
|
a.is_deleted = 'N'
|
|
AND a.doctor_id in
|
|
AND a.doctor_id in
|
|
- (SELECT doctor_id FROM `bas_doctor_info`
|
|
|
|
- where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
|
|
|
|
- select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
|
|
|
|
- where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
|
|
|
|
- and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
|
|
|
|
- and c1.username = c3.doctor_id
|
|
|
|
- and c2.hospital_id = #{hospitalId}
|
|
|
|
- and c1.id = #{userId}
|
|
|
|
- ))
|
|
|
|
|
|
+ (SELECT doctor_id FROM `bas_doctor_info`
|
|
|
|
+ where is_deleted = 'N' and hospital_id = #{hospitalId} and group_id in (
|
|
|
|
+ select c3.group_id from sys_user c1, sys_user_hospital c2, bas_doctor_info c3
|
|
|
|
+ where c1.is_deleted = 'N' and c2.is_deleted = 'N' and c3.is_deleted = 'N'
|
|
|
|
+ and c1.id = c2.user_id and c2.hospital_id = c3.hospital_id
|
|
|
|
+ and c1.username = c3.doctor_id
|
|
|
|
+ and c2.hospital_id = #{hospitalId}
|
|
|
|
+ and c1.id = #{userId}
|
|
|
|
+ ))
|
|
AND b.is_deleted = 'N'
|
|
AND b.is_deleted = 'N'
|
|
AND a.hospital_id = b.hospital_id
|
|
AND a.hospital_id = b.hospital_id
|
|
AND a.behospital_code = b.behospital_code
|
|
AND a.behospital_code = b.behospital_code
|
|
@@ -4620,7 +4625,21 @@
|
|
AND cases_id = 243
|
|
AND cases_id = 243
|
|
) h2
|
|
) h2
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+ <!-- 离院病人评分详情页-->
|
|
|
|
+ <select id="getAge" resultType="java.util.Map">
|
|
|
|
+ SELECT
|
|
|
|
+ a.behospital_code as behospitalCode,
|
|
|
|
+ a.age as age
|
|
|
|
+ FROM
|
|
|
|
+ med_home_page a
|
|
|
|
+ WHERE
|
|
|
|
+ a.is_deleted = 'N'
|
|
|
|
+ AND a.hospital_id = #{hospitalId}
|
|
|
|
+ AND a.behospital_code IN
|
|
|
|
+ <foreach collection="behospitalCodes" open="(" separator="," close=")" item="item">
|
|
|
|
+ '${item}'
|
|
|
|
+ </foreach>
|
|
|
|
+ </select>
|
|
<!-- 离院病人评分详情页-->
|
|
<!-- 离院病人评分详情页-->
|
|
<select id="leaveHosMRPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
<select id="leaveHosMRPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
SELECT
|
|
SELECT
|
|
@@ -4656,7 +4675,10 @@
|
|
t1.mrName,
|
|
t1.mrName,
|
|
t1.chTime,
|
|
t1.chTime,
|
|
t1.mrTime,
|
|
t1.mrTime,
|
|
- t2.age,
|
|
|
|
|
|
+ <if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType !=1">
|
|
|
|
+ t2.age,
|
|
|
|
+ </if>
|
|
|
|
+
|
|
t1.file_code AS fileCode
|
|
t1.file_code AS fileCode
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
@@ -4788,12 +4810,16 @@
|
|
)
|
|
)
|
|
</if>
|
|
</if>
|
|
<if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==1">
|
|
<if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==1">
|
|
- ,med_home_page t2
|
|
|
|
|
|
+ , med_medical_record b,
|
|
|
|
+ med_medical_record_content c
|
|
WHERE
|
|
WHERE
|
|
- t2.is_deleted = 'N'
|
|
|
|
- AND t1.hospital_id = t2.hospital_id
|
|
|
|
- AND t1.behospital_code = t2.behospital_code
|
|
|
|
- AND t2.return_to_type = '死亡'
|
|
|
|
|
|
+ b.is_deleted = 'N'
|
|
|
|
+ and c.is_deleted = 'N'
|
|
|
|
+ and t1.hospital_id = b.hospital_id
|
|
|
|
+ and t1.hospital_id = c.hospital_id
|
|
|
|
+ AND t1.behospital_code = b.behospital_code
|
|
|
|
+ AND b.rec_id = c.rec_id
|
|
|
|
+ and b.mode_id = '24'
|
|
</if>
|
|
</if>
|
|
<if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==4">
|
|
<if test="qcResultShortPageVO.leaveHosType != null and qcResultShortPageVO.leaveHosType ==4">
|
|
,med_home_page t2
|
|
,med_home_page t2
|
|
@@ -6342,6 +6368,238 @@
|
|
AND f1.behDeptName = f2.behDeptName
|
|
AND f1.behDeptName = f2.behDeptName
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <resultMap id="MedicalCheckMap" type="com.diagbot.dto.MedicalCheckDTO">
|
|
|
|
+ <result column="deptName" property="deptName"/>
|
|
|
|
+ <result column="deptId" property="deptId"/>
|
|
|
|
+ <result column="doctorName" property="doctorName"/>
|
|
|
|
+ <result column="RYJLW_24" property="ryjlw_24"/>
|
|
|
|
+ <result column="SCBCJLW_8H" property="scbcjlw_8h"/>
|
|
|
|
+ <result column="ZRSCCFW_72H" property="zrsccfw_72h"/>
|
|
|
|
+ <result column="RYHLJBCW_3D" property="ryhljbcw_3d"/>
|
|
|
|
+ <result column="ZRCFW_2W" property="zrcfw_2w"/>
|
|
|
|
+ <result column="ZZCFW_3W" property="zzcfw_3w"/>
|
|
|
|
+ <result column="QJJLW_6H" property="qjjlw_6h"/>
|
|
|
|
+ <result column="HZJLW_24H" property="hzjlw_24h"/>
|
|
|
|
+ <result column="SQTLXJW" property="sqtlxjw"/>
|
|
|
|
+ <result column="SXJLSW_24H" property="sxjlsw_24h"/>
|
|
|
|
+ <result column="XHSCW_30M" property="xhscw_30m"/>
|
|
|
|
+ <result column="SHZDCFW_24H" property="shzdcfw_24h"/>
|
|
|
|
+ <result column="SHJBCW_3D" property="shjbcw_3d"/>
|
|
|
|
+ <result column="ZKJBCW_3D" property="zkjbcw_3d"/>
|
|
|
|
+ <result column="ZKJLW_24" property="zkjlw_24"/>
|
|
|
|
+ <result column="BWZHJLBCW_MD" property="bwzhjlbcw_md"/>
|
|
|
|
+ <result column="SXHWJL" property="sxhwjl"/>
|
|
|
|
+ <result column="SXPJW_24" property="sxpjw_24"/>
|
|
|
|
+ <result column="WJZWJL" property="wjzwjl"/>
|
|
|
|
+ <result column="WYWWCXJ" property="wywwcxj"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <!-- 病历稽查表最新sql-->
|
|
|
|
+ <select id="getMedicalCheck" resultMap="MedicalCheckMap">
|
|
|
|
+ SELECT
|
|
|
|
+ a.beh_dept_id AS deptId,
|
|
|
|
+ a.beh_dept_name AS deptName,
|
|
|
|
+ a.doctor_name as doctorName,
|
|
|
|
+ sum(c.cases_entry_id = 2658) as RYJLW_24,
|
|
|
|
+ sum(c.cases_entry_id = 2686) as SCBCJLW_8H,
|
|
|
|
+ sum(c.cases_entry_id = 2657) as ZRSCCFW_72H,
|
|
|
|
+ sum(c.cases_entry_id = 3010) as RYHLJBCW_3D,
|
|
|
|
+ sum(c.cases_entry_id = 2655) as ZRCFW_2W,
|
|
|
|
+ sum(c.cases_entry_id = 2654) as ZZCFW_3W,
|
|
|
|
+ sum(c.cases_entry_id = 2852) as QJJLW_6H,
|
|
|
|
+ sum(c.cases_entry_id = 2287) as HZJLW_24H,
|
|
|
|
+ sum(c.cases_entry_id = 3025) as SQTLXJW,
|
|
|
|
+ sum(c.cases_entry_id = 2170) as SXJLSW_24H,
|
|
|
|
+ sum(c.cases_entry_id = 2930) as XHSCW_30M,
|
|
|
|
+ sum(c.cases_entry_id = 2900) as SHZDCFW_24H,
|
|
|
|
+ sum(c.cases_entry_id = 2229) as SHJBCW_3D,
|
|
|
|
+ sum(c.cases_entry_id = 2217) as ZKJBCW_3D,
|
|
|
|
+ sum(c.cases_entry_id = 2218) as ZKJLW_24,
|
|
|
|
+ sum(c.cases_entry_id = 2220) as BWZHJLBCW_MD,
|
|
|
|
+ sum(c.cases_entry_id = 2486) as SXHWJL,
|
|
|
|
+ sum(c.cases_entry_id = 3063) as SXPJW_24,
|
|
|
|
+ sum(c.cases_entry_id = 3062) as WJZWJL,
|
|
|
|
+ sum(c.cases_entry_id = 2495) as WYWWCXJ
|
|
|
|
+ FROM
|
|
|
|
+ med_behospital_info a,
|
|
|
|
+ med_qcresult_info b,
|
|
|
|
+ med_qcresult_detail c,
|
|
|
|
+ qc_cases_entry d,
|
|
|
|
+ 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 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 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
|
|
|
|
+ AND a.qc_type_id != 0
|
|
|
|
+ <if test="filterVO.isPlacefile != null and filterVO.isPlacefile != ''">
|
|
|
|
+ and a.is_placefile = #{filterVO.isPlacefile}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="filterVO.hospitalId != null and filterVO.hospitalId != ''">
|
|
|
|
+ AND a.hospital_id = #{filterVO.hospitalId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="filterVO.isPlacefile != null and filterVO.isPlacefile == 0">
|
|
|
|
+ <if test="filterVO.startDate != null ">
|
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{filterVO.startDate}]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="filterVO.endDate != null ">
|
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{filterVO.endDate}]]>
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="filterVO.isPlacefile != null and filterVO.isPlacefile == 1">
|
|
|
|
+ <if test="filterVO.startDate != null ">
|
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{filterVO.startDate}]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="filterVO.endDate != null ">
|
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{filterVO.endDate}]]>
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="filterVO.name != null and filterVO.name != ''">
|
|
|
|
+ AND a.beh_dept_name like CONCAT('%', #{filterVO.name}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ GROUP BY
|
|
|
|
+ a.beh_dept_id,
|
|
|
|
+ e.group_id,
|
|
|
|
+ a.doctor_id
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <resultMap id="MedicalCheckExcelMap" type="com.diagbot.dto.MedicalCheckExportDTO">
|
|
|
|
+ <result column="deptName" property="deptName"/>
|
|
|
|
+ <collection property="medicalDoctorExportDTOS" javaType="ArrayList" ofType="com.diagbot.dto.MedicalDoctorExportDTO">
|
|
|
|
+ <result column="doctorName" property="doctorName"/>
|
|
|
|
+ <collection property="medicalCheckTitleDTOS" javaType="ArrayList" ofType="com.diagbot.dto.MedicalCheckTitleDTO">
|
|
|
|
+ <result column="RYJLW_24" property="ryjlw_24"/>
|
|
|
|
+ <result column="SCBCJLW_8H" property="scbcjlw_8h"/>
|
|
|
|
+ <result column="ZRSCCFW_72H" property="zrsccfw_72h"/>
|
|
|
|
+ <result column="RYHLJBCW_3D" property="ryhljbcw_3d"/>
|
|
|
|
+ <result column="ZRCFW_2W" property="zrcfw_2w"/>
|
|
|
|
+ <result column="ZZCFW_3W" property="zzcfw_3w"/>
|
|
|
|
+ <result column="QJJLW_6H" property="qjjlw_6h"/>
|
|
|
|
+ <result column="HZJLW_24H" property="hzjlw_24h"/>
|
|
|
|
+ <result column="SQTLXJW" property="sqtlxjw"/>
|
|
|
|
+ <result column="SXJLSW_24H" property="sxjlsw_24h"/>
|
|
|
|
+ <result column="XHSCW_30M" property="xhscw_30m"/>
|
|
|
|
+ <result column="SHZDCFW_24H" property="shzdcfw_24h"/>
|
|
|
|
+ <result column="SHJBCW_3D" property="shjbcw_3d"/>
|
|
|
|
+ <result column="ZKJBCW_3D" property="zkjbcw_3d"/>
|
|
|
|
+ <result column="ZKJLW_24" property="zkjlw_24"/>
|
|
|
|
+ <result column="BWZHJLBCW_MD" property="bwzhjlbcw_md"/>
|
|
|
|
+ <result column="SXHWJL" property="sxhwjl"/>
|
|
|
|
+ <result column="SXPJW_24" property="sxpjw_24"/>
|
|
|
|
+ <result column="WJZWJL" property="wjzwjl"/>
|
|
|
|
+ <result column="WYWWCXJ" property="wywwcxj"/>
|
|
|
|
+ </collection>
|
|
|
|
+ </collection>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <!-- 病历稽查表最新导出-->
|
|
|
|
+ <select id="getMedicalCheckExport" resultMap="MedicalCheckExcelMap">
|
|
|
|
+ SELECT
|
|
|
|
+ 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
|
|
|
|
+-- sum(c.cases_entry_id = 2658) as RYJLW_24,
|
|
|
|
+-- sum(c.cases_entry_id = 2686) as SCBCJLW_8H,
|
|
|
|
+-- sum(c.cases_entry_id = 2657) as ZRSCCFW_72H,
|
|
|
|
+-- sum(c.cases_entry_id = 3010) as RYHLJBCW_3D,
|
|
|
|
+-- sum(c.cases_entry_id = 2655) as ZRCFW_2W,
|
|
|
|
+-- sum(c.cases_entry_id = 2654) as ZZCFW_3W,
|
|
|
|
+-- sum(c.cases_entry_id = 2852) as QJJLW_6H,
|
|
|
|
+-- sum(c.cases_entry_id = 2287) as HZJLW_24H,
|
|
|
|
+-- sum(c.cases_entry_id = 3025) as SQTLXJW,
|
|
|
|
+-- sum(c.cases_entry_id = 2170) as SXJLSW_24H,
|
|
|
|
+-- sum(c.cases_entry_id = 2930) as XHSCW_30M,
|
|
|
|
+-- sum(c.cases_entry_id = 2900) as SHZDCFW_24H,
|
|
|
|
+-- sum(c.cases_entry_id = 2229) as SHJBCW_3D,
|
|
|
|
+-- sum(c.cases_entry_id = 2217) as ZKJBCW_3D,
|
|
|
|
+-- sum(c.cases_entry_id = 2218) as ZKJLW_24,
|
|
|
|
+-- sum(c.cases_entry_id = 2220) as BWZHJLBCW_MD,
|
|
|
|
+-- sum(c.cases_entry_id = 2486) as SXHWJL,
|
|
|
|
+-- sum(c.cases_entry_id = 3063) as SXPJW_24,
|
|
|
|
+-- sum(c.cases_entry_id = 3062) as WJZWJL,
|
|
|
|
+-- sum(c.cases_entry_id = 2495) as WYWWCXJ
|
|
|
|
+ FROM
|
|
|
|
+ med_behospital_info a,
|
|
|
|
+ med_qcresult_info b,
|
|
|
|
+ med_qcresult_detail c,
|
|
|
|
+ qc_cases_entry d,
|
|
|
|
+ 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 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 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
|
|
|
|
+ AND a.qc_type_id != 0
|
|
|
|
+ <if test="filterVO.isPlacefile != null and filterVO.isPlacefile != ''">
|
|
|
|
+ and a.is_placefile = #{filterVO.isPlacefile}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="filterVO.hospitalId != null and filterVO.hospitalId != ''">
|
|
|
|
+ AND a.hospital_id = #{filterVO.hospitalId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="filterVO.isPlacefile != null and filterVO.isPlacefile == 0">
|
|
|
|
+ <if test="filterVO.startDate != null ">
|
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{filterVO.startDate}]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="filterVO.endDate != null ">
|
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{filterVO.endDate}]]>
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="filterVO.isPlacefile != null and filterVO.isPlacefile == 1">
|
|
|
|
+ <if test="filterVO.startDate != null ">
|
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{filterVO.startDate}]]>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="filterVO.endDate != null ">
|
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{filterVO.endDate}]]>
|
|
|
|
+ </if>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="filterVO.name != null and filterVO.name != ''">
|
|
|
|
+ AND a.beh_dept_name like CONCAT('%', #{filterVO.name}, '%')
|
|
|
|
+ </if>
|
|
|
|
+ GROUP BY
|
|
|
|
+ a.beh_dept_id,
|
|
|
|
+ e.group_id
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<!-- 未整改病历统计-->
|
|
<!-- 未整改病历统计-->
|
|
<select id="unModifyMRStatistics" resultType="com.diagbot.dto.UnModifyMRDetailDTO" parameterType="com.diagbot.vo.FilterUnModifyMRVO">
|
|
<select id="unModifyMRStatistics" resultType="com.diagbot.dto.UnModifyMRDetailDTO" parameterType="com.diagbot.vo.FilterUnModifyMRVO">
|
|
SELECT
|
|
SELECT
|