|
@@ -0,0 +1,118 @@
|
|
|
|
+package com.diagbot.facade;
|
|
|
|
+
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import com.diagbot.entity.BehospitalInfo;
|
|
|
|
+import com.diagbot.entity.QcresultInfo;
|
|
|
|
+import com.diagbot.enums.IsDeleteEnum;
|
|
|
|
+import com.diagbot.util.DateUtil;
|
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
|
+import com.diagbot.util.SysUserUtils;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
+
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @Description:
|
|
|
|
+ * @Author:zhaops
|
|
|
|
+ * @time: 2020/4/13 16:45
|
|
|
|
+ */
|
|
|
|
+@Component
|
|
|
|
+public class ConsoleFacade {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private QcresultInfoFacade qcresultInfoFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ private BehospitalInfoFacade behospitalInfoFacade;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 病历相关统计
|
|
|
|
+ *
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Map<String, Object> mrStatistics() {
|
|
|
|
+ Map<String, Object> retMap = new HashMap<>();
|
|
|
|
+ retMap.put("本月病历数", 0);
|
|
|
|
+ retMap.put("本月质控数-人工", 0);
|
|
|
|
+ retMap.put("本月质控数-机器", 0);
|
|
|
|
+ retMap.put("本月甲级病历-人工", 0);
|
|
|
|
+ retMap.put("本月甲级病历-机器", 0);
|
|
|
|
+ retMap.put("本月乙级病历-人工", 0);
|
|
|
|
+ retMap.put("本月乙级病历-机器", 0);
|
|
|
|
+ retMap.put("本月不合格病历-人工", 0);
|
|
|
|
+ retMap.put("本月不合格病历-机器", 0);
|
|
|
|
+
|
|
|
|
+ String hospitalId = SysUserUtils.getCurrentHospitalID();
|
|
|
|
+
|
|
|
|
+ Date date = new Date();
|
|
|
|
+ String year = DateUtil.getYear(date);
|
|
|
|
+ int month = DateUtil.getMonth(date);
|
|
|
|
+ String startDate = year + "-" + month + "-01";
|
|
|
|
+ QueryWrapper<BehospitalInfo> behospitalInfoQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ behospitalInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("hospital_id", hospitalId)
|
|
|
|
+ .gt("leave_hospital_date", startDate);
|
|
|
|
+ List<BehospitalInfo> behospitalInfoList = behospitalInfoFacade.list(behospitalInfoQueryWrapper);
|
|
|
|
+ if (ListUtil.isNotEmpty(behospitalInfoList)) {
|
|
|
|
+ //本月病历数
|
|
|
|
+ retMap.put("本月病历数", behospitalInfoList.size());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ QueryWrapper<QcresultInfo> qcresultInfoQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ qcresultInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("hospital_id", hospitalId)
|
|
|
|
+ .gt("gmt_create", startDate);
|
|
|
|
+ List<QcresultInfo> qcresultInfoList = qcresultInfoFacade.list(qcresultInfoQueryWrapper);
|
|
|
|
+ if (ListUtil.isNotEmpty(qcresultInfoList)) {
|
|
|
|
+ retMap.put("本月质控数-人工", qcresultInfoList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(i -> i.getGradeType().equals(2))
|
|
|
|
+ .collect(Collectors.toList())
|
|
|
|
+ .size());
|
|
|
|
+ retMap.put("本月质控数-机器", qcresultInfoList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(i -> i.getGradeType().equals(1))
|
|
|
|
+ .collect(Collectors.toList())
|
|
|
|
+ .size());
|
|
|
|
+ retMap.put("本月甲级病历-人工", qcresultInfoList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(i -> i.getGradeType().equals(2) && i.getLevel().equals("甲级"))
|
|
|
|
+ .collect(Collectors.toList())
|
|
|
|
+ .size());
|
|
|
|
+ retMap.put("本月甲级病历-机器", qcresultInfoList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(i -> i.getGradeType().equals(1) && i.getLevel().equals("甲级"))
|
|
|
|
+ .collect(Collectors.toList())
|
|
|
|
+ .size());
|
|
|
|
+ retMap.put("本月乙级病历-人工", qcresultInfoList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(i -> i.getGradeType().equals(2) && i.getLevel().equals("乙级"))
|
|
|
|
+ .collect(Collectors.toList())
|
|
|
|
+ .size());
|
|
|
|
+ retMap.put("本月乙级病历-机器", qcresultInfoList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(i -> i.getGradeType().equals(1) && i.getLevel().equals("乙级"))
|
|
|
|
+ .collect(Collectors.toList())
|
|
|
|
+ .size());
|
|
|
|
+ retMap.put("本月不合格病历-人工", qcresultInfoList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(i -> i.getGradeType().equals(2) && i.getLevel().equals("丙级"))
|
|
|
|
+ .collect(Collectors.toList())
|
|
|
|
+ .size());
|
|
|
|
+ retMap.put("本月不合格病历-机器", qcresultInfoList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(i -> i.getGradeType().equals(1) && i.getLevel().equals("丙级"))
|
|
|
|
+ .collect(Collectors.toList())
|
|
|
|
+ .size());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return retMap;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|