chengyao %!s(int64=4) %!d(string=hai) anos
pai
achega
b9c5c299f2

+ 43 - 0
src/main/java/com/diagbot/dto/ReBeHosByDeptDTO.java

@@ -0,0 +1,43 @@
+package com.diagbot.dto;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/7/16 13:43
+ */
+@Getter
+@Setter
+public class ReBeHosByDeptDTO {
+    /**
+     * 病案号
+     */
+    @Excel(name = "病案号", width = 20, needMerge = true, orderNum = "1")
+    private String fileCode;
+    /**
+     * 性别
+     */
+    @Excel(name = "性别", width = 10, needMerge = true, orderNum = "2")
+    private String sex;
+    /**
+     * 主诊断
+     */
+    @Excel(name = "主诊断", width = 50, needMerge = true, orderNum = "3")
+    private String diagnose;
+    /**
+     * 间隔天数
+     */
+    @Excel(name = "间隔天数", width = 10, needMerge = true, orderNum = "4")
+    private Integer diffDays;
+    /**
+     * 比较病历组
+     */
+    @ExcelCollection(name = "", orderNum = "5")
+    private List<ReBeHosDetailByDeptDTO> details;
+}

+ 69 - 0
src/main/java/com/diagbot/dto/ReBeHosDetailByDeptDTO.java

@@ -0,0 +1,69 @@
+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
+ * @time: 2020/7/16 15:17
+ */
+@Getter
+@Setter
+public class ReBeHosDetailByDeptDTO {
+    /**
+     * 病人住院号
+     */
+    @Excel(name = "病人住院号", width = 20, orderNum = "1")
+    private String behospitalCode;
+    /**
+     * 病人姓名
+     */
+    @Excel(name = "病人姓名", width = 20, orderNum = "2")
+    private String name;
+    /**
+     * 病历等级
+     */
+    @Excel(name = "病历等级", width = 10, orderNum = "3")
+    private String level;
+    /**
+     * 病历得分
+     */
+    @Excel(name = "病历得分", width = 10, orderNum = "4")
+    private Double scoreRes;
+    /**
+     * 科室编码
+     */
+    private String behDeptId;
+    /**
+     * 主管医生
+     */
+    @Excel(name = "主管医生", width = 50, orderNum = "5")
+    private String doctorName;
+    /**
+     * 出院日期
+     */
+    @Excel(name = "出院日期", format = "yyyy-MM-dd", width = 30, orderNum = "6")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date leaveHospitalDate;
+    /**
+     * 入院日期
+     */
+    @Excel(name = "入院日期", format = "yyyy-MM-dd", width = 30, orderNum = "7")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date behospitalDate;
+    /**
+     * 住院天数
+     */
+    @Excel(name = "住院天数", width = 15, orderNum = "8")
+    private String behospitalDayNum;
+    /**
+     * 住院费用
+     */
+    @Excel(name = "住院费用", width = 15, orderNum = "9")
+    private String totleFee;
+}

+ 2 - 0
src/main/java/com/diagbot/dto/ReBeHosMergeDTO.java

@@ -18,6 +18,8 @@ public class ReBeHosMergeDTO {
     private String diagnose;
     private String name;
     private String sex;
+    private String doctorName;
+    private String doctorId;
     private String behDeptId;
     private String behDeptName;
     private String behospitalCode;

+ 79 - 168
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -46,7 +46,6 @@ import org.springframework.stereotype.Component;
 
 import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
-import java.math.RoundingMode;
 import java.time.LocalDateTime;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -157,9 +156,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     MedTransferRecordFacade medTransferRecordFacade;
     @Autowired
     MedNurseFacade medNurseFacade;
-    @Autowired
-    SysHospitalSetFacade sysHospitalSetFacade;
-
 
 
     /**
@@ -274,6 +270,48 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         return res;
     }
 
+    /**
+     *  仅获取缺陷总揽提示信息
+     *
+     * @param analyzeRunVO
+     * @return
+     */
+    public List<MsgDTO> getMsgByBehospitalCode(AnalyzeRunVO analyzeRunVO) {
+        // 获取病历信息
+        BehospitalInfo behospitalInfo = this.getOne(new QueryWrapper<BehospitalInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", analyzeRunVO.getHospitalId())
+                .eq("behospital_code", analyzeRunVO.getBehospitalCode()), false
+        );
+        if (null == behospitalInfo) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该病历不存在或已删除!");
+        }
+        // 获取质控条目
+        AnalyzeVO analyzeVO = new AnalyzeVO();
+        BeanUtil.copyProperties(analyzeRunVO, analyzeVO);
+        List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntry(analyzeVO);
+        if (ListUtil.isEmpty(qcCasesEntryDTOList)) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "该病历无关联的质控条目!");
+        }
+
+        List<MsgDTO> msgDTOList = getMsg(analyzeVO);
+            if (ListUtil.isNotEmpty(msgDTOList)) {
+                // 从qc_question_info的cases_entry_ids获取
+                Map<String, Object> paramMap = new HashMap<>();
+                paramMap.put("hospitalId",  analyzeRunVO.getHospitalId());
+                paramMap.put("casesEntryIds", msgDTOList.stream().map(r -> r.getCasesEntryId()).collect(Collectors.toList()));
+                Map<Long, List<QuestionEntryDTO>> quesEntryMap = qcQuestionFacade.getByCaseEntryIdsFac(paramMap);
+                for (MsgDTO msgDTO : msgDTOList) {
+                    if (quesEntryMap.get(msgDTO.getCasesEntryId()) != null) {
+                        msgDTO.setPageKeyList(quesEntryMap.get(msgDTO.getCasesEntryId())
+                                .stream().map(r -> r.getId()).collect(Collectors.toList()));
+                    }
+                }
+            }
+        return msgDTOList;
+    }
+
+
     /**
      * 处理数据(公共方法)
      *
@@ -912,14 +950,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         }
 
         // 病案首页
-        //义乌数据回来还要处理
-        if(analyzeVO.getHospitalId()==5 && ListUtil.isNotEmpty(recMap.get("病案首页"))){
-            addDataWithInnerKey("病案首页", recMap, medrecVoList);
-        }else {
-            if(homePage != null){
+        if (homePage != null) {
             addDataWithFirstPage("病案首页", homePage, medrecVoList, dicMap,
                     homePageList, homeOperationInfoList);
-             }
         }
 
         queryVo.setMedrec(medrecVoList);
@@ -941,6 +974,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         analyzeVO.setHospitalId(hospitalId);
 
         // 处理公共数据
+
             QueryVo  queryVo = dealCommonData(hospitalId, analyzeVO);
         queryVo.setUseCrfCache(analyzeVO.isUseCrfCache());
         //  调用质控接口
@@ -1532,115 +1566,23 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     /**
      * 评分api
      *
-     * @param analyzeRunVO
+     * @param analyzeApiVO
      * @return
      */
-    public Map<String, Object> analyzeApi(AnalyzeRunVO analyzeRunVO) {
-        Map<String, Object> resMapData = new HashMap<>(); // 返回结果
+    public Map<String, Object> analyzeApi(AnalyzeApiVO analyzeApiVO) {
         AnalyzeVO analyzeVO = new AnalyzeVO();
-        BeanUtil.copyProperties(analyzeRunVO, analyzeVO);
-        Long hospitalId = analyzeVO.getHospitalId();
-        // 获取病历信息
-        BehospitalInfo behospitalInfo = this.getOne(new QueryWrapper<BehospitalInfo>()
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", analyzeRunVO.getHospitalId())
-                .eq("behospital_code", analyzeRunVO.getBehospitalCode()), false
-        );
-        if (null == behospitalInfo) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该病历不存在或已删除!");
-        }
-        // 处理公共数据
-        QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
-        //  调用质控接口
-        Response<OutputInfo> response = qcServiceClient.extract(queryVo);
-        if (response == null || response.getData() == null) {
-            if (null == response) {
-                throw new CommonException(CommonErrorCode.RPC_ERROR, "远程质控接口没有返回数据!【" + analyzeVO.getBehospitalCode() + "】");
-            } else {
-                throw new CommonException(CommonErrorCode.RPC_ERROR,
-                        "远程质控接口没有返回数据!【" + analyzeVO.getBehospitalCode() + "】错误原因:" + response.getMsg());
-            }
-        }
-        OutputInfo outputInfo = response.getData();
-        // 质控编码列表
-        List<String> codeList = new ArrayList<>();
-        // code和info的映射map
-        Map<String, String> codeToInfoMap = new LinkedHashMap<>();
-        // 对codeList 和 codeToInfoMap进行赋值
-        setCodeData(outputInfo, codeList, codeToInfoMap);
-        AlgorithmDTO algorithmDTO = new AlgorithmDTO();
-        // 如果是1,说明已是终末质控,不再保存质控结果数据;如果是0,则保存质控结果数据
-        if ("0".equals(analyzeRunVO.getIsPlacefile())) {
-            Map<String, Object> resMap = calScoreAndSave(outputInfo, codeList, codeToInfoMap, analyzeVO, queryVo.getBehospitalInfo().getIsPlacefile());
-            algorithmDTO = (AlgorithmDTO) resMap.get("algorithmDTO");
-        }else{
-            //终末质控不保存数据
-            Map<String, Object> resMap = calScore(outputInfo, codeList, codeToInfoMap, analyzeVO, queryVo.getBehospitalInfo().getIsPlacefile());
-            algorithmDTO = (AlgorithmDTO) resMap.get("algorithmDTO");
-        }
-
-        List<MsgDTO> msgDTOList = getMsg(analyzeVO);
-        if (ListUtil.isNotEmpty(msgDTOList)) {
-            // 从qc_question_info的cases_entry_ids获取
-            Map<String, Object> paramMap = new HashMap<>();
-            paramMap.put("hospitalId",  analyzeRunVO.getHospitalId());
-            paramMap.put("casesEntryIds", msgDTOList.stream().map(r -> r.getCasesEntryId()).collect(Collectors.toList()));
-            Map<Long, List<QuestionEntryDTO>> quesEntryMap = qcQuestionFacade.getByCaseEntryIdsFac(paramMap);
-            for (MsgDTO msgDTO : msgDTOList) {
-                if (quesEntryMap.get(msgDTO.getCasesEntryId()) != null) {
-                    msgDTO.setPageKeyList(quesEntryMap.get(msgDTO.getCasesEntryId())
-                            .stream().map(r -> r.getId()).collect(Collectors.toList()));
-                }
-            }
-        }
-
-        //返回参数组装
-        BigDecimal bigDecimal = new BigDecimal(0);
-        BigDecimal res = new BigDecimal(120);
-        BigDecimal resPr = new BigDecimal(100);
-        String reNum = "0";
-        SysHospitalSet sysHospitalSet
-                = sysHospitalSetFacade.getOne(new QueryWrapper<SysHospitalSet>()
-                        .eq("is_deleted", IsDeleteEnum.N.getKey())
-                        .eq("hospital_id", analyzeRunVO.getHospitalId())
-                , false);
-        if (null != sysHospitalSet && sysHospitalSet.getValue().equals("1")) {
-            //百分制
-            reNum = "1";
-        }
-        QcResultApiDTO qcResultApiDTO = new QcResultApiDTO();
-        if(StringUtils.isNotEmpty(algorithmDTO.getLevel()) && algorithmDTO.getScore()!=null && msgDTOList != null){
-            if("1".equals(reNum)) {
-                bigDecimal = resPr.subtract(algorithmDTO.getScore());
-            }else if("0".equals(reNum)){
-                bigDecimal = res.subtract(algorithmDTO.getScore().multiply(new BigDecimal(120))
-                        .divide(new BigDecimal(100), 1, RoundingMode.HALF_UP));
-            }
-
-        //缺陷总数
-        Long num = msgDTOList
-                .stream()
-                .filter(Objects::nonNull)
-                .count();
-            qcResultApiDTO.setScoreRes(algorithmDTO.getScore());
-            qcResultApiDTO.setLevel(algorithmDTO.getLevel());
-            qcResultApiDTO.setNum(num);
-            qcResultApiDTO.setNumScore(bigDecimal);
-            resMapData.put("result", qcResultApiDTO);
-            List<MsgApiDTO> msgApiDTOList = BeanUtil.listCopyTo(msgDTOList, MsgApiDTO.class);
-            if (analyzeRunVO.getNeedGroup() == 0) {
-                resMapData.put("details", msgApiDTOList);
-            } else {
-                Map<String, List<MsgApiDTO>> msgMap = EntityUtil.makeEntityListMap(msgApiDTOList, "modelName");
-                resMapData.put("details", msgMap);
-            }
-        };
-        return resMapData;
+        BeanUtil.copyProperties(analyzeApiVO, analyzeVO);
+        // 评分
+        analyze(analyzeVO);
+        // 获取结果
+        GetDetailVO getDetailVO = new GetDetailVO();
+        getDetailVO.setHospitalId(analyzeApiVO.getHospitalId());
+        getDetailVO.setBehospitalCode(analyzeApiVO.getBehospitalCode());
+        getDetailVO.setNeedGroup(analyzeApiVO.getNeedGroup());
+        return getByBehospitalCodeApi(getDetailVO);
     }
 
 
-
-
     /**
      * 获取明细api
      *
@@ -1726,62 +1668,31 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @return
      */
     public AnalyzeRunDTO analyzeRun(AnalyzeRunVO analyzeRunVO) {
-        Long modeId = analyzeRunVO.getModeId();
-        analyzeRunVO.setModeId(null);
-        AnalyzeVO analyzeVO = new AnalyzeVO();
-        BeanUtil.copyProperties(analyzeRunVO, analyzeVO);
-        Long hospitalId = analyzeVO.getHospitalId();
-
-        // 处理公共数据
-            QueryVo queryVo = dealCommonData(hospitalId, analyzeVO);
-        //  调用质控接口
-        Response<OutputInfo> response = qcServiceClient.extract(queryVo);
-        if (response == null || response.getData() == null) {
-            if (null == response) {
-                throw new CommonException(CommonErrorCode.RPC_ERROR, "远程质控接口没有返回数据!【" + analyzeVO.getBehospitalCode() + "】");
-            } else {
-                throw new CommonException(CommonErrorCode.RPC_ERROR,
-                        "远程质控接口没有返回数据!【" + analyzeVO.getBehospitalCode() + "】错误原因:" + response.getMsg());
-            }
-        }
-        OutputInfo outputInfo = response.getData();
-        // 质控编码列表
-        List<String> codeList = new ArrayList<>();
-        // code和info的映射map
-        Map<String, String> codeToInfoMap = new LinkedHashMap<>();
-        // 对codeList 和 codeToInfoMap进行赋值
-        setCodeData(outputInfo, codeList, codeToInfoMap);
-
-        // 如果是1,说明已是终末质控,不再保存质控结果数据;如果是0,则保存质控结果数据
-        if ("0".equals(analyzeRunVO.getIsPlacefile())) {
-            // 计算分值并保存结果至数据库
-            Map<String, Object> resMap = calScoreAndSave(outputInfo, codeList, codeToInfoMap, analyzeVO, queryVo.getBehospitalInfo().getIsPlacefile());
-        }
-
-        // 返回缺陷提示信息
-        List<MsgDTO> msgDTOList = new ArrayList<>();
-        if (ListUtil.isNotEmpty(codeList)) {
-            AnalyzeCodeVO analyzeCodeVO = new AnalyzeCodeVO();
-            analyzeCodeVO.setCodeList(codeList);
-            analyzeCodeVO.setHospitalId(hospitalId);
-            analyzeCodeVO.setModeId(modeId);
-            // 获取缺陷条目信息
-            msgDTOList = getMsgByEntryCode(analyzeCodeVO);
-            // 设置info信息
-            if (codeToInfoMap != null && !codeToInfoMap.isEmpty()) {
-                for (MsgDTO msgDTO : msgDTOList) {
-                    String info = codeToInfoMap.get(msgDTO.getCode());
-                    if (StringUtil.isNotBlank(info)) {
-                        msgDTO.setInfo(info);
-                    }
-                }
-            }
-        }
-
+        List<MsgDTO> msgDTOList = this.getMsgByBehospitalCode(analyzeRunVO);
         //返回参数组装
         AnalyzeRunDTO analyzeRunDTO = new AnalyzeRunDTO();
-        // analyzeRunDTO.setScoreRes(algorithmDTO.getScore());
-        // analyzeRunDTO.setLevel(algorithmDTO.getLevel());
+        //缺陷总扣分
+        BigDecimal numScore = msgDTOList
+                .stream()
+                .map(MsgDTO::getScore)
+                .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+        //缺陷总数
+        Long num = msgDTOList
+                .stream()
+                .filter(Objects::nonNull)
+                .count();
+        analyzeRunDTO.setNum(num);
+        analyzeRunDTO.setNumScore(numScore);
+        QcresultInfo qcresultInfo = qcresultInfoFacade.getOne(new QueryWrapper<QcresultInfo>()
+                .eq("behospital_code", analyzeRunVO.getBehospitalCode())
+                .eq("hospital_id", analyzeRunVO.getHospitalId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .select("behospital_code", "level", "score_res"));
+        BigDecimal bigDecimal = new BigDecimal(0);
+        if(null != qcresultInfo){
+            analyzeRunDTO.setLevel(qcresultInfo.getLevel()==null?"":qcresultInfo.getLevel());
+            analyzeRunDTO.setScoreRes(qcresultInfo.getScoreRes() ==null ? bigDecimal : qcresultInfo.getScoreRes());
+        }
         analyzeRunDTO.setMsgDTOList(msgDTOList);
         return analyzeRunDTO;
     }
@@ -1967,7 +1878,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     private void exportQcresultVOSet(ExportQcresultVO exportQcresultVO) {
         //入参验证
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90 * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
         //入院时间
         if (null != exportQcresultVO && null != exportQcresultVO.getBehosDateStart() && null != exportQcresultVO.getBehosDateEnd()) {
             Date startDate = exportQcresultVO.getBehosDateStart();

+ 49 - 1
src/main/java/com/diagbot/facade/ConsoleByDeptExportFacade.java

@@ -288,6 +288,54 @@ public class ConsoleByDeptExportFacade {
     }
 
 
+    /**
+     * 病案首页改善率质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public void improveMRExportByDept(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
+        solveParam(qcResultShortPageVO);
+        qcResultShortPageVO.setCurrent(1L);
+        qcResultShortPageVO.setSize(Long.MAX_VALUE);
+        qcResultShortPageVO.setSearchCount(false);
+        List<ExportExcelByDeptDTO> records = behospitalInfoFacade.improveMRExportByDept(qcResultShortPageVO);
+        List<ExportSevenByDeptDTO> resDTO = new ArrayList<ExportSevenByDeptDTO>();
+        if(ListUtil.isNotEmpty(records)){
+            ExportSevenByDeptDTO exportByDeptDTO = new ExportSevenByDeptDTO();
+            exportByDeptDTO.setBehDeptName(records.get(0).getBehDeptName());
+            exportByDeptDTO.setExportExcelByDeptDTOS(records);
+            resDTO.add(exportByDeptDTO);
+        }
+
+        List<ExportNinetyByDeptDTO> resWide = new ArrayList<ExportNinetyByDeptDTO>();
+        if("2".equals(qcResultShortPageVO.getRadioCheck())){
+            resWide = transList(records, resWide);
+        }
+        String fileName = "病案首页改善率质控评分详情.xls";
+        if("1".equals(qcResultShortPageVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resDTO, null, "sheet1", ExportSevenByDeptDTO.class, fileName, response);
+        }
+        if("2".equals(qcResultShortPageVO.getRadioCheck())){
+            ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportNinetyByDeptDTO.class, fileName, response);
+        }
+    }
+
+    /**
+     * 31天再入院统计导出-科室
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    public void reHos31DaysPageExportByDept(HttpServletResponse response, ReBeHosPageVO reBeHosPageVO) {
+        reBeHosPageVO.setCurrent(1L);
+        reBeHosPageVO.setSize(Long.MAX_VALUE);
+        reBeHosPageVO.setSearchCount(false);
+        IPage<ReBeHosByDeptDTO> page = consoleByDeptFacade.reHos31DaysPageByDept(reBeHosPageVO);
+        List<ReBeHosByDeptDTO> records = page.getRecords();
+        String fileName = "31天再入院统计详情.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", ReBeHosByDeptDTO.class, fileName, response);
+    }
 
 
     public void solveParam(QcResultShortPageVO qcResultShortPageVO){
@@ -297,7 +345,7 @@ public class ConsoleByDeptExportFacade {
        Date endDate = qcResultShortPageVO.getEndDate();
        //时间间隔7天
        long interval_7 = 7 * 24 * 60 * 60 * 1000;
-       long interval_90 = 90 * 24 * 60 * 60 * 1000;
+       long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
        if("1".equals(qcResultShortPageVO.getRadioCheck())){
            //时间间隔7天

+ 53 - 0
src/main/java/com/diagbot/facade/ConsoleByDeptFacade.java

@@ -1,6 +1,7 @@
 package com.diagbot.facade;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.dto.*;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.EntityUtil;
@@ -763,5 +764,57 @@ public class ConsoleByDeptFacade {
         filterFacade.qcResultShortPageVOSet(qcResultShortPageVO);
         return behospitalInfoFacade.qcCheckMRPageByDept(qcResultShortPageVO);
     }
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> hmImproveMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        filterFacade.qcResultShortPageVOSet(qcResultShortPageVO);
+        return behospitalInfoFacade.hmImproveMRPageByDept(qcResultShortPageVO);
+    }
+
+    /**
+     * 31天再入院详情页-科室
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    public IPage<ReBeHosByDeptDTO> reHos31DaysPageByDept(ReBeHosPageVO reBeHosPageVO) {
+        filterFacade.reBeHosPageVOSet(reBeHosPageVO);
+        IPage<ReBeHosMergeDTO> page = behospitalInfoFacade.reHos31DaysPageByDept(reBeHosPageVO);
+        List<ReBeHosMergeDTO> records = page.getRecords();
+        IPage<ReBeHosByDeptDTO> retPage = new Page<>();
+        BeanUtil.copyProperties(page, retPage);
+        List<ReBeHosByDeptDTO> retRecords = Lists.newLinkedList();
+        if (ListUtil.isNotEmpty(records)) {
+            for (ReBeHosMergeDTO record : records) {
+                ReBeHosByDeptDTO retRecord = new ReBeHosByDeptDTO();
+                BeanUtil.copyProperties(record, retRecord);
+                List<ReBeHosDetailByDeptDTO> details = Lists.newLinkedList();
+                ReBeHosDetailByDeptDTO detailRecord = new ReBeHosDetailByDeptDTO();
+                BeanUtil.copyProperties(record, detailRecord);
+                details.add(detailRecord);
+                ReBeHosDetailByDeptDTO lastDetailRecord = new ReBeHosDetailByDeptDTO();
+                lastDetailRecord.setName(record.getName());
+                lastDetailRecord.setBehDeptId(record.getLastBehDeptId());
+                lastDetailRecord.setDoctorName(record.getDoctorName());
+                lastDetailRecord.setBehospitalCode(record.getLastBehospitalCode());
+                lastDetailRecord.setBehospitalDate(record.getLastBehospitalDate());
+                lastDetailRecord.setLeaveHospitalDate(record.getLastLeaveHospitalDate());
+                lastDetailRecord.setLevel(record.getLastLevel());
+                lastDetailRecord.setScoreRes(record.getLastScoreRes());
+                lastDetailRecord.setBehospitalDayNum(record.getLastBehospitalDayNum());
+                lastDetailRecord.setTotleFee(record.getLastTotleFee());
+                details.add(lastDetailRecord);
+                retRecord.setDetails(details);
+                retRecords.add(retRecord);
+            }
+        }
+        retPage.setRecords(retRecords);
+        return retPage;
+    }
+
 
 }

+ 4 - 4
src/main/java/com/diagbot/facade/ConsoleExportFacade.java

@@ -263,7 +263,7 @@ public class ConsoleExportFacade {
         Date endDate = qcResultShortPageVO.getEndDate();
         //时间间隔7天
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90 * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
         if("1".equals(qcResultShortPageVO.getRadioCheck())){
             //时间间隔7天
@@ -387,7 +387,7 @@ public class ConsoleExportFacade {
         Date endDate = qcResultShortPageVO.getEndDate();
         //时间间隔7天
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90 * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
         if("1".equals(qcResultShortPageVO.getRadioCheck())){
             //时间间隔7天
@@ -506,7 +506,7 @@ public class ConsoleExportFacade {
         Date endDate = qcResultShortPageVO.getEndDate();
         //时间间隔7天
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90 * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
         if("1".equals(qcResultShortPageVO.getRadioCheck())){
             //时间间隔7天
@@ -561,7 +561,7 @@ public class ConsoleExportFacade {
 
         //时间间隔7天
         long interval_7 = 7 * 24 * 60 * 60 * 1000;
-        long interval_90 = 90 * 24 * 60 * 60 * 1000;
+        long interval_90 = 90 * 24 * 60 * 60 * 1000l;
 
         if("1".equals(qcResultShortPageVO.getRadioCheck())){
             //时间间隔7天

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

@@ -474,6 +474,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<ReBeHosMergeDTO> reHos31DaysPage(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO);
 
+    /**
+     * 31天再入院详情页-科室
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    public IPage<ReBeHosMergeDTO> reHos31DaysPageByDept(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO);
+
+
     /**
      * 入院人数统计-首页
      *
@@ -499,6 +508,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public IPage<QcResultShortDTO> hmImproveMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> hmImproveMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+
     /**
      * 病案首页改善率质控评分页导出
      *
@@ -531,6 +549,15 @@ public interface BehospitalInfoMapper extends BaseMapper<BehospitalInfo> {
      */
     public List<ExportExcelDTO> qcCheckMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 质控核查质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> improveMRExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
+
     /**
      * 质控核查质控评分页-科室 导出
      *

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

@@ -439,6 +439,14 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public IPage<ReBeHosMergeDTO> reHos31DaysPage(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO);
 
+    /**
+     * 31天再入院详情页
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    public IPage<ReBeHosMergeDTO> reHos31DaysPageByDept(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO);
+
     /**
      * 入院人数统计-首页
      *
@@ -462,6 +470,13 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      * @return
      */
     public IPage<QcResultShortDTO> hmImproveMRPage(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public IPage<QcResultShortDTO> hmImproveMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
     /**
      * 病案首页改善率质控评分页导出
@@ -471,6 +486,14 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<ExportExcelDTO> hmImproveMRPageExport(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
 
+    /**
+     * 病案首页改善率质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    public List<ExportExcelByDeptDTO> improveMRExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO);
+
     /**
      * 质控核查质控评分页(内页)
      *

+ 32 - 1
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -710,6 +710,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
     public IPage<ReBeHosMergeDTO> reHos31DaysPage(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO) {
         return baseMapper.reHos31DaysPage(reBeHosPageVO);
     }
+    /**
+     * 31天再入院详情页-科室
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    @Override
+    public IPage<ReBeHosMergeDTO> reHos31DaysPageByDept(@Param("reBeHosPageVO") ReBeHosPageVO reBeHosPageVO) {
+        return baseMapper.reHos31DaysPageByDept(reBeHosPageVO);
+    }
+
 
     /**
      * 入院人数统计-首页
@@ -744,6 +755,17 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.hmImproveMRPage(qcResultShortPageVO);
     }
 
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public IPage<QcResultShortDTO> hmImproveMRPageByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.hmImproveMRPageByDept(qcResultShortPageVO);
+    }
+
     /**
      * 病案首页改善率质控评分页导出
      *
@@ -755,6 +777,16 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.hmImproveMRPageExport(qcResultShortPageVO);
     }
 
+    /**
+     * 病案首页改善率质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @Override
+    public List<ExportExcelByDeptDTO> improveMRExportByDept(@Param("qcResultShortPageVO") QcResultShortPageVO qcResultShortPageVO) {
+        return baseMapper.improveMRExportByDept(qcResultShortPageVO);
+    }
     /**
      * 质控核查质控评分页(内页)
      *
@@ -788,7 +820,6 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.qcCheckMRPageExport(qcResultShortPageVO);
     }
 
-
     /**
      * 质控核查质控评分页-科室 导出
      *

+ 0 - 2
src/main/java/com/diagbot/vo/AnalyzeRunVO.java

@@ -22,6 +22,4 @@ public class AnalyzeRunVO {
     private Long modeId;
     // 归档字段
     private String isPlacefile = "0";
-
-    private Integer NeedGroup = 0;
 }

+ 2 - 1
src/main/java/com/diagbot/vo/ReBeHosPageVO.java

@@ -20,6 +20,7 @@ public class ReBeHosPageVO extends Page {
     private Long userId;
     @ApiModelProperty(hidden = true)
     private String hospitalId;
+    private String deptName;
     @NotNull(message = "请输入起始时间")
     private Date startDate;
     @NotNull(message = "请输入截止时间")
@@ -36,4 +37,4 @@ public class ReBeHosPageVO extends Page {
      * 是否归档(0:未归档,1:已归档)
      */
     private String isPlacefile = "1";
-}
+}

+ 2 - 2
src/main/java/com/diagbot/web/BehospitalInfoController.java

@@ -122,8 +122,8 @@ public class BehospitalInfoController {
     @SysLogger("analyze_api")
     @Transactional
     //    @ApiIgnore
-    public RespDTO<Map<String, Object> > analyzeApi(@RequestBody AnalyzeRunVO analyzeRunVO) {
-        return RespDTO.onSuc(behospitalInfoFacade.analyzeApi(analyzeRunVO));
+    public RespDTO<Map<String, Object>> analyzeApi(@RequestBody AnalyzeApiVO analyzeApiVO) {
+        return RespDTO.onSuc(behospitalInfoFacade.analyzeApi(analyzeApiVO));
     }
 
 

+ 53 - 4
src/main/java/com/diagbot/web/ConsoleByDeptController.java

@@ -242,7 +242,7 @@ public class ConsoleByDeptController {
                     "casesEntryName: 条目名称 <br>" +
                     "titleName: 标题名称 <br>" +
                     "casesEntryId: 条目id <br>" +
-                    "behDeptName:科室名称 <br>" +
+                    "deptName:科室名称 <br>" +
                     "doctorId:医生工号 <br>" +
                     "doctorName:医生姓名 <br>" +
                     "level: 病历等级 <br>" +
@@ -267,7 +267,7 @@ public class ConsoleByDeptController {
                     "patName: 病人姓名 <br>" +
                     "casesEntryName: 条目名称 <br>" +
                     "casesEntryId: 条目id <br>" +
-                    "behDeptName:科室名称 <br>" +
+                    "deptName:科室名称 <br>" +
                     "doctorName:主治医生名称 <br>" +
                     "level: 病历等级 <br>" +
                     "diagnose: 主诊断 <br>" +
@@ -310,7 +310,7 @@ public class ConsoleByDeptController {
     @ApiOperation(value = "出院人数统计-科室[by:cy]",
             notes = "behospitalCode: 病历号<br>" +
                     "patName: 病人姓名 <br>" +
-                    "behDeptName:科室名称 <br>" +
+                    "deptName:科室名称 <br>" +
                     "doctorId:医生工号 <br>" +
                     "doctorName:医生姓名 <br>" +
                     "level: 病历等级 <br>" +
@@ -360,7 +360,7 @@ public class ConsoleByDeptController {
     @ApiOperation(value = "质控核查质控评分页-科室(内页)[by:cy]",
             notes = "behospitalCode: 病历号<br>" +
                     "patName: 病人姓名 <br>" +
-                    "behDeptName:科室名称 <br>" +
+                    "deptName:科室名称 <br>" +
                     "doctorId:医生工号 <br>" +
                     "doctorName:医生姓名 <br>" +
                     "level: 病历等级 <br>" +
@@ -380,5 +380,54 @@ public class ConsoleByDeptController {
     public RespDTO<IPage<QcResultShortDTO>> qcCheckMRPageByDept(@RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
         return RespDTO.onSuc(consoleByDeptFacade.qcCheckMRPageByDept(qcResultShortPageVO));
     }
+
+    /**
+     * 病案首页改善率质控评分页-科室(内页)
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "病案首页改善率质控评分页(内页)[by:cy]",
+            notes = "behospitalCode: 病历号<br>" +
+                    "patName: 病人姓名 <br>" +
+                    "deptName:科室名称 <br>" +
+                    "doctorId:医生工号 <br>" +
+                    "doctorName:医生姓名 <br>" +
+                    "level: 病历等级 <br>" +
+                    "improveType: 改善标志(1:病案首页改善病历,2:病案首页改善至合格病历,3:病案首页改善至满分病历) <br>" +
+                    "checkStatus: 核查状态(1:已核查,0:未核查) <br>" +
+                    "mrStatus: 首页核查状态(1:已核查,0:未核查) <br>" +
+                    "chName: 病历核查人员 <br>" +
+                    "mrName: 首页核查人员 <br>" +
+                    "chTimeStart: 病历核查起始时间 <br>" +
+                    "chTimeEnd: 病历核查截止时间 <br>" +
+                    "mrTimeStart: 首页核查起始时间 <br>" +
+                    "mrTimeEnd: 首页核查截止时间 <br>" +
+                    "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/hmImproveMRPageByDept")
+    @SysLogger("hmImproveMRPageByDept")
+    public RespDTO<IPage<QcResultShortDTO>> hmImproveMRPageByDept(@RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+        return RespDTO.onSuc(consoleByDeptFacade.hmImproveMRPageByDept(qcResultShortPageVO));
+    }
+
+    /**
+     * 31天再入院人数-科室(内页)
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    @ApiOperation(value = "31天再入院人数-科室(内页)[by:cy]",
+            notes = "name: 病人名称 <br>" +
+                    "fileCode: 病案号 <br>" +
+                    "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/reHos31DaysPageByDept")
+    @SysLogger("reHos31DaysPageByDept")
+    public RespDTO<IPage<ReBeHosDTO>> reHos31DaysPageByDept(@RequestBody @Valid ReBeHosPageVO reBeHosPageVO) {
+        return RespDTO.onSuc(consoleByDeptFacade.reHos31DaysPageByDept(reBeHosPageVO));
+    }
     //endregion -----------------------内页接口结束------------------------------
 }

+ 50 - 0
src/main/java/com/diagbot/web/ConsoleByDeptExportController.java

@@ -281,6 +281,56 @@ public class ConsoleByDeptExportController {
         consoleByDeptExportFacade.qcCheckMRPageExportByDept(response, qcResultShortPageVO);
     }
 
+    /**
+     * 病案首页改善率质控评分页导出-科室
+     *
+     * @param qcResultShortPageVO
+     * @return
+     */
+    @ApiOperation(value = "病案首页改善率质控评分页导出[by:cy]",
+            notes = "behospitalCode: 病历号<br>" +
+                    "patName: 病人姓名 <br>" +
+                    "deptName:科室名称 <br>" +
+                    "doctorId:医生工号 <br>" +
+                    "doctorName:医生姓名 <br>" +
+                    "level: 病历等级 <br>" +
+                    "improveType: 改善标志(1:病案首页改善病历,2:病案首页改善至合格病历,3:病案首页改善至满分病历) <br>" +
+                    "checkStatus: 核查状态(1:已核查,0:未核查) <br>" +
+                    "mrStatus: 首页核查状态(1:已核查,0:未核查) <br>" +
+                    "chName: 病历核查人员 <br>" +
+                    "mrName: 首页核查人员 <br>" +
+                    "chTimeStart: 病历核查起始时间 <br>" +
+                    "chTimeEnd: 病历核查截止时间 <br>" +
+                    "mrTimeStart: 首页核查起始时间 <br>" +
+                    "mrTimeEnd: 首页核查截止时间 <br>" +
+                    "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/improveMRExportByDept")
+    @SysLogger("improveMRExportByDept")
+    public void improveMRExportByDept(HttpServletResponse response, @RequestBody @Valid QcResultShortPageVO qcResultShortPageVO) {
+        consoleByDeptExportFacade.improveMRExportByDept(response, qcResultShortPageVO);
+    }
+
+    /**
+     * 未整改病历统计-科室 导出
+     * 31天再入院统计-科室 导出
+     *
+     * @param reBeHosPageVO
+     * @return
+     */
+    @ApiOperation(value = "31天再入院统计导出-科室 [by:cy]",
+            notes = "name: 病人姓名 <br>" +
+                    "fileCode: 病案号 <br>" +
+                    "startDate: 起始时间 <br>" +
+                    "endDate: 截止时间 <br>" +
+                    "isPlacefile: 是否归档(0:未归档,1:已归档) <br>")
+    @PostMapping("/reHos31DaysPageExportByDept")
+    @SysLogger("reHos31DaysPageExportByDept")
+    public void reHos31DaysPageExportByDept(HttpServletResponse response, @RequestBody @Valid ReBeHosPageVO reBeHosPageVO) {
+        consoleByDeptExportFacade.reHos31DaysPageExportByDept(response, reBeHosPageVO);
+    }
+
 /**
      * 病历稽查统计(首页)
      * @param filterVO

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1391 - 225
src/main/resources/mapper/BehospitalInfoMapper.xml