|
@@ -1,48 +1,118 @@
|
|
package com.diagbot.facade;
|
|
package com.diagbot.facade;
|
|
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
|
+import java.math.RoundingMode;
|
|
|
|
+import java.text.DateFormat;
|
|
|
|
+import java.text.DecimalFormat;
|
|
|
|
+import java.text.ParseException;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.time.Instant;
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
+import java.time.ZoneId;
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Arrays;
|
|
|
|
+import java.util.Calendar;
|
|
|
|
+import java.util.Collections;
|
|
|
|
+import java.util.Comparator;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.HashSet;
|
|
|
|
+import java.util.Iterator;
|
|
|
|
+import java.util.LinkedHashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.Optional;
|
|
|
|
+import java.util.Set;
|
|
|
|
+import java.util.concurrent.CopyOnWriteArrayList;
|
|
|
|
+import java.util.concurrent.CopyOnWriteArraySet;
|
|
|
|
+import java.util.concurrent.ExecutionException;
|
|
|
|
+import java.util.concurrent.ForkJoinPool;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
+
|
|
|
|
+import javax.validation.Valid;
|
|
|
|
+
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.diagbot.aggregate.AverageStatisticsAggregate;
|
|
import com.diagbot.aggregate.AverageStatisticsAggregate;
|
|
-import com.diagbot.aggregate.LeaveHosStatisticsAggregate;
|
|
|
|
import com.diagbot.aggregate.MrStatisticsAggregate;
|
|
import com.diagbot.aggregate.MrStatisticsAggregate;
|
|
import com.diagbot.aggregate.ResultStatisticsAggregate;
|
|
import com.diagbot.aggregate.ResultStatisticsAggregate;
|
|
-import com.diagbot.dto.*;
|
|
|
|
-import com.diagbot.entity.*;
|
|
|
|
|
|
+import com.diagbot.dto.AverageStatisticsDTO;
|
|
|
|
+import com.diagbot.dto.AverageStatisticsFeeDTO;
|
|
|
|
+import com.diagbot.dto.CaseScoreDTO;
|
|
|
|
+import com.diagbot.dto.ColumnDTO;
|
|
|
|
+import com.diagbot.dto.DeptNumDTO;
|
|
|
|
+import com.diagbot.dto.EntryNumDTO;
|
|
|
|
+import com.diagbot.dto.EntryNumGroupDTO;
|
|
|
|
+import com.diagbot.dto.EntryStatisticsDTO;
|
|
|
|
+import com.diagbot.dto.HomePageImproveDTO;
|
|
|
|
+import com.diagbot.dto.HomePageNumDTO;
|
|
|
|
+import com.diagbot.dto.LevelStatisticsDTO;
|
|
|
|
+import com.diagbot.dto.LevelStatisticsTZDTO;
|
|
|
|
+import com.diagbot.dto.MedManageParamsDTO;
|
|
|
|
+import com.diagbot.dto.MedicalCheckDTO;
|
|
|
|
+import com.diagbot.dto.MedicalCheckExportDTO;
|
|
|
|
+import com.diagbot.dto.NumDTO;
|
|
|
|
+import com.diagbot.dto.QcResultPercentDTO;
|
|
|
|
+import com.diagbot.dto.QcResultShortDTO;
|
|
|
|
+import com.diagbot.dto.QualityControlDTO;
|
|
|
|
+import com.diagbot.dto.QualityControlNullDTO;
|
|
|
|
+import com.diagbot.dto.ReBeHosDTO;
|
|
|
|
+import com.diagbot.dto.ReBeHosDetailDTO;
|
|
|
|
+import com.diagbot.dto.ReBeHosMergeDTO;
|
|
|
|
+import com.diagbot.dto.SjcfStatisticsDTO;
|
|
|
|
+import com.diagbot.dto.UnModifyMRDTO;
|
|
|
|
+import com.diagbot.dto.UnModifyMRDetailDTO;
|
|
|
|
+import com.diagbot.entity.BehospitalInfo;
|
|
|
|
+import com.diagbot.entity.MedIndexRelevance;
|
|
|
|
+import com.diagbot.entity.MedIndexResult;
|
|
|
|
+import com.diagbot.entity.MedManagementInfo;
|
|
|
|
+import com.diagbot.entity.QcCasesEntry;
|
|
|
|
+import com.diagbot.entity.SysHospitalSet;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.QualityContent;
|
|
import com.diagbot.enums.QualityContent;
|
|
import com.diagbot.enums.TimeContent;
|
|
import com.diagbot.enums.TimeContent;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.service.MedManagementInfoService;
|
|
import com.diagbot.service.MedManagementInfoService;
|
|
-import com.diagbot.util.*;
|
|
|
|
-import com.diagbot.vo.*;
|
|
|
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
|
|
+import com.diagbot.util.BigDecimalUtil;
|
|
|
|
+import com.diagbot.util.ClassUtil;
|
|
|
|
+import com.diagbot.util.DateUtil;
|
|
|
|
+import com.diagbot.util.EntityUtil;
|
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
|
+import com.diagbot.util.ObjectUtil;
|
|
|
|
+import com.diagbot.util.StringUtil;
|
|
|
|
+import com.diagbot.util.SysUserUtils;
|
|
|
|
+import com.diagbot.vo.AlgorithmVO;
|
|
|
|
+import com.diagbot.vo.BehospitalPageVO;
|
|
|
|
+import com.diagbot.vo.CaseScoreVO;
|
|
|
|
+import com.diagbot.vo.EntryStatisticsVO;
|
|
|
|
+import com.diagbot.vo.FilterMedicalCheckVO;
|
|
|
|
+import com.diagbot.vo.FilterOrderVO;
|
|
|
|
+import com.diagbot.vo.FilterPageByAverageVO;
|
|
|
|
+import com.diagbot.vo.FilterPageVO;
|
|
|
|
+import com.diagbot.vo.FilterUnModifyMRVO;
|
|
|
|
+import com.diagbot.vo.FilterVO;
|
|
|
|
+import com.diagbot.vo.IndexTimeVO;
|
|
|
|
+import com.diagbot.vo.MedIndexFilterVO;
|
|
|
|
+import com.diagbot.vo.QcResultAlgVO;
|
|
|
|
+import com.diagbot.vo.QcResultPageVO;
|
|
|
|
+import com.diagbot.vo.QcResultShortPageVO;
|
|
|
|
+import com.diagbot.vo.ReBeHosPageVO;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
-import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
-import org.apache.ibatis.annotations.Param;
|
|
|
|
-import org.apache.poi.hssf.record.DVALRecord;
|
|
|
|
-import org.apache.poi.ss.formula.functions.Na;
|
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
|
-import java.math.RoundingMode;
|
|
|
|
-import java.text.DateFormat;
|
|
|
|
-import java.text.DecimalFormat;
|
|
|
|
-import java.text.ParseException;
|
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
-import java.time.*;
|
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
|
-import java.util.*;
|
|
|
|
-import java.util.concurrent.*;
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
-
|
|
|
|
-import static io.netty.util.internal.SystemPropertyUtil.contains;
|
|
|
|
|
|
+import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description:
|
|
* @Description:
|
|
@@ -76,8 +146,6 @@ public class ConsoleFacade {
|
|
@Qualifier("medManagementInfoServiceImpl")
|
|
@Qualifier("medManagementInfoServiceImpl")
|
|
private MedManagementInfoService medManagementInfoService;
|
|
private MedManagementInfoService medManagementInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
- private DoctorAdviceFacade doctorAdviceFacade;
|
|
|
|
- @Autowired
|
|
|
|
private MedIndexResultFacade medIndexResultFacade;
|
|
private MedIndexResultFacade medIndexResultFacade;
|
|
@Autowired
|
|
@Autowired
|
|
private MedIndexRelevanceFacade medIndexRelevanceFacade;
|
|
private MedIndexRelevanceFacade medIndexRelevanceFacade;
|
|
@@ -377,8 +445,7 @@ public class ConsoleFacade {
|
|
try {
|
|
try {
|
|
Map<String, Object> invokeParams = new HashMap<>();
|
|
Map<String, Object> invokeParams = new HashMap<>();
|
|
invokeParams.put("filterVO", filterVO);
|
|
invokeParams.put("filterVO", filterVO);
|
|
- leaveHosMap
|
|
|
|
- = dataBeanAggregateQueryFacade.get("setAllLeaveHos", invokeParams, Map.class);
|
|
|
|
|
|
+ leaveHosMap = dataBeanAggregateQueryFacade.get("setAllLeaveHos", invokeParams, Map.class);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
|
|
}
|
|
}
|
|
@@ -2450,7 +2517,102 @@ public class ConsoleFacade {
|
|
}
|
|
}
|
|
return records;
|
|
return records;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public Object sjcfStatistics(@Valid EntryStatisticsVO entryStatisticsVO) {
|
|
|
|
+ filterFacade.entryStatisticsVOSet(entryStatisticsVO);
|
|
|
|
+ if (entryStatisticsVO.getDeptName().equals("全院")) {
|
|
|
|
+ entryStatisticsVO.setDeptName("");
|
|
|
|
+ }
|
|
|
|
+ List<SjcfStatisticsDTO> records = behospitalInfoFacade.sjcfStatistics(entryStatisticsVO);
|
|
|
|
+ //增加全院数据
|
|
|
|
+ if (entryStatisticsVO.getDeptName().equals("")) {
|
|
|
|
+ SjcfStatisticsDTO record = getSjcfGlobleRecord(records);
|
|
|
|
+ if (record != null) {
|
|
|
|
+ records.add(0, record);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return records;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 关键条目缺陷占比统计增加全院记录
|
|
|
|
+ *
|
|
|
|
+ * @param records
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private SjcfStatisticsDTO getSjcfGlobleRecord(List<SjcfStatisticsDTO> records) {
|
|
|
|
+ DecimalFormat df = new DecimalFormat("#0.00");
|
|
|
|
+ if (ListUtil.isEmpty(records)) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ SjcfStatisticsDTO record = new SjcfStatisticsDTO();
|
|
|
|
+ record.setDeptName("全院");
|
|
|
|
+
|
|
|
|
+ //首次病程未在患者入院8小时内完成
|
|
|
|
+ Integer scbc8xsNum = records.stream().map(SjcfStatisticsDTO::getScbc8xsNum).reduce(0, Integer::sum);
|
|
|
|
+ record.setScbc8xsNum(scbc8xsNum);
|
|
|
|
+ record.setScbc8xsEntryId(records.get(0).getScbc8xsEntryId());
|
|
|
|
+ Integer scbc8xsMRNum = records.stream().map(SjcfStatisticsDTO::getScbc8xsMRNum).reduce(0, Integer::sum);
|
|
|
|
+ record.setScbc8xsMRNum(scbc8xsMRNum);
|
|
|
|
+ if (scbc8xsNum != null && !scbc8xsMRNum.equals(0)) {
|
|
|
|
+ Double scbc8xsPercent = BigDecimal.valueOf(scbc8xsNum).divide(BigDecimal.valueOf(scbc8xsMRNum), 4, RoundingMode.HALF_UP).doubleValue();
|
|
|
|
+ record.setScbc8xsPercent(scbc8xsPercent);
|
|
|
|
+ record.setScbc8xsPercentStr(df.format(BigDecimal.valueOf(scbc8xsPercent).multiply(BigDecimal.valueOf(100))) + "%");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //主治医师首次查房未在患者入院48小时内完成
|
|
|
|
+ Integer zzsccf48xsNum = records.stream().map(SjcfStatisticsDTO::getZzsccf48xsNum).reduce(0, Integer::sum);
|
|
|
|
+ record.setZzsccf48xsNum(zzsccf48xsNum);
|
|
|
|
+ record.setZzsccf48xsEntryId(records.get(0).getZzsccf48xsEntryId());
|
|
|
|
+ Integer zzsccf48xsMRNum = records.stream().map(SjcfStatisticsDTO::getZzsccf48xsMRNum).reduce(0, Integer::sum);
|
|
|
|
+ record.setZzsccf48xsMRNum(zzsccf48xsMRNum);
|
|
|
|
+ if (zzsccf48xsMRNum != null && !zzsccf48xsMRNum.equals(0)) {
|
|
|
|
+ Double zzsccf48xsPercent = BigDecimal.valueOf(zzsccf48xsNum).divide(BigDecimal.valueOf(zzsccf48xsMRNum), 4, RoundingMode.HALF_UP).doubleValue();
|
|
|
|
+ record.setZzsccf48xsPercent(zzsccf48xsPercent);
|
|
|
|
+ record.setZzsccf48xsPercentStr(df.format(BigDecimal.valueOf(zzsccf48xsPercent).multiply(BigDecimal.valueOf(100))) + "%");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //副主任医师/主任医师首次查房未在患者入院72h内完成
|
|
|
|
+ Integer fzzsccf72xsNum = records.stream().map(SjcfStatisticsDTO::getFzzsccf72xsNum).reduce(0, Integer::sum);
|
|
|
|
+ record.setFzzsccf72xsNum(fzzsccf72xsNum);
|
|
|
|
+ record.setFzzsccf72xsEntryId(records.get(0).getFzzsccf72xsEntryId());
|
|
|
|
+ Integer fzzsccf72xsMRNum = records.stream().map(SjcfStatisticsDTO::getFzzsccf72xsMRNum).reduce(0, Integer::sum);
|
|
|
|
+ record.setFzzsccf72xsMRNum(fzzsccf72xsMRNum);
|
|
|
|
+ if (fzzsccf72xsMRNum != null && !fzzsccf72xsMRNum.equals(0)) {
|
|
|
|
+ Double fzzsccf72xsPercent = BigDecimal.valueOf(fzzsccf72xsNum).divide(BigDecimal.valueOf(fzzsccf72xsMRNum), 4, RoundingMode.HALF_UP).doubleValue();
|
|
|
|
+ record.setFzzsccf72xsPercent(fzzsccf72xsPercent);
|
|
|
|
+ record.setFzzsccf72xsPercentStr(df.format(BigDecimal.valueOf(fzzsccf72xsPercent).multiply(BigDecimal.valueOf(100))) + "%");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //每周无2次副主任医师/主任医师查房记录率
|
|
|
|
+ Integer mzf2cNum = records.stream().map(SjcfStatisticsDTO::getMzf2cNum).reduce(0, Integer::sum);
|
|
|
|
+ record.setMzf2cNum(mzf2cNum);
|
|
|
|
+ record.setMzf2cEntryId(records.get(0).getMzf2cEntryId());
|
|
|
|
+ Integer mzf2cMRNum = records.stream().map(SjcfStatisticsDTO::getMzf2cMRNum).reduce(0, Integer::sum);
|
|
|
|
+ record.setMzf2cMRNum(mzf2cMRNum);
|
|
|
|
+ if (mzf2cMRNum != null && !mzf2cMRNum.equals(0)) {
|
|
|
|
+ Double mzf2cPercent = BigDecimal.valueOf(mzf2cNum).divide(BigDecimal.valueOf(mzf2cMRNum), 4, RoundingMode.HALF_UP).doubleValue();
|
|
|
|
+ record.setMzf2cPercent(mzf2cPercent);
|
|
|
|
+ record.setMzf2cPercentStr(df.format(BigDecimal.valueOf(mzf2cPercent).multiply(BigDecimal.valueOf(100))) + "%");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //每周无3次主治医师查房记录率
|
|
|
|
+ Integer mzw3cNum = records.stream().map(SjcfStatisticsDTO::getMzw3cNum).reduce(0, Integer::sum);
|
|
|
|
+ record.setMzw3cNum(mzw3cNum);
|
|
|
|
+ record.setMzw3cEntryId(records.get(0).getMzw3cEntryId());
|
|
|
|
+ Integer mzw3cMRNum = records.stream().map(SjcfStatisticsDTO::getMzw3cMRNum).reduce(0, Integer::sum);
|
|
|
|
+ record.setMzw3cMRNum(mzw3cMRNum);
|
|
|
|
+ if (mzw3cMRNum != null && !mzw3cMRNum.equals(0)) {
|
|
|
|
+ Double mzw3cPercent = BigDecimal.valueOf(mzw3cNum).divide(BigDecimal.valueOf(mzw3cMRNum), 4, RoundingMode.HALF_UP).doubleValue();
|
|
|
|
+ record.setMzw3cPercent(mzw3cPercent);
|
|
|
|
+ record.setMzw3cPercentStr(df.format(BigDecimal.valueOf(mzw3cPercent).multiply(BigDecimal.valueOf(100))) + "%");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return record;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 关键条目缺陷占比统计增加全院记录
|
|
* 关键条目缺陷占比统计增加全院记录
|
|
*
|
|
*
|
|
@@ -3109,7 +3271,7 @@ public class ConsoleFacade {
|
|
|
|
|
|
return str;
|
|
return str;
|
|
}
|
|
}
|
|
- static Set strTranListMethod(String str){
|
|
|
|
|
|
+ static Set<String> strTranListMethod(String str){
|
|
Set<String> names = new HashSet<>();
|
|
Set<String> names = new HashSet<>();
|
|
if(StringUtils.isNotEmpty(str)){
|
|
if(StringUtils.isNotEmpty(str)){
|
|
if(str.contains(",") && str.length()>1){
|
|
if(str.contains(",") && str.length()>1){
|
|
@@ -3621,7 +3783,6 @@ public class ConsoleFacade {
|
|
//指标20 出院患者病历2日归档
|
|
//指标20 出院患者病历2日归档
|
|
private void getfileSecAmounts(FilterVO filterVO,MedIndexResult medIndexResult){
|
|
private void getfileSecAmounts(FilterVO filterVO,MedIndexResult medIndexResult){
|
|
QueryWrapper<BehospitalInfo> query = new QueryWrapper<>();
|
|
QueryWrapper<BehospitalInfo> query = new QueryWrapper<>();
|
|
- DecimalFormat df = new DecimalFormat("#0.00");
|
|
|
|
query.eq("hospital_id", filterVO.getHospitalId())
|
|
query.eq("hospital_id", filterVO.getHospitalId())
|
|
.eq("is_deleted", IsDeleteEnum.N)
|
|
.eq("is_deleted", IsDeleteEnum.N)
|
|
.ne("qc_type_id", 0)
|
|
.ne("qc_type_id", 0)
|
|
@@ -3801,7 +3962,7 @@ public class ConsoleFacade {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
String[] keyValue = valueStr.split("--");
|
|
String[] keyValue = valueStr.split("--");
|
|
- if (keyValue != null || keyValue.length > 1) {
|
|
|
|
|
|
+ if (keyValue != null && keyValue.length > 1) {
|
|
casesEntryIds.add(Long.valueOf(keyValue[0]));
|
|
casesEntryIds.add(Long.valueOf(keyValue[0]));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -3855,7 +4016,7 @@ public class ConsoleFacade {
|
|
orderNo++;
|
|
orderNo++;
|
|
for (String valueStr : columnSet) {
|
|
for (String valueStr : columnSet) {
|
|
String[] keyValue = valueStr.split("--");
|
|
String[] keyValue = valueStr.split("--");
|
|
- if (keyValue != null || keyValue.length > 1) {
|
|
|
|
|
|
+ if (keyValue != null && keyValue.length > 1) {
|
|
ColumnDTO columnNum = new ColumnDTO();
|
|
ColumnDTO columnNum = new ColumnDTO();
|
|
columnNum.setOrderNo(orderNo);
|
|
columnNum.setOrderNo(orderNo);
|
|
columnNum.setId(Long.valueOf(keyValue[0]));
|
|
columnNum.setId(Long.valueOf(keyValue[0]));
|
|
@@ -4174,5 +4335,7 @@ public class ConsoleFacade {
|
|
qualityControlDTO.setOtherCaseScore(score_262 + score_281 + score_282 + score_283 + score_284);
|
|
qualityControlDTO.setOtherCaseScore(score_262 + score_281 + score_282 + score_283 + score_284);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|