|
@@ -221,104 +221,6 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
qcResultDTO.setMenuData("");
|
|
|
}
|
|
|
res.put("result", qcResultDTO);
|
|
|
- //通过页面类型显示不同操作按钮
|
|
|
- showButtonByPageType(hospitalId, getDetailVO, res);
|
|
|
- //添加核查操作是否与申诉状态关联配置
|
|
|
- if (StringUtil.isBlank(sysHospitalSetFacade.getValue(hospitalId, "check_operation_with_appeal"))) {
|
|
|
- res.put("checkOperationWithAppeal", false);
|
|
|
- } else {
|
|
|
- res.put("checkOperationWithAppeal", Boolean.parseBoolean(sysHospitalSetFacade.getValue(hospitalId, "check_operation_with_appeal")));
|
|
|
- }
|
|
|
-// //增加该病历是否核查状态
|
|
|
-// QueryWrapper<MedCheckInfo> medCheckInfoQuerys = new QueryWrapper<>();
|
|
|
-// medCheckInfoQuerys.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
-// medCheckInfoQuerys.eq("behospital_code", getDetailVO.getBehospitalCode());
|
|
|
-// medCheckInfoQuerys.eq("hospital_id", hospitalId);
|
|
|
-// medCheckInfoQuerys.in("check_type", 0, 2);
|
|
|
-// medCheckInfoQuerys.eq("status", 1);
|
|
|
-// int count = medCheckInfoFacade.count(medCheckInfoQuerys);
|
|
|
-// if (count > 0) {
|
|
|
-// res.put("checkStatus", 1);
|
|
|
-// } else {
|
|
|
-// res.put("checkStatus", 0);
|
|
|
-// }
|
|
|
-// //增加该病案首页是否核查状态
|
|
|
-// Map<String, Object> mapAllMr = new HashMap<String, Object>();
|
|
|
-// mapAllMr.put("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
-// mapAllMr.put("behospital_code", getDetailVO.getBehospitalCode());
|
|
|
-// mapAllMr.put("hospital_id", hospitalId);
|
|
|
-// mapAllMr.put("check_type", 1);
|
|
|
-// QueryWrapper<MedCheckInfo> medCheckInfoMr = new QueryWrapper<>();
|
|
|
-// medCheckInfoMr.allEq(mapAllMr);
|
|
|
-// int countMr = medCheckInfoFacade.count(medCheckInfoMr);
|
|
|
-// if (countMr > 0) {
|
|
|
-// res.put("mrStatus", 1);
|
|
|
-// } else {
|
|
|
-// res.put("mrStatus", 0);
|
|
|
-// }
|
|
|
- //新增如果当前用户不是核查人员返回标志位用户核查按钮、修改、删除、隐藏显示
|
|
|
- //1.获取病历核查人员id,该操作只能是核查员操作
|
|
|
-// List<MedCheckInfo> medCheckInfos = medCheckInfoFacade.list(new QueryWrapper<MedCheckInfo>()
|
|
|
-// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
-// .eq("hospital_id", hospitalId)
|
|
|
-// .eq("behospital_code", getDetailVO.getBehospitalCode()));
|
|
|
-// if (medCheckInfos.size() == 1 && medCheckInfos.get(0).getCheckId() != null
|
|
|
-// && medCheckInfos.get(0).getCheckId().equals(Long.parseLong(SysUserUtils.getCurrentPrincipleID()))) {
|
|
|
-// //2.1获取核查类型,判断当前用户有没有对应核查类型的角色
|
|
|
-// int jobType = medCheckInfoFacade.list(new QueryWrapper<MedCheckInfo>()
|
|
|
-// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
-// .eq("behospital_code", getDetailVO.getBehospitalCode())
|
|
|
-// .eq("hospital_id", hospitalId)
|
|
|
-// .eq("check_id", SysUserUtils.getCurrentPrincipleID())).get(0).getJobType();
|
|
|
-// //2.2获取用户角色
|
|
|
-// List<Long> roleIds = sysUserRoleFacade.list(new QueryWrapper<SysUserRole>()
|
|
|
-// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
-// .eq("user_id", SysUserUtils.getCurrentPrincipleID())
|
|
|
-// ).stream().distinct().map(SysUserRole::getRoleId).collect(Collectors.toList());
|
|
|
-// switch (jobType) {
|
|
|
-// case 0:
|
|
|
-// if (roleIds.contains(CheckerRoleEnum.DEPT_GENERAL.getKey() * 1l)) {
|
|
|
-// res.put("checkShow", 1);
|
|
|
-// } else {
|
|
|
-// res.put("checkShow", 0);
|
|
|
-// }
|
|
|
-// break;
|
|
|
-// case 1:
|
|
|
-// if (roleIds.contains(CheckerRoleEnum.QUAT_GENERAL.getKey() * 1l)) {
|
|
|
-// res.put("checkShow", 1);
|
|
|
-// } else {
|
|
|
-// res.put("checkShow", 0);
|
|
|
-// }
|
|
|
-// break;
|
|
|
-// case 2:
|
|
|
-// if (roleIds.contains(CheckerRoleEnum.HOSP_GENERAL.getKey() * 1l)) {
|
|
|
-// res.put("checkShow", 1);
|
|
|
-// } else {
|
|
|
-// res.put("checkShow", 0);
|
|
|
-// }
|
|
|
-// break;
|
|
|
-// default:
|
|
|
-// res.put("checkShow", 0);
|
|
|
-// break;
|
|
|
-// }
|
|
|
-//
|
|
|
-// } else {
|
|
|
-// res.put("checkShow", 0);
|
|
|
-// }
|
|
|
-// //获取用户角色,如果用户包含核查角色显示核查相关按钮(不管病历是否生成、分配,只要有质控角色就显示核查对应按钮)
|
|
|
-// List<Long> roleIds = sysUserRoleFacade.list(new QueryWrapper<SysUserRole>()
|
|
|
-// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
-// .eq("user_id", SysUserUtils.getCurrentPrincipleID())
|
|
|
-// ).stream().distinct().map(SysUserRole::getRoleId).collect(Collectors.toList());
|
|
|
-// if (roleIds.contains(CheckerRoleEnum.DEPT_GENERAL.getKey() * 1l)) {
|
|
|
-// res.put("checkShow", 1);
|
|
|
-// } else if (roleIds.contains(CheckerRoleEnum.QUAT_GENERAL.getKey() * 1l)) {
|
|
|
-// res.put("checkShow", 1);
|
|
|
-// } else if (roleIds.contains(CheckerRoleEnum.HOSP_GENERAL.getKey() * 1l)) {
|
|
|
-// res.put("checkShow", 1);
|
|
|
-// } else {
|
|
|
-// res.put("checkShow", 0);
|
|
|
-// }
|
|
|
}
|
|
|
|
|
|
// 获取提示信息
|
|
@@ -339,132 +241,67 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
msgDTOList = getMsg(analyzeVO);
|
|
|
}
|
|
|
|
|
|
- if (ListUtil.isNotEmpty(msgDTOList)) {
|
|
|
- // 从qc_question_info的cases_entry_ids获取
|
|
|
- Map<String, Object> paramMap = new HashMap<>();
|
|
|
- paramMap.put("hospitalId", hospitalId);
|
|
|
- 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()));
|
|
|
- }
|
|
|
+ List<MsgApiDTO> msgApiDTOList = Lists.newLinkedList();
|
|
|
+ msgApiDTOList = BeanUtil.listCopyTo(msgDTOList, MsgApiDTO.class);
|
|
|
+
|
|
|
+ //缺陷总数
|
|
|
+ Long num = msgApiDTOList
|
|
|
+ .stream()
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .count();
|
|
|
+ res.put("num", num);
|
|
|
+
|
|
|
+ //审核状态
|
|
|
+ res.put("status", Optional.ofNullable(behospitalInfo.getStatus())
|
|
|
+ .map(BehospitalStatusEnum::fromCode)
|
|
|
+ .map(BehospitalStatusEnum::getDesc)
|
|
|
+ .orElse("状态未知")); // 如果 code 为 null,返回默认值
|
|
|
+
|
|
|
+ List<MsgApiDTO> msgApiDTOStatusRejectedList = Lists.newLinkedList(); //驳回
|
|
|
+ List<MsgApiDTO> msgApiDTOStatusUnreviewedList = Lists.newLinkedList(); //未审核
|
|
|
+ List<MsgApiDTO> msgApiDTOStatusAlreadyPassedList = Lists.newLinkedList(); //通过
|
|
|
+ if ("3".equals(behospitalInfo.getStatus())) { //已驳回
|
|
|
+ List<MedRejectedInfo> medRejectedInfos = medRejectedInfoFacade.list(new QueryWrapper<MedRejectedInfo>()
|
|
|
+ .eq("hospital_id", hospitalId)
|
|
|
+ .eq("behospital_code", behospitalInfo.getBehospitalCode())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .select("cases_entry_id", "rejected_reason")
|
|
|
+ .orderByDesc("gmt_create"));
|
|
|
+ if (ListUtil.isNotEmpty(medRejectedInfos)) {
|
|
|
+ msgApiDTOList.forEach(msgApiDTO -> {
|
|
|
+ for (MedRejectedInfo medRejectedInfo : medRejectedInfos) {
|
|
|
+ MsgApiDTO msgApiDTOStatus = new MsgApiDTO();
|
|
|
+ if (msgApiDTO.getCasesEntryId().equals(medRejectedInfo.getCasesEntryId())) {
|
|
|
+ msgApiDTO.setIsRejectedEntry("1"); //驳回条目
|
|
|
+ msgApiDTO.setRejectedReason(medRejectedInfo.getRejectedReason());
|
|
|
+ msgApiDTOStatus.setMsg(msgApiDTO.getMsg());
|
|
|
+ msgApiDTOStatus.setRuleType(msgApiDTO.getRuleType());
|
|
|
+ msgApiDTOStatus.setScore(msgApiDTO.getScore());
|
|
|
+ msgApiDTOStatusRejectedList.add(msgApiDTOStatus);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- }
|
|
|
- // 根据模块分组
|
|
|
- Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
|
|
|
- res.put("msg", msgMap);
|
|
|
-
|
|
|
- // 添加DRGS分组
|
|
|
- List<MsgDTO> msgDTOListDrgs = msgDTOList.stream().filter(r -> r.getDrgs().equals(1)).collect(Collectors.toList());
|
|
|
- Map<String, List<MsgDTO>> drgsMap = EntityUtil.makeEntityListMap(msgDTOListDrgs, "modelName");
|
|
|
- res.put("drgs", drgsMap);
|
|
|
- }
|
|
|
-
|
|
|
- return res;
|
|
|
- }
|
|
|
|
|
|
- private void showButtonByPageType(Long hospitalId, GetDetailVO getDetailVO, Map<String, Object> res) {
|
|
|
- // switch (getDetailVO.getPageType()){
|
|
|
- // case "1":
|
|
|
- // break;
|
|
|
- // case "2":
|
|
|
- // checkButtonShow(hospitalId,getDetailVO,res);
|
|
|
- // break;
|
|
|
- // case "3":
|
|
|
- // appealButtonShow(hospitalId,getDetailVO,res);
|
|
|
- // break;
|
|
|
- // default:
|
|
|
- // break;
|
|
|
- // }
|
|
|
- checkButtonShow(hospitalId, getDetailVO, res);
|
|
|
- appealButtonShow(hospitalId, getDetailVO, res);
|
|
|
- }
|
|
|
-
|
|
|
- private void checkButtonShow(Long hospitalId, GetDetailVO getDetailVO, Map<String, Object> res) {
|
|
|
- //增加该病历是否核查状态
|
|
|
- QueryWrapper<MedExamineInfo> medCheckInfoQuerys = new QueryWrapper<>();
|
|
|
- medCheckInfoQuerys.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
- medCheckInfoQuerys.eq("behospital_code", getDetailVO.getBehospitalCode());
|
|
|
- medCheckInfoQuerys.eq("hospital_id", hospitalId);
|
|
|
- medCheckInfoQuerys.in("check_type", 0, 2);
|
|
|
- medCheckInfoQuerys.eq("status", 1);
|
|
|
- int count = medCheckInfoFacade.count(medCheckInfoQuerys);
|
|
|
- if (count > 0) {
|
|
|
- res.put("checkStatus", 1);
|
|
|
- } else {
|
|
|
- res.put("checkStatus", 0);
|
|
|
- }
|
|
|
- //增加该病案首页是否核查状态
|
|
|
- Map<String, Object> mapAllMr = new HashMap<String, Object>();
|
|
|
- mapAllMr.put("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
- mapAllMr.put("behospital_code", getDetailVO.getBehospitalCode());
|
|
|
- mapAllMr.put("hospital_id", hospitalId);
|
|
|
- mapAllMr.put("check_type", 1);
|
|
|
- QueryWrapper<MedExamineInfo> medCheckInfoMr = new QueryWrapper<>();
|
|
|
- medCheckInfoMr.allEq(mapAllMr);
|
|
|
- int countMr = medCheckInfoFacade.count(medCheckInfoMr);
|
|
|
- if (countMr > 0) {
|
|
|
- res.put("mrStatus", 1);
|
|
|
- } else {
|
|
|
- res.put("mrStatus", 0);
|
|
|
- }
|
|
|
- //新增如果当前用户不是核查人员返回标志位用户核查按钮、修改、删除、隐藏显示
|
|
|
- //1.获取病历核查人员id,该操作只能是核查员操作
|
|
|
- List<MedExamineInfo> medCheckInfos = medCheckInfoFacade.list(new QueryWrapper<MedExamineInfo>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("hospital_id", hospitalId)
|
|
|
- .eq("behospital_code", getDetailVO.getBehospitalCode())
|
|
|
- .orderByDesc("gmt_create"));
|
|
|
- if (medCheckInfos.size() >= 1 && medCheckInfos.get(0).getCheckId() != null
|
|
|
- && medCheckInfos.get(0).getCheckId().equals(Long.parseLong(SysUserUtils.getCurrentPrincipleID()))) {
|
|
|
- //2.1获取核查类型,判断当前用户有没有对应核查类型的角色
|
|
|
-// int jobType = medCheckInfoFacade.list(new QueryWrapper<MedExamineInfo>()
|
|
|
-// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
-// .eq("behospital_code", getDetailVO.getBehospitalCode())
|
|
|
-// .eq("hospital_id", hospitalId)
|
|
|
-// .eq("check_id", SysUserUtils.getCurrentPrincipleID())).get(0).getJobType();
|
|
|
- //2.2获取用户角色
|
|
|
- List<Long> roleIds = sysUserRoleFacade.list(new QueryWrapper<SysUserRole>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("user_id", SysUserUtils.getCurrentPrincipleID())
|
|
|
- ).stream().distinct().map(SysUserRole::getRoleId).collect(Collectors.toList());
|
|
|
-// switch (jobType) {
|
|
|
- switch (0) {
|
|
|
- case 0:
|
|
|
- if (roleIds.contains(CheckerRoleEnum.DEPT_GENERAL.getKey() * 1l)) {
|
|
|
- res.put("checkShow", 1);
|
|
|
- } else {
|
|
|
- res.put("checkShow", 0);
|
|
|
- }
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- if (roleIds.contains(CheckerRoleEnum.QUAT_GENERAL.getKey() * 1l)) {
|
|
|
- res.put("checkShow", 1);
|
|
|
- } else {
|
|
|
- res.put("checkShow", 0);
|
|
|
- }
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- if (roleIds.contains(CheckerRoleEnum.HOSP_GENERAL.getKey() * 1l)) {
|
|
|
- res.put("checkShow", 1);
|
|
|
- } else {
|
|
|
- res.put("checkShow", 0);
|
|
|
- }
|
|
|
- break;
|
|
|
- default:
|
|
|
- res.put("checkShow", 0);
|
|
|
- break;
|
|
|
+ } else if ("1".equals(behospitalInfo.getStatus())) { // 未审核
|
|
|
+ msgApiDTOStatusUnreviewedList = BeanUtil.listCopyTo(msgApiDTOList, MsgApiDTO.class);
|
|
|
+ } else if ("2".equals(behospitalInfo.getStatus())) { // 已通过
|
|
|
+ msgApiDTOStatusAlreadyPassedList = BeanUtil.listCopyTo(msgApiDTOList, MsgApiDTO.class);
|
|
|
}
|
|
|
|
|
|
- } else {
|
|
|
- res.put("checkShow", 0);
|
|
|
+ res.put("Rejected", msgApiDTOStatusRejectedList);
|
|
|
+ res.put("unreviewed", msgApiDTOStatusUnreviewedList);
|
|
|
+ res.put("alreadyPassed", msgApiDTOStatusAlreadyPassedList);
|
|
|
+
|
|
|
+ Map<String, List<MsgApiDTO>> newMsgMap = msgApiDTOList.stream()
|
|
|
+ .collect(Collectors.groupingBy(
|
|
|
+ dto -> RuleTypeEnum.fromRawValue(dto.getRuleType()).getName(),
|
|
|
+ Collectors.toList()
|
|
|
+ ));
|
|
|
+ res.put("msg", newMsgMap);
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- private void appealButtonShow(Long hospitalId, GetDetailVO getDetailVO, Map<String, Object> res) {
|
|
|
- res.put("appealShow", 1);
|
|
|
+ return res;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1912,8 +1749,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
.orderByDesc("gmt_create"));
|
|
|
if (ListUtil.isNotEmpty(medRejectedInfos)) {
|
|
|
msgApiDTOList.forEach(msgApiDTO -> {
|
|
|
- for(MedRejectedInfo medRejectedInfo : medRejectedInfos){
|
|
|
- if(msgApiDTO.getCasesEntryId().equals(medRejectedInfo.getCasesEntryId())){
|
|
|
+ for (MedRejectedInfo medRejectedInfo : medRejectedInfos) {
|
|
|
+ if (msgApiDTO.getCasesEntryId().equals(medRejectedInfo.getCasesEntryId())) {
|
|
|
msgApiDTO.setIsRejectedEntry("1"); //驳回条目
|
|
|
msgApiDTO.setRejectedReason(medRejectedInfo.getRejectedReason());
|
|
|
}
|
|
@@ -2042,15 +1879,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
behospitalPageVO.setHospitalId(Long.parseLong(SysUserUtils.getCurrentHospitalID()));
|
|
|
-// behospitalPageVO.setIsPlacefile("1");
|
|
|
-// if (null != behospitalPageVO.getStatisticsType()
|
|
|
-// && null == behospitalPageVO.getLeaveHosDateStart()
|
|
|
-// && null == behospitalPageVO.getLeaveHosDateEnd()) {
|
|
|
-// String startDate = filterFacade.getStartDateStr(behospitalPageVO.getStatisticsType(), null);
|
|
|
-// String endDate = filterFacade.getEndDateStr(behospitalPageVO.getStatisticsType(), null);
|
|
|
-// behospitalPageVO.setLeaveHosDateStart(DateUtil.parseDate(startDate));
|
|
|
-// behospitalPageVO.setLeaveHosDateEnd(DateUtil.parseDate(endDate));
|
|
|
-// }
|
|
|
+ // 状态
|
|
|
+ if (StringUtil.isNotBlank(behospitalPageVO.getStatus()) && "0".equals(behospitalPageVO.getStatus())) {
|
|
|
+ behospitalPageVO.setStatus("");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void exportExcelFac(HttpServletResponse response) {
|