|
@@ -3264,6 +3264,248 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 时效性报表-首次病程未在患者入院8小时内完成(杭州七院标准版) -->
|
|
|
+ <select id="getUnfinishedFirst_HZQY" parameterType="com.diagbot.vo.QcResultShortPageVO" resultType="com.diagbot.dto.ExportReportDetailaDTO">
|
|
|
+ SELECT DISTINCT
|
|
|
+ a.behospital_code AS hospitalId,
|
|
|
+ a.hospital_id AS behospitalCode,
|
|
|
+ a.`name` AS name,
|
|
|
+ a.sex AS sex,
|
|
|
+ a.file_code AS fileCode,
|
|
|
+ a.doctor_name AS doctorName,
|
|
|
+ a.beh_dept_name AS behDeptName,
|
|
|
+ b.msg AS ruleName,
|
|
|
+ a.behospital_date AS behospitalDate,
|
|
|
+ c.rec_date AS behospitalGmtCreate,
|
|
|
+ a.is_placefile AS isPlacefile
|
|
|
+ FROM
|
|
|
+ med_behospital_info a
|
|
|
+ JOIN med_qcresult_detail b ON a.behospital_code = b.behospital_code
|
|
|
+ JOIN
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ mode_id,
|
|
|
+ rec_title,
|
|
|
+ behospital_code,
|
|
|
+ MIN(rec_date) as rec_date
|
|
|
+ FROM
|
|
|
+ med_medical_record
|
|
|
+ WHERE
|
|
|
+ mode_id = '2'
|
|
|
+ GROUP BY
|
|
|
+ behospital_code
|
|
|
+ )c ON a.behospital_code = c.behospital_code
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND b.cases_entry_id = '3241'
|
|
|
+ AND a.hospital_id = '14'
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 0">
|
|
|
+ <if test="startDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 1">
|
|
|
+ <if test="startDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 时效性报表-入院记录未在患者入院24小时内完成(杭州七院) -->
|
|
|
+ <select id="getUnfinishedIn_HZQY" parameterType="com.diagbot.vo.QcResultShortPageVO" resultType="com.diagbot.dto.ExportReportDetailaDTO">
|
|
|
+ SELECT DISTINCT
|
|
|
+ a.behospital_code AS hospitalId,
|
|
|
+ a.hospital_id AS behospitalCode,
|
|
|
+ a.`name` AS name,
|
|
|
+ a.sex AS sex,
|
|
|
+ a.file_code AS fileCode,
|
|
|
+ a.doctor_name AS doctorName,
|
|
|
+ a.beh_dept_name AS behDeptName,
|
|
|
+ b.msg AS ruleName,
|
|
|
+ a.behospital_date AS behospitalDate,
|
|
|
+ c.rec_date AS behospitalGmtCreate,
|
|
|
+ a.is_placefile AS isPlacefile
|
|
|
+ FROM
|
|
|
+ med_behospital_info a
|
|
|
+ JOIN med_qcresult_detail b ON a.behospital_code = b.behospital_code
|
|
|
+ JOIN
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ mode_id,
|
|
|
+ rec_title,
|
|
|
+ behospital_code,
|
|
|
+ MIN(rec_date) as rec_date
|
|
|
+ FROM
|
|
|
+ med_medical_record
|
|
|
+ WHERE
|
|
|
+ mode_id = '1'
|
|
|
+ GROUP BY
|
|
|
+ behospital_code
|
|
|
+ )c ON a.behospital_code = c.behospital_code
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND b.cases_entry_id = '3242'
|
|
|
+ AND a.hospital_id = '14'
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 0">
|
|
|
+ <if test="startDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 1">
|
|
|
+ <if test="startDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 时效性报表-自杀、冲动、猝死病历入院记录未在患者入院24小时内完成(杭州七院) -->
|
|
|
+ <select id="getUnfinishedSuicide_HZQY" parameterType="com.diagbot.vo.QcResultShortPageVO" resultType="com.diagbot.dto.ExportReportDetailaDTO">
|
|
|
+ SELECT DISTINCT
|
|
|
+ a.behospital_code AS hospitalId,
|
|
|
+ a.hospital_id AS behospitalCode,
|
|
|
+ a.`name` AS name,
|
|
|
+ a.sex AS sex,
|
|
|
+ a.file_code AS fileCode,
|
|
|
+ a.doctor_name AS doctorName,
|
|
|
+ a.beh_dept_name AS behDeptName,
|
|
|
+ b.msg AS ruleName,
|
|
|
+ a.behospital_date AS behospitalDate,
|
|
|
+ c.rec_date AS behospitalGmtCreate,
|
|
|
+ a.is_placefile AS isPlacefile
|
|
|
+ FROM
|
|
|
+ med_behospital_info a
|
|
|
+ JOIN med_qcresult_detail b ON a.behospital_code = b.behospital_code
|
|
|
+ JOIN
|
|
|
+ (
|
|
|
+ SELECT
|
|
|
+ mode_id,
|
|
|
+ rec_title,
|
|
|
+ behospital_code,
|
|
|
+ MIN(rec_date) as rec_date
|
|
|
+ FROM
|
|
|
+ med_medical_record
|
|
|
+ WHERE
|
|
|
+ mode_id = '1'
|
|
|
+ GROUP BY
|
|
|
+ behospital_code
|
|
|
+ )c ON a.behospital_code = c.behospital_code
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND b.cases_entry_id = '3243'
|
|
|
+ AND a.hospital_id = '14'
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 0">
|
|
|
+ <if test="startDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 1">
|
|
|
+ <if test="startDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 时效性报表-时效性报表-超过三天未书写病历(杭州七院) -->
|
|
|
+ <select id="getUnfinishedThree_HZQY" parameterType="com.diagbot.vo.QcResultShortPageVO" resultType="com.diagbot.dto.ExportReportDetailbDTO">
|
|
|
+ SELECT DISTINCT
|
|
|
+ a.behospital_code AS hospitalId,
|
|
|
+ a.hospital_id AS behospitalCode,
|
|
|
+ a.`name` AS name,
|
|
|
+ a.sex AS sex,
|
|
|
+ a.file_code AS fileCode,
|
|
|
+ a.doctor_name AS doctorName,
|
|
|
+ a.beh_dept_name AS behDeptName,
|
|
|
+ b.msg AS ruleName,
|
|
|
+ b.remark AS remark,
|
|
|
+ a.behospital_date AS behospitalDate,
|
|
|
+ a.is_placefile AS isPlacefile
|
|
|
+ FROM
|
|
|
+ med_behospital_info a
|
|
|
+ JOIN med_qcresult_detail b ON a.behospital_code = b.behospital_code
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND b.cases_entry_id = '3240'
|
|
|
+ AND a.hospital_id = '14'
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 0">
|
|
|
+ <if test="startDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 1">
|
|
|
+ <if test="startDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 时效性报表-超过六天未书写病历(杭州七院) -->
|
|
|
+ <select id="getUnfinishedSix_HZQY" parameterType="com.diagbot.vo.QcResultShortPageVO" resultType="com.diagbot.dto.ExportReportDetailbDTO">
|
|
|
+ SELECT DISTINCT
|
|
|
+ a.behospital_code AS hospitalId,
|
|
|
+ a.hospital_id AS behospitalCode,
|
|
|
+ a.`name` AS name,
|
|
|
+ a.sex AS sex,
|
|
|
+ a.file_code AS fileCode,
|
|
|
+ a.doctor_name AS doctorName,
|
|
|
+ a.beh_dept_name AS behDeptName,
|
|
|
+ b.msg AS ruleName,
|
|
|
+ b.remark AS remark,
|
|
|
+ a.behospital_date AS behospitalDate,
|
|
|
+ a.is_placefile AS isPlacefile
|
|
|
+ FROM
|
|
|
+ med_behospital_info a
|
|
|
+ JOIN med_qcresult_detail b ON a.behospital_code = b.behospital_code
|
|
|
+ WHERE
|
|
|
+ a.is_deleted = 'N'
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
+ AND b.cases_entry_id = '3244'
|
|
|
+ AND a.hospital_id = '14'
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 0">
|
|
|
+ <if test="startDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null ">
|
|
|
+ <![CDATA[ AND a.behospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="isPlacefile != null and isPlacefile == 1">
|
|
|
+ <if test="startDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date >= #{startDate}]]>
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null ">
|
|
|
+ <![CDATA[ AND a.leave_hospital_date <= #{endDate}]]>
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 病案首页合格率占比 -全院-->
|
|
|
<select id="homePageLevelStatistics" parameterType="com.diagbot.vo.FilterOrderVO"
|
|
|
resultType="com.diagbot.dto.HomePageNumDTO">
|