|
@@ -1,22 +1,63 @@
|
|
package com.lantone.report.facade;
|
|
package com.lantone.report.facade;
|
|
|
|
+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.lantone.common.dto.report.BehosDTO;
|
|
import com.lantone.common.dto.report.BehospitalInfoDTO;
|
|
import com.lantone.common.dto.report.BehospitalInfoDTO;
|
|
|
|
+import com.lantone.common.dto.report.CheckInfoDTO;
|
|
|
|
+import com.lantone.common.dto.report.DoctorAdviceDTO;
|
|
|
|
+import com.lantone.common.dto.report.ExamineInfoDTO;
|
|
|
|
+import com.lantone.common.dto.report.ExamineSonInfoDTO;
|
|
import com.lantone.common.dto.report.ExportExcelBehospitalDTO;
|
|
import com.lantone.common.dto.report.ExportExcelBehospitalDTO;
|
|
import com.lantone.common.dto.report.ExportExcelDTO;
|
|
import com.lantone.common.dto.report.ExportExcelDTO;
|
|
import com.lantone.common.dto.report.ExportExcelWideBehospitalDTO;
|
|
import com.lantone.common.dto.report.ExportExcelWideBehospitalDTO;
|
|
import com.lantone.common.dto.report.ExportWideExcelDTO;
|
|
import com.lantone.common.dto.report.ExportWideExcelDTO;
|
|
|
|
+import com.lantone.common.dto.report.MsgDTO;
|
|
|
|
+import com.lantone.common.dto.report.QcResultDTO;
|
|
|
|
+import com.lantone.common.dto.report.QuestionEntryDTO;
|
|
|
|
+import com.lantone.common.enums.CheckerRoleEnum;
|
|
|
|
+import com.lantone.common.enums.IsDeleteEnum;
|
|
|
|
+import com.lantone.common.exception.ApiException;
|
|
|
|
+import com.lantone.common.util.BeanUtil;
|
|
|
|
+import com.lantone.common.util.DateUtil;
|
|
|
|
+import com.lantone.common.util.EntityUtil;
|
|
import com.lantone.common.util.ExcelUtils;
|
|
import com.lantone.common.util.ExcelUtils;
|
|
import com.lantone.common.util.ListUtil;
|
|
import com.lantone.common.util.ListUtil;
|
|
import com.lantone.common.util.SysUserUtils;
|
|
import com.lantone.common.util.SysUserUtils;
|
|
|
|
+import com.lantone.common.vo.report.AnalyzeVO;
|
|
import com.lantone.common.vo.report.BehospitalPageVO;
|
|
import com.lantone.common.vo.report.BehospitalPageVO;
|
|
|
|
+import com.lantone.common.vo.report.CheckInfoVO;
|
|
|
|
+import com.lantone.common.vo.report.DoctorAdviceVO;
|
|
|
|
+import com.lantone.common.vo.report.ExamineInfoVO;
|
|
|
|
+import com.lantone.common.vo.report.ExamineSonInfoVO;
|
|
import com.lantone.common.vo.report.ExportQcresultVO;
|
|
import com.lantone.common.vo.report.ExportQcresultVO;
|
|
|
|
+import com.lantone.common.vo.report.GetDetailVO;
|
|
|
|
+import com.lantone.common.vo.report.MedNurseInfoVO;
|
|
|
|
+import com.lantone.dblayermbg.entity.UserRole;
|
|
|
|
+import com.lantone.dblayermbg.entity.report.BehospitalInfo;
|
|
|
|
+import com.lantone.dblayermbg.entity.report.CheckInfo;
|
|
|
|
+import com.lantone.dblayermbg.entity.report.HomePage;
|
|
|
|
+import com.lantone.dblayermbg.entity.report.Nurse;
|
|
|
|
+import com.lantone.dblayermbg.facade.UserRoleFacade;
|
|
import com.lantone.dblayermbg.facade.report.BehospitalInfoFacade;
|
|
import com.lantone.dblayermbg.facade.report.BehospitalInfoFacade;
|
|
|
|
+import com.lantone.dblayermbg.facade.report.CheckInfoFacade;
|
|
|
|
+import com.lantone.dblayermbg.facade.report.DoctorAdviceFacade;
|
|
|
|
+import com.lantone.dblayermbg.facade.report.HomePageFacade;
|
|
|
|
+import com.lantone.dblayermbg.facade.report.LisInfoFacade;
|
|
|
|
+import com.lantone.dblayermbg.facade.report.NurseFacade;
|
|
|
|
+import com.lantone.dblayermbg.facade.report.PacsInfoFacade;
|
|
|
|
+import com.lantone.dblayermbg.facade.report.QcresultInfoFacade;
|
|
|
|
+import com.lantone.dblayermbg.facade.report.QuestionInfoFacade;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Component
|
|
@Component
|
|
@@ -26,7 +67,24 @@ public class MrInfoManagementFacade {
|
|
private FilterFacade filterFacade;
|
|
private FilterFacade filterFacade;
|
|
@Autowired
|
|
@Autowired
|
|
private BehospitalInfoFacade behospitalInfoFacade;
|
|
private BehospitalInfoFacade behospitalInfoFacade;
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private CheckInfoFacade checkInfoFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ private HomePageFacade homePageFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ private QcresultInfoFacade qcresultInfoFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ private QuestionInfoFacade questionInfoFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ private UserRoleFacade userRoleFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ NurseFacade nurseFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ PacsInfoFacade pacsInfoFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ LisInfoFacade lisInfoFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ DoctorAdviceFacade doctorAdviceFacade;
|
|
/**
|
|
/**
|
|
* 病历分页列表
|
|
* 病历分页列表
|
|
*
|
|
*
|
|
@@ -89,4 +147,267 @@ public class MrInfoManagementFacade {
|
|
}
|
|
}
|
|
return resWide;
|
|
return resWide;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取医嘱信息翻页
|
|
|
|
+ *
|
|
|
|
+ * @param doctorAdviceVO 获取医嘱信息入参
|
|
|
|
+ * @return 医嘱翻页信息
|
|
|
|
+ */
|
|
|
|
+ public IPage<DoctorAdviceDTO> getPageFac(DoctorAdviceVO doctorAdviceVO) {
|
|
|
|
+ doctorAdviceVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalId()));
|
|
|
|
+ if (null != doctorAdviceVO.getDaStartDateStart()) {
|
|
|
|
+ doctorAdviceVO.setDaStartDateStart(DateUtil.getFirstTimeOfDay(doctorAdviceVO.getDaStartDateStart()));
|
|
|
|
+ }
|
|
|
|
+ if (null != doctorAdviceVO.getDaStartDateEnd()) {
|
|
|
|
+ doctorAdviceVO.setDaStartDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(doctorAdviceVO.getDaStartDateEnd(), 1)));
|
|
|
|
+ }
|
|
|
|
+ if (null != doctorAdviceVO.getDaStartDateStart() && null != doctorAdviceVO.getDaStartDateEnd()) {
|
|
|
|
+ if (DateUtil.after(doctorAdviceVO.getDaStartDateStart(), doctorAdviceVO.getDaStartDateEnd())) {
|
|
|
|
+ throw new ApiException( "开始时间必须小于结束时间!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return doctorAdviceFacade.getPage(doctorAdviceVO);
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 获取检验子项信息
|
|
|
|
+ * @param examineSonInfoVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+ public IPage<ExamineSonInfoDTO> getExamineSonPage(ExamineSonInfoVO examineSonInfoVO) {
|
|
|
|
+ examineSonInfoVO.setHospitalId(SysUserUtils.getCurrentHospitalId());
|
|
|
|
+ return lisInfoFacade.getExamineSonInfo(examineSonInfoVO);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @Description: 获取检验信息
|
|
|
|
+ * @Param: [examineInfoVO]
|
|
|
|
+ * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.lantone.common.dto.report.ExamineInfoDTO>
|
|
|
|
+ */
|
|
|
|
+ public IPage<ExamineInfoDTO> getExaminePage(ExamineInfoVO examineInfoVO) {
|
|
|
|
+ examineInfoVO.setHospitalId(SysUserUtils.getCurrentHospitalId());
|
|
|
|
+ if (null != examineInfoVO.getJyDateStart()) {
|
|
|
|
+ examineInfoVO.setJyDateStart(DateUtil.getFirstTimeOfDay(examineInfoVO.getJyDateStart()));
|
|
|
|
+ }
|
|
|
|
+ if (null != examineInfoVO.getJyDateEnd()) {
|
|
|
|
+ examineInfoVO.setJyDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(examineInfoVO.getJyDateEnd(), 1)));
|
|
|
|
+ }
|
|
|
|
+ if (null != examineInfoVO.getJyDateStart() && null != examineInfoVO.getJyDateEnd()) {
|
|
|
|
+ if (DateUtil.after(examineInfoVO.getJyDateStart(), examineInfoVO.getJyDateEnd())) {
|
|
|
|
+ throw new ApiException( "开始时间必须小于结束时间!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return lisInfoFacade.getExamineInfo(examineInfoVO);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @Description: 获取检查信息
|
|
|
|
+ * @Param: [checkInfoVO]
|
|
|
|
+ * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.lantone.common.dto.report.CheckInfoDTO>
|
|
|
|
+ */
|
|
|
|
+ public IPage<CheckInfoDTO> getCheckPage(CheckInfoVO checkInfoVO) {
|
|
|
|
+
|
|
|
|
+ checkInfoVO.setHospitalId(SysUserUtils.getCurrentHospitalId());
|
|
|
|
+ if (null != checkInfoVO.getJxDateStart()) {
|
|
|
|
+ checkInfoVO.setJxDateStart(DateUtil.getFirstTimeOfDay(checkInfoVO.getJxDateStart()));
|
|
|
|
+ }
|
|
|
|
+ if (null != checkInfoVO.getJxDateEnd()) {
|
|
|
|
+ checkInfoVO.setJxDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(checkInfoVO.getJxDateEnd(), 1)));
|
|
|
|
+ }
|
|
|
|
+ if (null != checkInfoVO.getJxDateStart() && null != checkInfoVO.getJxDateEnd()) {
|
|
|
|
+ if (DateUtil.after(checkInfoVO.getJxDateStart(), checkInfoVO.getJxDateEnd())) {
|
|
|
|
+ throw new ApiException( "开始时间必须小于结束时间!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return pacsInfoFacade.getCheckInfo(checkInfoVO);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public IPage<Nurse> getMedNursePage(MedNurseInfoVO medNurseInfoVO){
|
|
|
|
+ // 添加住院病历信息
|
|
|
|
+ BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("behospital_code", medNurseInfoVO.getBehospitalCode())
|
|
|
|
+ .select("behospital_code","hospital_id","behospital_date","leave_hospital_date")
|
|
|
|
+ );
|
|
|
|
+ QueryWrapper<Nurse> medNurseQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ medNurseQueryWrapper.eq("behospital_code",medNurseInfoVO.getBehospitalCode());
|
|
|
|
+ medNurseQueryWrapper .eq("hospital_id",behospitalInfo.getHospitalId());
|
|
|
|
+ medNurseQueryWrapper .eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
|
+ medNurseQueryWrapper .like("item_name", medNurseInfoVO.getItemName());
|
|
|
|
+ medNurseQueryWrapper.orderByDesc( "measure_time");
|
|
|
|
+ //测量时间
|
|
|
|
+ medNurseQueryWrapper.ge( "measure_time", medNurseInfoVO.getDateStart());
|
|
|
|
+ medNurseQueryWrapper.le( "measure_time", medNurseInfoVO.getDateEnd());
|
|
|
|
+ //出入院时间
|
|
|
|
+ medNurseQueryWrapper.ge( "measure_time", behospitalInfo.getBehospitalDate());
|
|
|
|
+ if(behospitalInfo.getLeaveHospitalDate() != null){
|
|
|
|
+ medNurseQueryWrapper.le( "measure_time",behospitalInfo.getLeaveHospitalDate());
|
|
|
|
+ }
|
|
|
|
+ Page<Nurse> pageCase = new Page<Nurse>(medNurseInfoVO.getCurrent(),medNurseInfoVO.getSize());
|
|
|
|
+ IPage<Nurse> medNurseIPage = nurseFacade.getBaseMapper().selectPage(pageCase, medNurseQueryWrapper);
|
|
|
|
+ medNurseIPage.getRecords().forEach(medNurse -> {
|
|
|
|
+ medNurse.setItemValue(medNurse.getItemValue()+medNurse.getItemUnit());
|
|
|
|
+ });
|
|
|
|
+ return medNurseIPage;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取明细
|
|
|
|
+ *
|
|
|
|
+ * @param getDetailVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Map<String, Object> getByBehospitalCode(GetDetailVO getDetailVO) {
|
|
|
|
+ Map<String, Object> res = new HashMap<>(); // 返回结果
|
|
|
|
+ Long hospitalId = SysUserUtils.getCurrentHospitalId();
|
|
|
|
+ getDetailVO.setHospitalId(hospitalId);
|
|
|
|
+ // 获取病历信息
|
|
|
|
+ BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("hospital_id", getDetailVO.getHospitalId())
|
|
|
|
+ .eq("behospital_code", getDetailVO.getBehospitalCode()), false
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ // 获取患者年龄
|
|
|
|
+ HomePage homePage = homePageFacade.getOne(new QueryWrapper<HomePage>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("hospital_id", getDetailVO.getHospitalId())
|
|
|
|
+ .eq("behospital_code", getDetailVO.getBehospitalCode()), false
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ List<String> paramList = getDetailVO.getParamStr();// 参数列表
|
|
|
|
+
|
|
|
|
+ if (ListUtil.isEmpty(paramList) || paramList.contains("beHospital")) {
|
|
|
|
+ BehosDTO behosDTO = new BehosDTO();
|
|
|
|
+ if (behospitalInfo == null) {
|
|
|
|
+ throw new ApiException("该病历已删除!");
|
|
|
|
+ }
|
|
|
|
+ BeanUtil.copyProperties(behospitalInfo, behosDTO);
|
|
|
|
+ if(null != homePage && StringUtils.isNotEmpty(homePage.getAge()) && StringUtils.isNotEmpty(homePage.getAgeUnit())){
|
|
|
|
+ behosDTO.setAge(homePage.getAge()+homePage.getAgeUnit());
|
|
|
|
+ }
|
|
|
|
+ res.put("beHospital", behosDTO);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (ListUtil.isEmpty(paramList) || paramList.contains("result") || paramList.contains("resultSimple")) {
|
|
|
|
+ // 获取结果主表信息
|
|
|
|
+ QcResultDTO qcResultDTO = qcresultInfoFacade.getByBehospitalCode(getDetailVO);
|
|
|
|
+ if (qcResultDTO == null) {
|
|
|
|
+ throw new ApiException( "该病历未评分!");
|
|
|
|
+ }
|
|
|
|
+ if (paramList.contains("resultSimple")) {
|
|
|
|
+ qcResultDTO.setPageData("");
|
|
|
|
+ qcResultDTO.setMenuData("");
|
|
|
|
+ }
|
|
|
|
+ res.put("result", qcResultDTO);
|
|
|
|
+ //增加该病历是否核查状态
|
|
|
|
+ QueryWrapper<CheckInfo> 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 = checkInfoFacade.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<CheckInfo> medCheckInfoMr = new QueryWrapper<>();
|
|
|
|
+ medCheckInfoMr.allEq(mapAllMr);
|
|
|
|
+ int countMr = checkInfoFacade.count(medCheckInfoMr);
|
|
|
|
+ if (countMr > 0) {
|
|
|
|
+ res.put("mrStatus", 1);
|
|
|
|
+ } else {
|
|
|
|
+ res.put("mrStatus", 0);
|
|
|
|
+ }
|
|
|
|
+ //新增如果当前用户不是核查人员返回标志位用户核查按钮、修改、删除、隐藏显示
|
|
|
|
+ //1.获取病历核查人员id,该操作只能是核查员操作
|
|
|
|
+ List<CheckInfo> medCheckInfos = checkInfoFacade.list(new QueryWrapper<CheckInfo>()
|
|
|
|
+ .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(SysUserUtils.getCurrentPrincipleId())) {
|
|
|
|
+ //2.1获取核查类型,判断当前用户有没有对应核查类型的角色
|
|
|
|
+ int jobType = checkInfoFacade.list(new QueryWrapper<CheckInfo>()
|
|
|
|
+ .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 = userRoleFacade.list(new QueryWrapper<UserRole>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("user_id", SysUserUtils.getCurrentPrincipleId())
|
|
|
|
+ ).stream().distinct().map(UserRole::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);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 获取提示信息
|
|
|
|
+ if (ListUtil.isEmpty(paramList) || paramList.contains("msg")) {
|
|
|
|
+ AnalyzeVO analyzeVO = new AnalyzeVO();
|
|
|
|
+ BeanUtil.copyProperties(getDetailVO, analyzeVO);
|
|
|
|
+ List<MsgDTO> msgDTOList = behospitalInfoFacade.getBaseMapper().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 = questionInfoFacade.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()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 根据模块分组
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
}
|
|
}
|