Przeglądaj źródła

未整改病历评分详情页导出

zhaops 4 lat temu
rodzic
commit
8f7bae76cf

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -131,6 +131,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/console/export/qcResultShortPageExport").permitAll()
                 .antMatchers("/console/export/leaveHosMrPageExport").permitAll()
                 .antMatchers("/console/export/qcCheckStatisticsExport").permitAll()
+                .antMatchers("/console/export/unModifyMRPageExport").permitAll()
                 .antMatchers("/qc/data/sendDoctorInfos").permitAll()
                 .antMatchers("/qc/data/sendDeptInfos").permitAll()
                 .antMatchers("/qc/data/sendRecordTypes").permitAll()

+ 1 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -174,6 +174,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/console/export/qcResultShortPageExport", request)
                 || matchers("/console/export/leaveHosMrPageExport", request)
                 || matchers("/console/export/qcCheckStatisticsExport", request)
+                || matchers("/console/export/unModifyMRPageExport", request)
                 || matchers("/qc/data/sendDoctorInfos", request)
                 || matchers("/qc/data/sendDeptInfos", request)
                 || matchers("/qc/data/sendRecordTypes", request)

+ 28 - 0
src/main/java/com/diagbot/facade/ConsoleExportFacade.java

@@ -266,4 +266,32 @@ public class ConsoleExportFacade {
         String fileName = "质控核查统计.xls";
         ExcelUtils.exportExcel(records, null, "sheet1", HomePageImproveDTO.class, fileName, response, 12.8f);
     }
+
+    /**
+     * 未整改病历详情页导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public void unModifyMRPageExport(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
+        String hospitalId = SysUserUtils.getCurrentHospitalID();
+        qcResultShortPageVO.setHospitalId(hospitalId);
+        Date startDate = qcResultShortPageVO.getStartDate();
+        Date endDate = qcResultShortPageVO.getEndDate();
+        //时间间隔7天
+        long interval = 7 * 24 * 60 * 60 * 1000;
+        if (endDate.getTime() < startDate.getTime()) {
+            throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
+        }
+        if (endDate.getTime() - startDate.getTime() > interval) {
+            throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
+        }
+
+        qcResultShortPageVO.setCurrent(1L);
+        qcResultShortPageVO.setSize(Long.MAX_VALUE);
+        qcResultShortPageVO.setSearchCount(false);
+        List<ExportExcelDTO> records = behospitalInfoFacade.unModifyMRPageExport(qcResultShortPageVO);
+        String fileName = "未整改病历详情页.xls";
+        ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
+    }
 }

+ 8 - 0
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -345,4 +345,12 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      * @return
      */
     public IPage<QcResultShortDTO> unModifyMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+    /**
+     * 未整改病历缺陷评分详情页导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelDTO> unModifyMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 }

+ 8 - 0
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -338,4 +338,12 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public IPage<QcResultShortDTO> unModifyMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+    /**
+     * 未整改病历缺陷评分详情页导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelDTO> unModifyMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 }

+ 11 - 0
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -460,4 +460,15 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public IPage<QcResultShortDTO> unModifyMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
         return baseMapper.unModifyMRPage(qcResultShortPageVO);
     }
+
+    /**
+     * 未整改病历缺陷评分详情页导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public List<ExportExcelDTO> unModifyMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.unModifyMRPageExport((qcResultShortPageVO));
+    }
 }

+ 21 - 0
src/main/java/com/diagbot/web/ConsoleExportController.java

@@ -260,4 +260,25 @@ public class ConsoleExportController {
     public void qcCheckStatisticsExport(HttpServletResponse response, @RequestBody @Valid FilterOrderVO filterOrderVO) {
         consoleExportFacade.qcCheckStatisticsExport(response, filterOrderVO);
     }
+
+    /**
+     * 未整改病历详情页导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "未整改病历详情页导出[by:zhaops]",
+            notes = "behospitalCode: 病历号<br>" +
+                    "patName: 病人姓名 <br>" +
+                    "behDeptName:科室名称 <br>" +
+                    "doctorId:医生工号 <br>" +
+                    "doctorName:医生姓名 <br>" +
+                    "level: 病历等级 <br>" +
+                    "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>")
+    @PostMapping("/unModifyMRPageExport")
+    @SysLogger("unModifyMRPageExport")
+    public void unModifyMRPageExport(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+        consoleExportFacade.unModifyMRPageExport(response, qcResultShortPageVO);
+    }
 }

+ 325 - 0
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -5276,4 +5276,329 @@
             AND t.checkStatus = #{qcResultShortPageVO.checkStatus}
         </if>
     </select>
+
+    <!-- 未整改病历缺陷评分详情页导出-->
+    <select id="unModifyMRPageExport" resultMap="ExportExcelMap">
+        SELECT
+        f1.behDeptId,
+        f1.behDeptName,
+        f1.behDoctorName,
+        f1.patName,
+        f1.behospitalCode,
+        f1.hospitalId,
+        f1.behospitalDate,
+        f1.leaveHospitalDate,
+        f1.score,
+        f2.avgScore,
+        f1.msg,
+        f1.caseName,
+        f1.checkStatus
+        FROM
+        (SELECT
+        CONCAT( ifnull( t.directorDoctorName, '' ), '\n', t.doctorName ) AS behDoctorName,
+        t.`name` AS patName,
+        t.behospitalCode AS behospitalCode,
+        t.behospitalDate AS behospitalDate,
+        t.leaveHospitalDate AS leaveHospitalDate,
+        qi.score_res AS score,
+        qd.msg AS msg,
+        qc.NAME AS caseName,
+        t.behDeptId,
+        t.behDeptName,
+        t.hospitalId,
+        t.checkStatus
+        FROM
+        (SELECT DISTINCT
+        t1.hospital_id AS hospitalId,
+        t1.behospital_code AS behospitalCode,
+        t1.bed_code AS bedCode,
+        t1.LEVEL AS LEVEL,
+        t1.grade_type AS gradeType,
+        t1.score_res AS scoreRes,
+        t1.NAME AS NAME,
+        t1.sex AS sex,
+        t1.beh_dept_id AS behDeptId,
+        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.placefile_date AS placefileDate,
+        t1.gmt_create AS gradeTime,
+        t1.diagnose,
+        t1.ward_name AS wardName,
+        t2.age,
+        t1.file_code AS fileCode,
+        t1.checkStatus
+        FROM
+        (SELECT
+        be.*,
+        ifnull(mci.status,0) AS checkStatus
+        FROM
+        (
+        SELECT DISTINCT
+        a.hospital_id,
+        a.behospital_code,
+        a.bed_code,
+        a.file_code,
+        b.LEVEL,
+        b.grade_type,
+        b.score_res,
+        a.NAME,
+        a.sex,
+        a.beh_dept_id,
+        a.beh_dept_name,
+        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
+        med_behospital_info a,
+        med_qcresult_info b,
+        med_qcresult_detail c,
+        qc_cases_entry d
+        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_id = d.cases_id
+        AND c.cases_entry_id = d.id
+        AND a.qc_type_id != 0
+        AND a.is_placefile = 1
+        <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
+            AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
+        </if>
+        <if test="qcResultShortPageVO.startDate != null ">
+            <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
+        </if>
+        <if test="qcResultShortPageVO.endDate != null ">
+            <![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
+        </if>
+        <if test="qcResultShortPageVO.behDeptName != null and qcResultShortPageVO.behDeptName != ''">
+            AND a.beh_dept_name = #{qcResultShortPageVO.behDeptName}
+        </if>
+        <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
+            AND b.`level` = #{qcResultShortPageVO.level}
+        </if>
+        <if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
+            AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
+        </if>
+        <if test="qcResultShortPageVO.patName != null and qcResultShortPageVO.patName != ''">
+            AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
+        </if>
+        <if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
+            AND d.NAME = #{qcResultShortPageVO.casesEntryName}
+        </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 ">
+            AND d.id = #{qcResultShortPageVO.casesEntryId}
+        </if>
+        <if test="qcResultShortPageVO.isReject != null">
+            AND c.is_reject = #{qcResultShortPageVO.isReject}
+        </if>
+        <if test="qcResultShortPageVO.ruleType != null">
+            AND d.rule_type = #{qcResultShortPageVO.ruleType}
+        </if>
+        )be
+        left join med_check_info mci
+        on mci.is_deleted = 'N'
+        and be.hospital_id = mci.hospital_id
+        and be.behospital_code = mci.behospital_code
+        ) t1
+        LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
+        AND t1.behospital_code = t2.behospital_code
+        AND t2.is_deleted = 'N'
+        ) t
+        LEFT JOIN med_qcresult_info qi ON qi.is_deleted = 'N'
+        AND t.hospitalId = qi.hospital_id
+        AND t.behospitalCode = qi.behospital_code
+        LEFT JOIN med_qcresult_detail qd ON qd.is_deleted = 'N'
+        AND t.hospitalId = qd.hospital_id
+        AND t.behospitalCode = qd.behospital_code
+        LEFT JOIN qc_cases qc ON qc.is_deleted = 'N'
+        AND qd.cases_id = qc.id
+        where 1=1
+        <if test="qcResultShortPageVO.checkStatus != null">
+            AND t.checkStatus = #{qcResultShortPageVO.checkStatus}
+        </if>
+        )f1,
+        (SELECT
+        ROUND( AVG( qi.score_res ), 2 ) AS avgScore,
+        t.behDeptId,
+        t.behDeptName
+        FROM
+        (SELECT DISTINCT
+        t1.hospital_id AS hospitalId,
+        t1.behospital_code AS behospitalCode,
+        t1.bed_code AS bedCode,
+        t1.LEVEL AS LEVEL,
+        t1.grade_type AS gradeType,
+        t1.score_res AS scoreRes,
+        t1.NAME AS NAME,
+        t1.sex AS sex,
+        t1.beh_dept_id AS behDeptId,
+        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.placefile_date AS placefileDate,
+        t1.gmt_create AS gradeTime,
+        t1.diagnose,
+        t1.ward_name AS wardName,
+        t2.age,
+        t1.file_code AS fileCode,
+        t1.checkStatus
+        FROM
+        (SELECT
+        be.*,
+        ifnull(mci.status,0) AS checkStatus
+        FROM
+        (
+        SELECT DISTINCT
+        a.hospital_id,
+        a.behospital_code,
+        a.bed_code,
+        a.file_code,
+        b.LEVEL,
+        b.grade_type,
+        b.score_res,
+        a.NAME,
+        a.sex,
+        a.beh_dept_id,
+        a.beh_dept_name,
+        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
+        med_behospital_info a,
+        med_qcresult_info b,
+        med_qcresult_detail c,
+        qc_cases_entry d
+        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_id = d.cases_id
+        AND c.cases_entry_id = d.id
+        AND a.qc_type_id != 0
+        AND a.is_placefile = 1
+        <if test="qcResultShortPageVO.hospitalId != null and qcResultShortPageVO.hospitalId != ''">
+            AND a.hospital_id = #{qcResultShortPageVO.hospitalId}
+        </if>
+        <if test="qcResultShortPageVO.startDate != null ">
+            <![CDATA[ AND a.leave_hospital_date >= #{qcResultShortPageVO.startDate}]]>
+        </if>
+        <if test="qcResultShortPageVO.endDate != null ">
+            <![CDATA[ AND a.leave_hospital_date <= #{qcResultShortPageVO.endDate}]]>
+        </if>
+        <if test="qcResultShortPageVO.behDeptName != null and qcResultShortPageVO.behDeptName != ''">
+            AND a.beh_dept_name = #{qcResultShortPageVO.behDeptName}
+        </if>
+        <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
+            AND b.`level` = #{qcResultShortPageVO.level}
+        </if>
+        <if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
+            AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
+        </if>
+        <if test="qcResultShortPageVO.patName != null and qcResultShortPageVO.patName != ''">
+            AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
+        </if>
+        <if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
+            AND d.NAME = #{qcResultShortPageVO.casesEntryName}
+        </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 ">
+            AND d.id = #{qcResultShortPageVO.casesEntryId}
+        </if>
+        <if test="qcResultShortPageVO.isReject != null">
+            AND c.is_reject = #{qcResultShortPageVO.isReject}
+        </if>
+        <if test="qcResultShortPageVO.ruleType != null">
+            AND d.rule_type = #{qcResultShortPageVO.ruleType}
+        </if>
+        )be
+        left join med_check_info mci
+        on mci.is_deleted = 'N'
+        and be.hospital_id = mci.hospital_id
+        and be.behospital_code = mci.behospital_code
+
+        ) t1
+        LEFT JOIN med_home_page t2 ON t1.hospital_id = t2.hospital_id
+        AND t1.behospital_code = t2.behospital_code
+        AND t2.is_deleted = 'N'
+
+        ) t
+        LEFT JOIN med_qcresult_info qi ON qi.is_deleted = 'N'
+        AND t.hospitalId = qi.hospital_id
+        AND t.behospitalCode = qi.behospital_code
+        where 1=1
+        <if test="qcResultShortPageVO.checkStatus != null">
+            AND t.checkStatus = #{qcResultShortPageVO.checkStatus}
+        </if>
+        GROUP BY
+        t.behDeptId,
+        t.behDeptName
+        )f2
+        WHERE
+        f1.behDeptId = f2.behDeptId
+        AND f1.behDeptName = f2.behDeptName
+    </select>
 </mapper>