|
@@ -1,13 +1,7 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
-import com.diagbot.dto.DeptBaseDTO;
|
|
|
-import com.diagbot.dto.DeptEntryNumDTO;
|
|
|
-import com.diagbot.dto.DeptNumDTO;
|
|
|
-import com.diagbot.dto.HomePageNumDTO;
|
|
|
-import com.diagbot.dto.LevelStatisticsDTO;
|
|
|
-import com.diagbot.dto.NumDTO;
|
|
|
-import com.diagbot.dto.QcResultShortDTO;
|
|
|
+import com.diagbot.dto.*;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
@@ -69,7 +63,6 @@ public class ConsoleByDeptFacade {
|
|
|
Map<String, NumDTO> deathMap = new HashMap<>();
|
|
|
Map<String, NumDTO> operationMap = new HashMap<>();
|
|
|
//终末--死亡人数/手术病人数
|
|
|
- if("1".equals(filterVO.getIsPlacefile())){
|
|
|
//死亡人数
|
|
|
List<NumDTO> deathNumList = behospitalInfoFacade.deathCountByDept(filterVO);
|
|
|
deathMap = ListUtil.isEmpty(deathNumList)
|
|
@@ -80,36 +73,41 @@ public class ConsoleByDeptFacade {
|
|
|
operationMap = ListUtil.isEmpty(operationNumList)
|
|
|
? new HashMap<>()
|
|
|
: EntityUtil.makeEntityMap(operationNumList, "name");
|
|
|
- }
|
|
|
-
|
|
|
-// //新生儿人数
|
|
|
-// List<NumDTO> newBornNumList = behospitalInfoFacade.newBornCountByDept(filterVO);
|
|
|
-// Map<String, NumDTO> newBornMap = ListUtil.isEmpty(newBornNumList)
|
|
|
-// ? new HashMap<>()
|
|
|
-// : EntityUtil.makeEntityMap(newBornNumList, "name");
|
|
|
|
|
|
for (String deptName : deptMap.keySet()) {
|
|
|
Map<String, Object> map = new LinkedHashMap<>();
|
|
|
map.put("总人数", 0);
|
|
|
+ map.put("死亡人数", 0);
|
|
|
+ map.put("手术病人数", 0);
|
|
|
if (totleMap.containsKey(deptName)) {
|
|
|
map.put("总人数", totleMap.get(deptName).getNum());
|
|
|
}
|
|
|
-
|
|
|
- if("1".equals(filterVO.getIsPlacefile())){
|
|
|
- map.put("死亡人数", 0);
|
|
|
- map.put("手术病人数", 0);
|
|
|
- if(deathMap.containsKey(deptName)) {
|
|
|
- map.put("死亡人数", deathMap.get(deptName).getNum());
|
|
|
- }
|
|
|
- if(operationMap.containsKey(deptName)) {
|
|
|
- map.put("手术病人数", operationMap.get(deptName).getNum());
|
|
|
- }
|
|
|
+ if(deathMap.containsKey(deptName)) {
|
|
|
+ map.put("死亡人数", deathMap.get(deptName).getNum());
|
|
|
+ }
|
|
|
+ if(operationMap.containsKey(deptName)) {
|
|
|
+ map.put("手术病人数", operationMap.get(deptName).getNum());
|
|
|
}
|
|
|
retMap.put(deptName, map);
|
|
|
}
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 入院人数统计-按科室
|
|
|
+ *
|
|
|
+ * @param filterVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, List<AdmissionCountDTO>> admissionHosCountByDept(FilterVO filterVO) {
|
|
|
+ filterFacade.filterVOSet(filterVO);
|
|
|
+ List<AdmissionCountDTO> totleNumList = behospitalInfoFacade.admissionHosCountByDept(filterVO);
|
|
|
+ Map<String, List<AdmissionCountDTO>> resourceData = mapResource(filterVO, totleNumList);
|
|
|
+ return resourceData;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 病历数统计-按科室
|
|
|
*
|
|
@@ -521,25 +519,43 @@ public class ConsoleByDeptFacade {
|
|
|
* @param filterVO
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<NumDTO> casesEntryStatisticsByDept(FilterVO filterVO) {
|
|
|
+ public Map<String, List<AdmissionCountDTO>>casesEntryStatisticsByDept(FilterVO filterVO) {
|
|
|
filterFacade.filterVOSet(filterVO);
|
|
|
- List<NumDTO> records = behospitalInfoFacade.casesEntryStatisticsByDept(filterVO);
|
|
|
-
|
|
|
- if (ListUtil.isNotEmpty(records)) {
|
|
|
- NumDTO globleRecord = new NumDTO();
|
|
|
- globleRecord.setName("全院");
|
|
|
- Integer num = records.stream()
|
|
|
- .map(NumDTO::getNum)
|
|
|
- .reduce(0, Integer::sum);
|
|
|
- globleRecord.setNum(num);
|
|
|
- records.add(0, globleRecord);
|
|
|
- }
|
|
|
+ List<AdmissionCountDTO> totleNumList = behospitalInfoFacade.casesEntryStatisticsByDept(filterVO);
|
|
|
+ Map<String, List<AdmissionCountDTO>> resourceData = mapResource(filterVO, totleNumList);
|
|
|
+ return resourceData;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Map<String, List<AdmissionCountDTO>> mapResource(FilterVO filterVO,List<AdmissionCountDTO>totleNumList){
|
|
|
+ Map<String, Object> deptMap = getDeptByUser(filterVO);
|
|
|
+ Map<String, List<AdmissionCountDTO>> mapSource = new HashMap<>();
|
|
|
+ Map<String, List<AdmissionCountDTO>> returnSource = new HashMap<>();
|
|
|
+ if (deptMap == null) {
|
|
|
+ return mapSource;
|
|
|
+ }
|
|
|
|
|
|
- if (ListUtil.isNotEmpty(records) && records.size() > filterVO.getLimitCount()) {
|
|
|
- records = records.subList(0, 10);
|
|
|
+ if(ListUtil.isNotEmpty(totleNumList)) {
|
|
|
+ mapSource = EntityUtil.makeEntityListMap(totleNumList, "deptName");
|
|
|
+ for (String deptName : deptMap.keySet()) {
|
|
|
+ List<AdmissionCountDTO> admissionCountDTOS = mapSource.get(deptName);
|
|
|
+ if(ListUtil.isNotEmpty(admissionCountDTOS) ){
|
|
|
+// if ( admissionCountDTOS.size()> filterVO.getLimitCount()) {
|
|
|
+// admissionCountDTOS = admissionCountDTOS.subList(0, 10);
|
|
|
+// }
|
|
|
+ AdmissionCountDTO admissionCount = new AdmissionCountDTO();
|
|
|
+ Integer tolCount = admissionCountDTOS.stream()
|
|
|
+ .map(AdmissionCountDTO::getNum)
|
|
|
+ .reduce(0, Integer::sum);
|
|
|
+ admissionCount.setDoctorName(deptName);
|
|
|
+ admissionCount.setNum(tolCount);
|
|
|
+ admissionCountDTOS.add(0, admissionCount);
|
|
|
+ returnSource.put(deptName,admissionCountDTOS);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return returnSource;
|
|
|
}
|
|
|
- return records;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 病案首页合格率占比(首页)
|