|
@@ -2682,30 +2682,60 @@
|
|
SELECT DISTINCT
|
|
SELECT DISTINCT
|
|
t1.hospital_id AS hospitalId,
|
|
t1.hospital_id AS hospitalId,
|
|
t1.behospital_code AS behospitalCode,
|
|
t1.behospital_code AS behospitalCode,
|
|
|
|
+ t1.bed_code AS bedCode,
|
|
t1.LEVEL AS LEVEL,
|
|
t1.LEVEL AS LEVEL,
|
|
|
|
+ t1.grade_type AS gradeType,
|
|
t1.score_res AS scoreRes,
|
|
t1.score_res AS scoreRes,
|
|
- t1.NAME AS patName,
|
|
|
|
|
|
+ t1.NAME AS NAME,
|
|
t1.sex AS sex,
|
|
t1.sex AS sex,
|
|
t1.beh_dept_id AS behDeptId,
|
|
t1.beh_dept_id AS behDeptId,
|
|
t1.beh_dept_name AS behDeptName,
|
|
t1.beh_dept_name AS behDeptName,
|
|
|
|
+ t1.doctor_id AS doctorId,
|
|
|
|
+ t1.doctor_name AS doctorName,
|
|
|
|
+ t1.beh_doctor_id AS behDoctorId,
|
|
|
|
+ t1.beh_doctor_name AS behDoctorName,
|
|
|
|
+ t1.director_doctor_id AS directorDoctorId,
|
|
|
|
+ t1.director_doctor_name AS directorDoctorName,
|
|
|
|
+ t1.birthday AS birthday,
|
|
|
|
+ t1.behospital_date AS behospitalDate,
|
|
t1.leave_hospital_date AS leaveHospitalDate,
|
|
t1.leave_hospital_date AS leaveHospitalDate,
|
|
- t2.age
|
|
|
|
|
|
+ t1.placefile_date AS placefileDate,
|
|
|
|
+ t1.gmt_create AS gradeTime,
|
|
|
|
+ t1.diagnose,
|
|
|
|
+ t1.ward_name AS wardName,
|
|
|
|
+ t2.age,
|
|
|
|
+ t1.file_code AS fileCode
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
- SELECT
|
|
|
|
- DISTINCT tt1.*
|
|
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ tt1.*
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
SELECT DISTINCT
|
|
SELECT DISTINCT
|
|
a.hospital_id,
|
|
a.hospital_id,
|
|
a.behospital_code,
|
|
a.behospital_code,
|
|
|
|
+ a.bed_code,
|
|
|
|
+ a.file_code,
|
|
b.LEVEL,
|
|
b.LEVEL,
|
|
|
|
+ b.grade_type,
|
|
b.score_res,
|
|
b.score_res,
|
|
a.NAME,
|
|
a.NAME,
|
|
a.sex,
|
|
a.sex,
|
|
a.beh_dept_id,
|
|
a.beh_dept_id,
|
|
a.beh_dept_name,
|
|
a.beh_dept_name,
|
|
- DATE_FORMAT( a.leave_hospital_date, '%Y-%m-%d' ) AS leave_hospital_date
|
|
|
|
|
|
+ a.birthday,
|
|
|
|
+ a.behospital_date,
|
|
|
|
+ a.leave_hospital_date,
|
|
|
|
+ a.doctor_id,
|
|
|
|
+ a.doctor_name,
|
|
|
|
+ a.beh_doctor_id,
|
|
|
|
+ a.beh_doctor_name,
|
|
|
|
+ a.director_doctor_id,
|
|
|
|
+ a.director_doctor_name,
|
|
|
|
+ a.diagnose,
|
|
|
|
+ a.placefile_date,
|
|
|
|
+ a.ward_name,
|
|
|
|
+ b.gmt_create
|
|
FROM
|
|
FROM
|
|
med_behospital_info a,
|
|
med_behospital_info a,
|
|
med_qcresult_info b,
|
|
med_qcresult_info b,
|
|
@@ -2748,6 +2778,16 @@
|
|
<if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
|
|
<if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
|
|
AND d.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.casesEntryName}, '%' )
|
|
AND d.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.casesEntryName}, '%' )
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
|
|
|
|
+ AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
|
|
|
|
+ OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
|
|
|
|
+ OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
|
|
|
|
+ AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
|
|
|
|
+ OR a.beh_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
|
|
|
|
+ OR a.director_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' ))
|
|
|
|
+ </if>
|
|
<if test="qcResultShortPageVO.casesEntryId != null ">
|
|
<if test="qcResultShortPageVO.casesEntryId != null ">
|
|
AND d.id = #{qcResultShortPageVO.casesEntryId}
|
|
AND d.id = #{qcResultShortPageVO.casesEntryId}
|
|
</if>
|
|
</if>
|
|
@@ -2780,12 +2820,12 @@
|
|
AND tt1.behospital_code = tt2.behospital_code
|
|
AND tt1.behospital_code = tt2.behospital_code
|
|
</if>
|
|
</if>
|
|
) t1
|
|
) t1
|
|
- <if test="qcResultShortPageVO.casesEntryId == null or (qcResultShortPageVO.casesEntryId!=2594 and qcResultShortPageVO.casesEntryId!=2973 and qcResultShortPageVO.casesEntryId!=2166)">
|
|
|
|
|
|
+ <if test="qcResultShortPageVO.casesEntryId == null or (qcResultShortPageVO.casesEntryId!=2594 and qcResultShortPageVO.casesEntryId!=2973 and qcResultShortPageVO.casesEntryId!=2930)">
|
|
LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
|
|
LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
|
|
AND t1.behospital_code = t2.behospital_code
|
|
AND t1.behospital_code = t2.behospital_code
|
|
AND t2.is_deleted = 'N'
|
|
AND t2.is_deleted = 'N'
|
|
</if>
|
|
</if>
|
|
- <if test="qcResultShortPageVO.casesEntryId != null and( qcResultShortPageVO.casesEntryId==2594 or qcResultShortPageVO.casesEntryId==2973 or qcResultShortPageVO.casesEntryId==2166)">
|
|
|
|
|
|
+ <if test="qcResultShortPageVO.casesEntryId != null and( qcResultShortPageVO.casesEntryId==2594 or qcResultShortPageVO.casesEntryId==2973 or qcResultShortPageVO.casesEntryId==2930)">
|
|
, med_home_page t2
|
|
, med_home_page t2
|
|
, med_home_operation_info t3
|
|
, med_home_operation_info t3
|
|
WHERE t1.hospital_id = t2.hospital_id
|
|
WHERE t1.hospital_id = t2.hospital_id
|
|
@@ -2798,31 +2838,59 @@
|
|
|
|
|
|
<!-- 条目缺陷质控评分页-科室(内页)-->
|
|
<!-- 条目缺陷质控评分页-科室(内页)-->
|
|
<select id="qcResultShortByDeptPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
<select id="qcResultShortByDeptPage" resultType="com.diagbot.dto.QcResultShortDTO">
|
|
- SELECT
|
|
|
|
|
|
+ SELECT DISTINCT
|
|
t1.hospital_id AS hospitalId,
|
|
t1.hospital_id AS hospitalId,
|
|
t1.behospital_code AS behospitalCode,
|
|
t1.behospital_code AS behospitalCode,
|
|
|
|
+ t1.bed_code AS bedCode,
|
|
t1.LEVEL AS LEVEL,
|
|
t1.LEVEL AS LEVEL,
|
|
- t1.NAME AS patName,
|
|
|
|
|
|
+ t1.grade_type AS gradeType,
|
|
|
|
+ t1.score_res AS scoreRes,
|
|
|
|
+ t1.NAME AS NAME,
|
|
t1.sex AS sex,
|
|
t1.sex AS sex,
|
|
t1.beh_dept_id AS behDeptId,
|
|
t1.beh_dept_id AS behDeptId,
|
|
t1.beh_dept_name AS behDeptName,
|
|
t1.beh_dept_name AS behDeptName,
|
|
t1.doctor_id AS doctorId,
|
|
t1.doctor_id AS doctorId,
|
|
t1.doctor_name AS doctorName,
|
|
t1.doctor_name AS doctorName,
|
|
|
|
+ t1.beh_doctor_id AS behDoctorId,
|
|
|
|
+ t1.beh_doctor_name AS behDoctorName,
|
|
|
|
+ t1.director_doctor_id AS directorDoctorId,
|
|
|
|
+ t1.director_doctor_name AS directorDoctorName,
|
|
|
|
+ t1.birthday AS birthday,
|
|
|
|
+ t1.behospital_date AS behospitalDate,
|
|
t1.leave_hospital_date AS leaveHospitalDate,
|
|
t1.leave_hospital_date AS leaveHospitalDate,
|
|
- t2.age
|
|
|
|
|
|
+ t1.placefile_date AS placefileDate,
|
|
|
|
+ t1.gmt_create AS gradeTime,
|
|
|
|
+ t1.diagnose,
|
|
|
|
+ t1.ward_name AS wardName,
|
|
|
|
+ t2.age,
|
|
|
|
+ t1.file_code AS fileCode
|
|
FROM
|
|
FROM
|
|
(
|
|
(
|
|
SELECT DISTINCT
|
|
SELECT DISTINCT
|
|
a.hospital_id,
|
|
a.hospital_id,
|
|
a.behospital_code,
|
|
a.behospital_code,
|
|
|
|
+ a.bed_code,
|
|
|
|
+ a.file_code,
|
|
b.LEVEL,
|
|
b.LEVEL,
|
|
|
|
+ b.grade_type,
|
|
|
|
+ b.score_res,
|
|
a.NAME,
|
|
a.NAME,
|
|
a.sex,
|
|
a.sex,
|
|
a.beh_dept_id,
|
|
a.beh_dept_id,
|
|
a.beh_dept_name,
|
|
a.beh_dept_name,
|
|
|
|
+ a.birthday,
|
|
|
|
+ a.behospital_date,
|
|
|
|
+ a.leave_hospital_date,
|
|
a.doctor_id,
|
|
a.doctor_id,
|
|
a.doctor_name,
|
|
a.doctor_name,
|
|
- DATE_FORMAT( a.leave_hospital_date, '%Y-%m-%d' ) AS leave_hospital_date
|
|
|
|
|
|
+ a.beh_doctor_id,
|
|
|
|
+ a.beh_doctor_name,
|
|
|
|
+ a.director_doctor_id,
|
|
|
|
+ a.director_doctor_name,
|
|
|
|
+ a.diagnose,
|
|
|
|
+ a.placefile_date,
|
|
|
|
+ a.ward_name,
|
|
|
|
+ b.gmt_create
|
|
FROM
|
|
FROM
|
|
med_behospital_info a,
|
|
med_behospital_info a,
|
|
med_qcresult_info b,
|
|
med_qcresult_info b,
|
|
@@ -2863,6 +2931,16 @@
|
|
<if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
|
|
<if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
|
|
AND a.doctor_name = #{qcResultShortPageVO.doctorName}
|
|
AND a.doctor_name = #{qcResultShortPageVO.doctorName}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
|
|
|
|
+ AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
|
|
|
|
+ OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
|
|
|
|
+ OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
|
|
|
|
+ </if>
|
|
|
|
+ <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
|
|
|
|
+ AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
|
|
|
|
+ OR a.beh_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
|
|
|
|
+ OR a.director_doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' ))
|
|
|
|
+ </if>
|
|
<if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
<if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
|
|
AND b.`level` = #{qcResultShortPageVO.level}
|
|
AND b.`level` = #{qcResultShortPageVO.level}
|
|
</if>
|
|
</if>
|