|
@@ -0,0 +1,586 @@
|
|
|
+package com.diagbot.facade;
|
|
|
+
|
|
|
+import com.diagbot.dto.*;
|
|
|
+import com.diagbot.util.*;
|
|
|
+import com.diagbot.vo.*;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description: 报表导出装饰层
|
|
|
+ * @author: gaodm
|
|
|
+ * @time: 2020/6/18 10:41
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class ConsoleByDeptExportFacade {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ConsoleByDeptFacade consoleByDeptFacade;
|
|
|
+ @Autowired
|
|
|
+ private BehospitalInfoFacade behospitalInfoFacade;
|
|
|
+ @Autowired
|
|
|
+ private SysHospitalSetFacade sysHospitalSetFacade;
|
|
|
+ @Autowired
|
|
|
+ private FilterFacade filterFacade;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 病案首页合格率占比
|
|
|
+ *
|
|
|
+ * @param filterOrderByDeptVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public void homePageLevelExportByDept(HttpServletResponse response, FilterOrderByDeptVO filterOrderByDeptVO) {
|
|
|
+ List<HomePageByDeptDTO> res = consoleByDeptFacade.homePageLevelStatisticsByDept(filterOrderByDeptVO);
|
|
|
+ String fileName = "病案首页合格率占比.xls";
|
|
|
+ ExcelUtils.exportExcel(res, null, "sheet1", HomePageByDeptDTO.class, fileName, response, 12.8f);
|
|
|
+ }
|
|
|
+/*
|
|
|
+ *//**
|
|
|
+ * 条目缺陷占比(内页)
|
|
|
+ *
|
|
|
+ * @param filterPageVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void entryGroupByEntryExport(HttpServletResponse response, FilterPageVO filterPageVO) {
|
|
|
+ filterPageVO.setCurrent(1L);
|
|
|
+ filterPageVO.setSize(Long.MAX_VALUE);
|
|
|
+ filterPageVO.setSearchCount(false);
|
|
|
+ IPage<EntryNumDTO> page = consoleFacade.entryGroupByEntryInnerPage(filterPageVO);
|
|
|
+ String fileName = "条目缺陷占比.xls";
|
|
|
+ ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", EntryNumDTO.class, fileName, response, 12.8f);
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 稽查统计导出(首页)
|
|
|
+ *
|
|
|
+ * @param filterVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void medicalCheckExport(HttpServletResponse response, FilterMedicalCheckVO filterVO) {
|
|
|
+ filterVO.setCurrent(1L);
|
|
|
+ filterVO.setSize(Long.MAX_VALUE);
|
|
|
+ filterVO.setSearchCount(false);
|
|
|
+ String fileName = null;
|
|
|
+ if ( "1".equals(filterVO.getIsPlacefile())) {
|
|
|
+ fileName = "终末病历稽查表.xls";
|
|
|
+ } else {
|
|
|
+ fileName = "运行病历稽查表.xls";
|
|
|
+ }
|
|
|
+ List<MedicalCheckExportDTO> records = consoleFacade.medicalCheckExport(filterVO);
|
|
|
+ ExcelUtils.exportExcel(records, null, "sheet1", MedicalCheckExportDTO.class, fileName, response, 15.8f);
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 各科室缺陷占比(组合)
|
|
|
+ *
|
|
|
+ * @param filterOrderVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void levelExport(HttpServletResponse response, FilterOrderVO filterOrderVO) {
|
|
|
+ List<LevelStatisticsDTO> records = consoleFacade.levelStatisticsStr(filterOrderVO);
|
|
|
+ String fileName = "各科室缺陷占比.xls";
|
|
|
+ ExcelUtils.exportExcel(records, null, "sheet1", LevelStatisticsDTO.class, fileName, response, 12.8f);
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 各科室缺陷占比(组合)-台州-导出
|
|
|
+ *
|
|
|
+ * @param filterOrderVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void levelExport_TZ(HttpServletResponse response, FilterOrderVO filterOrderVO) {
|
|
|
+ List<LevelStatisticsTZDTO> records = consoleFacade.levelStatisticsByDeptStr_TZ(filterOrderVO);
|
|
|
+ String fileName = "各科室缺陷占比-台州.xls";
|
|
|
+ ExcelUtils.exportExcel(records, null, "sheet1", LevelStatisticsTZDTO.class, fileName, response, 12.8f);
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 按科室统计平均住院天数导出
|
|
|
+ *
|
|
|
+ * @param filterPageByAverageVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void getAverageDayNumExport(HttpServletResponse response, FilterPageByAverageVO filterPageByAverageVO) {
|
|
|
+ filterPageByAverageVO.setCurrent(1L);
|
|
|
+ filterPageByAverageVO.setSize(Long.MAX_VALUE);
|
|
|
+ filterPageByAverageVO.setSearchCount(false);
|
|
|
+ IPage<AverageStatisticsDTO> page = consoleFacade.getAverageDayNumPage(filterPageByAverageVO);
|
|
|
+ String fileName = " 按科室统计平均住院天数.xls";
|
|
|
+
|
|
|
+ if (filterPageByAverageVO.getType() == 2) {
|
|
|
+ ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", AverageStatisticsDTO.class, fileName, response, 12.8f);
|
|
|
+ }
|
|
|
+ if (filterPageByAverageVO.getType() == 1) {
|
|
|
+ List<AverageStatisticsMonthDTO> list = BeanUtil.listCopyTo(page.getRecords(), AverageStatisticsMonthDTO.class);
|
|
|
+ ExcelUtils.exportExcel(list, null, "sheet1", AverageStatisticsMonthDTO.class, fileName, response, 12.8f);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 按科室统计平均住院费用导出
|
|
|
+ *
|
|
|
+ * @param filterPageByAverageVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void getAverageFeeExport(HttpServletResponse response, FilterPageByAverageVO filterPageByAverageVO) {
|
|
|
+ filterPageByAverageVO.setCurrent(1L);
|
|
|
+ filterPageByAverageVO.setSize(Long.MAX_VALUE);
|
|
|
+ filterPageByAverageVO.setSearchCount(false);
|
|
|
+ IPage<AverageStatisticsFeeDTO> page = consoleFacade.getAverageFeePage(filterPageByAverageVO);
|
|
|
+ String fileName = " 按科室统计平均住院费用.xls";
|
|
|
+
|
|
|
+ if (filterPageByAverageVO.getType() == 2) {
|
|
|
+ ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", AverageStatisticsFeeDTO.class, fileName, response, 12.8f);
|
|
|
+ }
|
|
|
+ if (filterPageByAverageVO.getType() == 1) {
|
|
|
+ List<AverageStatisticsFeeMonthDTO> list = BeanUtil.listCopyTo(page.getRecords(), AverageStatisticsFeeMonthDTO.class);
|
|
|
+ ExcelUtils.exportExcel(list, null, "sheet1", AverageStatisticsFeeMonthDTO.class, fileName, response, 12.8f);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 各科室甲级病历占比排行导出
|
|
|
+ *
|
|
|
+ * @param filterPageVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void levelPercentGroupByDeptExport(HttpServletResponse response, FilterPageVO filterPageVO) {
|
|
|
+ filterPageVO.setCurrent(1L);
|
|
|
+ filterPageVO.setSize(Long.MAX_VALUE);
|
|
|
+ filterPageVO.setSearchCount(false);
|
|
|
+ IPage<QcResultPercentDTO> page = consoleFacade.levelPercentGroupByDeptPage(filterPageVO);
|
|
|
+ String fileName = " 各科室甲级病历占比排行.xls";
|
|
|
+ ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", QcResultPercentDTO.class, fileName, response, 12.8f);
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 缺陷详情导出
|
|
|
+ *
|
|
|
+ * @param filterPageVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void entryCountGroupByEntryExport(HttpServletResponse response, FilterPageVO filterPageVO) {
|
|
|
+ filterPageVO.setCurrent(1L);
|
|
|
+ filterPageVO.setSize(Long.MAX_VALUE);
|
|
|
+ filterPageVO.setSearchCount(false);
|
|
|
+ IPage<EntryNumGroupDTO> page = consoleFacade.entryCountGroupByEntryPage(filterPageVO);
|
|
|
+ String fileName = "缺陷详情.xls";
|
|
|
+ ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", EntryNumGroupDTO.class, fileName, response, 12.8f);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 各模块缺陷占比导出
|
|
|
+ *
|
|
|
+ * @param filterPageVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void entryCountGroupByCaseExport(HttpServletResponse response, FilterPageVO filterPageVO) {
|
|
|
+ filterPageVO.setCurrent(1L);
|
|
|
+ filterPageVO.setSize(Long.MAX_VALUE);
|
|
|
+ filterPageVO.setSearchCount(false);
|
|
|
+ IPage<NumDTO> page = consoleFacade.entryCountGroupByCasePage(filterPageVO);
|
|
|
+ String fileName = "缺陷详情.xls";
|
|
|
+ ExcelUtils.exportExcel(page.getRecords(), null, "sheet1", NumDTO.class, fileName, response, 12.8f);
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 关键条目缺陷占比统计
|
|
|
+ *
|
|
|
+ * @param entryStatisticsVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void entryStatisticsExport(HttpServletResponse response, EntryStatisticsVO entryStatisticsVO) {
|
|
|
+ List<EntryStatisticsDTO> records = consoleFacade.entryStatistics(entryStatisticsVO);
|
|
|
+ String fileName = "关键条目缺陷占比统计.xls";
|
|
|
+ ExcelUtils.exportExcel(records, null, "sheet1", EntryStatisticsDTO.class, fileName, response, 12.8f);
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 缺陷详情质控评分页导出
|
|
|
+ *
|
|
|
+ * @param qcResultShortPageVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void qcResultShortPageExport(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ qcResultShortPageVO.setHospitalId(hospitalId);
|
|
|
+ if (StringUtil.isNotBlank(qcResultShortPageVO.getDeptName())
|
|
|
+ && qcResultShortPageVO.getDeptName().equals("全部")) {
|
|
|
+ qcResultShortPageVO.setDeptName("");
|
|
|
+ }
|
|
|
+ Date startDate = qcResultShortPageVO.getStartDate();
|
|
|
+ Date endDate = qcResultShortPageVO.getEndDate();
|
|
|
+ //时间间隔90天
|
|
|
+ long interval = 90l * 24l * 60l * 60l * 1000l;
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
|
|
|
+ }
|
|
|
+
|
|
|
+ qcResultShortPageVO.setCurrent(1L);
|
|
|
+ qcResultShortPageVO.setSize(Long.MAX_VALUE);
|
|
|
+ qcResultShortPageVO.setSearchCount(false);
|
|
|
+ List<ExportExcelDTO> record = behospitalInfoFacade.qcResultShortPageExport(qcResultShortPageVO);
|
|
|
+ String fileName = "缺陷详情质控评分页.xls";
|
|
|
+ ExcelUtils.exportExcelUser(record, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 出院人数统计导出
|
|
|
+ *
|
|
|
+ * @param qcResultShortPageVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void leaveHosMrPageExport(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ qcResultShortPageVO.setHospitalId(hospitalId);
|
|
|
+ if (StringUtil.isNotBlank(qcResultShortPageVO.getDeptName())
|
|
|
+ && qcResultShortPageVO.getDeptName().equals("全部")) {
|
|
|
+ qcResultShortPageVO.setDeptName("");
|
|
|
+ }
|
|
|
+ Date startDate = qcResultShortPageVO.getStartDate();
|
|
|
+ Date endDate = qcResultShortPageVO.getEndDate();
|
|
|
+ //时间间隔7天
|
|
|
+ long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
+ long interval_90 = 90l * 24 * 60 * 60 * 1000;
|
|
|
+
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ //时间间隔7天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //时间间隔90天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_90) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ qcResultShortPageVO.setCurrent(1L);
|
|
|
+ qcResultShortPageVO.setSize(Long.MAX_VALUE);
|
|
|
+ qcResultShortPageVO.setSearchCount(false);
|
|
|
+ List<ExportExcelDTO> records = behospitalInfoFacade.leaveHosMRPageExport(qcResultShortPageVO);
|
|
|
+ List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ resWide = transList(records, resWide);
|
|
|
+ }
|
|
|
+ String fileName = "出院人数统计.xls";
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<ExportWideExcelDTO> transList(List<ExportExcelDTO>res, List<ExportWideExcelDTO>resWide){
|
|
|
+ if(ListUtil.isNotEmpty(res)){
|
|
|
+ res.forEach(exportExcelDTO->{
|
|
|
+ ExportWideExcelDTO exportWideExcelDTO = new ExportWideExcelDTO();
|
|
|
+ exportWideExcelDTO.setAvgScore(exportExcelDTO.getAvgScore());
|
|
|
+ exportWideExcelDTO.setBehDeptName(exportExcelDTO.getBehDeptName());
|
|
|
+ List<ExportExcelBehospitalDTO> excelBehospitalDTOS = exportExcelDTO.getExcelBehospitalDTOS();
|
|
|
+ List<ExportExcelWideBehospitalDTO> exportExcelWideBehospitalDTOs = new ArrayList<>();
|
|
|
+ excelBehospitalDTOS.forEach(exportExcelBehospitalDTO->{
|
|
|
+ ExportExcelWideBehospitalDTO exportExcelWideBehospitalDTO = new ExportExcelWideBehospitalDTO();
|
|
|
+ exportExcelWideBehospitalDTO.setBehDoctorName(exportExcelBehospitalDTO.getBehDoctorName());
|
|
|
+ exportExcelWideBehospitalDTO.setBehospitalCode(exportExcelBehospitalDTO.getBehospitalCode());
|
|
|
+ exportExcelWideBehospitalDTO.setBehospitalDate(exportExcelBehospitalDTO.getBehospitalDate());
|
|
|
+ exportExcelWideBehospitalDTO.setLeaveHospitalDate(exportExcelBehospitalDTO.getLeaveHospitalDate());
|
|
|
+ exportExcelWideBehospitalDTO.setPatName(exportExcelBehospitalDTO.getPatName());
|
|
|
+ exportExcelWideBehospitalDTO.setScore(exportExcelBehospitalDTO.getScore());
|
|
|
+ exportExcelWideBehospitalDTO.setScoreBn(exportExcelBehospitalDTO.getScoreBn());
|
|
|
+ exportExcelWideBehospitalDTOs.add(exportExcelWideBehospitalDTO);
|
|
|
+ });
|
|
|
+ exportWideExcelDTO.setExcelBehospitalDTOS(exportExcelWideBehospitalDTOs);
|
|
|
+ resWide.add(exportWideExcelDTO);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return resWide;
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 质控核查统计导出
|
|
|
+ *
|
|
|
+ * @param filterOrderVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void qcCheckStatisticsExport(HttpServletResponse response, FilterOrderVO filterOrderVO) {
|
|
|
+ List<HomePageImproveDTO> records = consoleFacade.qcCheckStatistics(filterOrderVO);
|
|
|
+ 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);
|
|
|
+ if (StringUtil.isNotBlank(qcResultShortPageVO.getDeptName())
|
|
|
+ && qcResultShortPageVO.getDeptName().equals("全部")) {
|
|
|
+ qcResultShortPageVO.setDeptName("");
|
|
|
+ }
|
|
|
+ Date startDate = qcResultShortPageVO.getStartDate();
|
|
|
+ Date endDate = qcResultShortPageVO.getEndDate();
|
|
|
+ //时间间隔7天
|
|
|
+ long interval = 90l * 24l * 60l * 60l * 1000l;
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
|
|
|
+ }
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 病案首页不合格/合格数
|
|
|
+ *
|
|
|
+ * @param qcResultShortPageVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void badLevelPagePageExport(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ qcResultShortPageVO.setHospitalId(hospitalId);
|
|
|
+ if (StringUtil.isNotBlank(qcResultShortPageVO.getDeptName())
|
|
|
+ && qcResultShortPageVO.getDeptName().equals("全部")) {
|
|
|
+ qcResultShortPageVO.setDeptName("");
|
|
|
+ }
|
|
|
+ Date startDate = qcResultShortPageVO.getStartDate();
|
|
|
+ Date endDate = qcResultShortPageVO.getEndDate();
|
|
|
+ //时间间隔7天
|
|
|
+ long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
+ long interval_90 = 90l * 24 * 60 * 60 * 1000;
|
|
|
+
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ //时间间隔7天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //时间间隔90天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_90) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ qcResultShortPageVO.setCurrent(1L);
|
|
|
+ qcResultShortPageVO.setSize(Long.MAX_VALUE);
|
|
|
+ qcResultShortPageVO.setSearchCount(false);
|
|
|
+ List<ExportExcelDTO> records = behospitalInfoFacade.badLevelPagePageExport(qcResultShortPageVO);
|
|
|
+ List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ resWide = transList(records, resWide);
|
|
|
+ }
|
|
|
+ String fileName = null;
|
|
|
+ if("不合格数".equals(qcResultShortPageVO.getTitleName())){
|
|
|
+ fileName = "病案首页不合格数病历详情页.xls";
|
|
|
+ }else{
|
|
|
+ fileName = "病案首页合格数病历详情页.xls";
|
|
|
+ }
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 未整改病历统计导出
|
|
|
+ *
|
|
|
+ * @param response
|
|
|
+ * @param filterUnModifyMRVO
|
|
|
+ *//*
|
|
|
+ public void unModifyMRStatisticsExport(HttpServletResponse response, FilterUnModifyMRVO filterUnModifyMRVO) {
|
|
|
+ filterFacade.filterUnModifyMRVOSet(filterUnModifyMRVO);
|
|
|
+ List<ExcelExportEntity> colList = Lists.newLinkedList();
|
|
|
+ ExcelExportEntity deptNameCol = new ExcelExportEntity("科室", "deptName");
|
|
|
+ deptNameCol.setWidth(50);
|
|
|
+ colList.add(deptNameCol);
|
|
|
+
|
|
|
+ QueryWrapper<SysHospitalSet> hospitalSetQueryWrapper = new QueryWrapper<>();
|
|
|
+ hospitalSetQueryWrapper.eq("is_deleted", 'N')
|
|
|
+ .eq("hospital_id", filterUnModifyMRVO.getHospitalId())
|
|
|
+ .eq("code", "unmodify_mr_entry");
|
|
|
+ SysHospitalSet hospitalSet = sysHospitalSetFacade.getOne(hospitalSetQueryWrapper);
|
|
|
+ //缺陷条目未维护
|
|
|
+ if (hospitalSet == null || StringUtil.isBlank(hospitalSet.getValue())) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "未整改病历条目未设置");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<String> columnSet = Arrays.asList(hospitalSet.getValue().split(","));
|
|
|
+ for (String valueStr : columnSet) {
|
|
|
+ if (StringUtil.isBlank(valueStr)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String[] keyValue = valueStr.split("--");
|
|
|
+ if (keyValue != null || keyValue.length > 1) {
|
|
|
+ ExcelExportEntity entryCol = new ExcelExportEntity(keyValue[1], "entry_" + keyValue[0] + "_num");
|
|
|
+ entryCol.setWidth(20);
|
|
|
+ colList.add(entryCol);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ UnModifyMRDTO unModifyMRDTO = consoleFacade.unModifyMRStatistics(filterUnModifyMRVO);
|
|
|
+ List<Object> data = Lists.newLinkedList();
|
|
|
+ if (unModifyMRDTO != null && ListUtil.isNotEmpty(unModifyMRDTO.getData())) {
|
|
|
+ data = unModifyMRDTO.getData();
|
|
|
+ }
|
|
|
+ String fileName = "未整改病历统计.xls";
|
|
|
+ ExcelUtils.exportExcelDynamicCol(colList, data, null, "sheet1", fileName, response);
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 31天再入院统计导出
|
|
|
+ *
|
|
|
+ * @param reBeHosPageVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void reHos31DaysPageExport(HttpServletResponse response, ReBeHosPageVO reBeHosPageVO) {
|
|
|
+ reBeHosPageVO.setCurrent(1L);
|
|
|
+ reBeHosPageVO.setSize(Long.MAX_VALUE);
|
|
|
+ reBeHosPageVO.setSearchCount(false);
|
|
|
+ IPage<ReBeHosDTO> page = consoleFacade.reHos31DaysPage(reBeHosPageVO);
|
|
|
+ List<ReBeHosDTO> records = page.getRecords();
|
|
|
+ String fileName = "31天再入院统计详情.xls";
|
|
|
+ ExcelUtils.exportExcel(records, null, "sheet1", ReBeHosDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 病案首页改善率质控评分页导出
|
|
|
+ *
|
|
|
+ * @param qcResultShortPageVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void hmImproveMRPageExport(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ qcResultShortPageVO.setHospitalId(hospitalId);
|
|
|
+ if (StringUtil.isNotBlank(qcResultShortPageVO.getDeptName())
|
|
|
+ && qcResultShortPageVO.getDeptName().equals("全部")) {
|
|
|
+ qcResultShortPageVO.setDeptName("");
|
|
|
+ }
|
|
|
+ Date startDate = qcResultShortPageVO.getStartDate();
|
|
|
+ Date endDate = qcResultShortPageVO.getEndDate();
|
|
|
+ //时间间隔7天
|
|
|
+ long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
+ long interval_90 = 90l * 24 * 60 * 60 * 1000;
|
|
|
+
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ //时间间隔7天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //时间间隔90天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_90) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ qcResultShortPageVO.setCurrent(1L);
|
|
|
+ qcResultShortPageVO.setSize(Long.MAX_VALUE);
|
|
|
+ qcResultShortPageVO.setSearchCount(false);
|
|
|
+ List<ExportExcelDTO> records = behospitalInfoFacade.hmImproveMRPageExport(qcResultShortPageVO);
|
|
|
+ List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ resWide = transList(records, resWide);
|
|
|
+ }
|
|
|
+ String fileName = "病案首页改善率评分病历导出.xls";
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ *//**
|
|
|
+ * 质控核查质控评分页导出
|
|
|
+ *
|
|
|
+ * @param qcResultShortPageVO
|
|
|
+ * @return
|
|
|
+ *//*
|
|
|
+ public void qcCheckMRPageExport(HttpServletResponse response, QcResultShortPageVO qcResultShortPageVO) {
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
+ qcResultShortPageVO.setHospitalId(hospitalId);
|
|
|
+ if (StringUtil.isNotBlank(qcResultShortPageVO.getDeptName())
|
|
|
+ && qcResultShortPageVO.getDeptName().equals("全部")) {
|
|
|
+ qcResultShortPageVO.setDeptName("");
|
|
|
+ }
|
|
|
+ Date startDate = qcResultShortPageVO.getStartDate();
|
|
|
+ Date endDate = qcResultShortPageVO.getEndDate();
|
|
|
+
|
|
|
+ //时间间隔7天
|
|
|
+ long interval_7 = 7 * 24 * 60 * 60 * 1000;
|
|
|
+ long interval_90 = 90l * 24 * 60 * 60 * 1000;
|
|
|
+
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ //时间间隔7天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_7) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于7天");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //时间间隔90天
|
|
|
+ if (endDate.getTime() < startDate.getTime()) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "截止时间不能小于起始时间");
|
|
|
+ }
|
|
|
+ if (endDate.getTime() - startDate.getTime() > interval_90) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_ERROR, "统计区间不能大于90天");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ qcResultShortPageVO.setCurrent(1L);
|
|
|
+ qcResultShortPageVO.setSize(Long.MAX_VALUE);
|
|
|
+ qcResultShortPageVO.setSearchCount(false);
|
|
|
+ List<ExportExcelDTO> records = behospitalInfoFacade.qcCheckMRPageExport(qcResultShortPageVO);
|
|
|
+ List<ExportWideExcelDTO> resWide = new ArrayList<ExportWideExcelDTO>();
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ resWide = transList(records, resWide);
|
|
|
+ }
|
|
|
+ String fileName = "质控核查病历导出.xls";
|
|
|
+ if("1".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(records, null, "sheet1", ExportExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ if("2".equals(qcResultShortPageVO.getRadioCheck())){
|
|
|
+ ExcelUtils.exportExcelUser(resWide, null, "sheet1", ExportWideExcelDTO.class, fileName, response);
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+}
|