Sfoglia il codice sorgente

缺陷详情质控评分页

zhaops 5 anni fa
parent
commit
f4096b569b

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

@@ -124,6 +124,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/console/export/entryCountGroupByEntryExport").permitAll()
                 .antMatchers("/console/export/entryCountGroupByCaseExport").permitAll()
                 .antMatchers("/console/export/entryStatisticsExport").permitAll()
+                .antMatchers("/console/export/qcResultShortPageExport").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

@@ -167,6 +167,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/console/export/entryCountGroupByEntryExport", request)
                 || matchers("/console/export/entryCountGroupByCaseExport", request)
                 || matchers("/console/export/entryStatisticsExport", request)
+                || matchers("/console/export/qcResultShortPageExport", request)
                 || matchers("/qc/data/sendDoctorInfos", request)
                 || matchers("/qc/data/sendDeptInfos", request)
                 || matchers("/qc/data/sendRecordTypes", request)

+ 74 - 6
src/main/java/com/diagbot/dto/QcResultShortDTO.java

@@ -1,8 +1,12 @@
 package com.diagbot.dto;
 
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.Date;
+
 /**
  * @Description:
  * @Author:zhaops
@@ -11,16 +15,80 @@ import lombok.Setter;
 @Getter
 @Setter
 public class QcResultShortDTO {
+    /**
+     * 医院id
+     */
     private String hospitalId;
-    private String behospitalCode;
+
+    /**
+     * 病历等级
+     */
+    @Excel(name = "病历等级", width = 30, orderNum = "1")
     private String level;
+    /**
+     * 病历得分
+     */
+    @Excel(name = "病历得分", width = 30, orderNum = "2")
     private Double scoreRes;
-    private String patName;
+    @Excel(name = "病人住院号", width = 40, orderNum = "3")
+    private String behospitalCode;
+    @Excel(name = "病案号", width = 30, orderNum = "4")
+    private String fileCode;
+    @Excel(name = "病人姓名", width = 30, orderNum = "5")
+    private String name;
+    @Excel(name = "性别", width = 20, orderNum = "6")
     private String sex;
+    @Excel(name = "年龄", width = 20, orderNum = "7")
+    private String age;
+    @Excel(name = "床号", width = 30, orderNum = "8")
+    private String bedCode;
+    @Excel(name = "入院日期", format = "yyyy-MM-dd", width = 30, orderNum = "9")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date behospitalDate;
+    @Excel(name = "出院日期", format = "yyyy-MM-dd", width = 30, orderNum = "10")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date leaveHospitalDate;
+    @Excel(name = "归档日期", format = "yyyy-MM-dd", width = 30, orderNum = "11")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date placefileDate;
+    @Excel(name = "主诊断", width = 60, orderNum = "12")
+    private String diagnose;
+    private String behDoctorId;
+    @Excel(name = "住院医生", width = 30, orderNum = "13")
+    private String behDoctorName;
+    /**
+     * 主治医生id
+     */
+    private String doctorId;
+    /**
+     * 主治医生姓名
+     */
+    @Excel(name = "主治医生", width = 30, orderNum = "14")
+    private String doctorName;
+    private String directorDoctorId;
+    @Excel(name = "主任医生", width = 30, orderNum = "15")
+    private String directorDoctorName;
+    /**
+     * 科室编码
+     */
     private String behDeptId;
+    /**
+     * 科室名称
+     */
+    @Excel(name = "科室", width = 70, orderNum = "16")
     private String behDeptName;
-    private Long doctorId;
-    private String doctorName;
-    private String leaveHospitalDate;
-    private String age;
+    @Excel(name = "评分时间", format = "yyyy-MM-dd", width = 30, orderNum = "17")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date gradeTime;
+
+    /**
+     * 评分类型
+     */
+    private Integer gradeType;
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date birthday;
+    /**
+     * 病区名称
+     */
+    private String wardName;
 }

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

@@ -11,11 +11,13 @@ import com.diagbot.dto.LevelStatisticsDTO;
 import com.diagbot.dto.LevelStatisticsTZDTO;
 import com.diagbot.dto.NumDTO;
 import com.diagbot.dto.QcResultPercentDTO;
+import com.diagbot.dto.QcResultShortDTO;
 import com.diagbot.util.ExcelUtils;
 import com.diagbot.vo.EntryStatisticsVO;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterPageByAverageVO;
 import com.diagbot.vo.FilterPageVO;
+import com.diagbot.vo.QcResultShortPageVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -173,4 +175,19 @@ public class ConsoleExportFacade {
         String fileName = "关键条目缺陷占比统计.xls";
         ExcelUtils.exportExcel(records, null, "sheet1", EntryStatisticsDTO.class, fileName, response, 12.8f);
     }
+
+    /**
+     * 缺陷详情质控评分页导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public void qcResultShortPageExport(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
+        qcResultShortPageVO.setCurrent(1L);
+        qcResultShortPageVO.setSize(Long.MAX_VALUE);
+        qcResultShortPageVO.setSearchCount(false);
+        IPage<QcResultShortDTO> page = consoleFacade.qcResultShortPage(qcResultShortPageVO);
+        String fileName = "缺陷详情质控评分页.xls";
+        ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", QcResultShortDTO.class, fileName, response, 12.8f);
+    }
 }

+ 5 - 1
src/main/java/com/diagbot/vo/QcResultShortPageVO.java

@@ -41,9 +41,13 @@ public class QcResultShortPageVO extends Page {
      */
     private String behDeptName;
     /**
-     * 主治医生名
+     * 医生
      */
     private String doctorName;
+    /**
+     * 医生编号
+     */
+    private String doctorId;
     /**
      * 病历等级
      */

+ 2 - 0
src/main/java/com/diagbot/web/ConsoleController.java

@@ -462,6 +462,8 @@ public class ConsoleController {
                     "casesEntryName: 条目名称 <br>" +
                     "casesEntryId: 条目id <br>" +
                     "behDeptName:科室名称 <br>" +
+                    "doctorId:医生工号 <br>" +
+                    "doctorName:医生姓名 <br>" +
                     "level: 病历等级 <br>" +
                     "isReject: 单项否决 1-否决,0-非<br>" +
                     "ruleType: 规则类型 0:无,1:空项,2:错误<br>" +

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

@@ -6,6 +6,7 @@ import com.diagbot.vo.EntryStatisticsVO;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterPageByAverageVO;
 import com.diagbot.vo.FilterPageVO;
+import com.diagbot.vo.QcResultShortPageVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -195,4 +196,28 @@ public class ConsoleExportController {
         consoleExportFacade.entryStatisticsExport(response, entryStatisticsVO);
     }
 
+    /**
+     * 缺陷详情质控评分页导出
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "缺陷详情质控评分页导出[by:zhaops]",
+            notes = "behospitalCode: 病历号<br>" +
+                    "patName: 病人姓名 <br>" +
+                    "casesEntryName: 条目名称 <br>" +
+                    "casesEntryId: 条目id <br>" +
+                    "behDeptName:科室名称 <br>" +
+                    "doctorId:医生工号 <br>" +
+                    "doctorName:医生姓名 <br>" +
+                    "level: 病历等级 <br>" +
+                    "isReject: 单项否决 1-否决,0-非<br>" +
+                    "ruleType: 规则类型 0:无,1:空项,2:错误<br>" +
+                    "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>")
+    @PostMapping("/qcResultShortPageExport")
+    @SysLogger("qcResultShortPageExport")
+    public void qcResultShortPageExport(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+        consoleExportFacade.qcResultShortPageExport(response, qcResultShortPageVO);
+    }
 }

+ 85 - 9
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -2682,30 +2682,59 @@
         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 patName,
+        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,
-        t2.age
+        t1.placefile_date AS placefileDate,
+        t1.gmt_create AS gradeTime,
+        t1.diagnose,
+        t1.ward_name AS wardName,
+        t2.age,
+        t2.file_code AS fileCode
         FROM
         (
-        SELECT
-        DISTINCT tt1.*
+        SELECT DISTINCT
+        tt1.*
         FROM
         (
         SELECT DISTINCT
         a.hospital_id,
         a.behospital_code,
+        a.bed_code,
         b.LEVEL,
+        b.grade_type,
         b.score_res,
         a.NAME,
         a.sex,
         a.beh_dept_id,
         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
         med_behospital_info a,
         med_qcresult_info b,
@@ -2748,6 +2777,16 @@
         <if test="qcResultShortPageVO.casesEntryName != null and qcResultShortPageVO.casesEntryName != ''">
             AND d.NAME LIKE CONCAT( '%', #{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>
@@ -2798,31 +2837,58 @@
 
     <!-- 条目缺陷质控评分页-科室(内页)-->
     <select id="qcResultShortByDeptPage" resultType="com.diagbot.dto.QcResultShortDTO">
-        SELECT
+        SELECT DISTINCT
         t1.hospital_id AS hospitalId,
         t1.behospital_code AS behospitalCode,
+        t1.bed_code AS bedCode,
         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.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,
-        t2.age
+        t1.placefile_date AS placefileDate,
+        t1.gmt_create AS gradeTime,
+        t1.diagnose,
+        t1.ward_name AS wardName,
+        t2.age,
+        t2.file_code AS fileCode
         FROM
         (
         SELECT DISTINCT
         a.hospital_id,
         a.behospital_code,
+        a.bed_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,
-        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
         med_behospital_info a,
         med_qcresult_info b,
@@ -2863,6 +2929,16 @@
         <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
             AND a.doctor_name = #{qcResultShortPageVO.doctorName}
         </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 != ''">
             AND b.`level` = #{qcResultShortPageVO.level}
         </if>