| | |
| | | |
| | | @Override |
| | | public PatMedRes selectPatMedOuthospCount(PatMedReq patMedReq) { |
| | | // 获取当前登陆人的部门权限 |
| | | if (CollectionUtils.isEmpty(patMedReq.getDeptcodeList())) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysDept> sysDepts = sysUserDeptMapper.selectDeptListByUserId(userId); |
| | | List<String> deptCode = new ArrayList<>(); |
| | | for (SysDept sysDept : sysDepts) { |
| | | deptCode.add(sysDept.getDeptId().toString()); |
| | | } |
| | | patMedReq.setDeptcodeList(deptCode); |
| | | } |
| | | // // 获取当前登陆人的部门权限 |
| | | // if (CollectionUtils.isEmpty(patMedReq.getDeptcodeList())) { |
| | | // Long userId = SecurityUtils.getUserId(); |
| | | // List<SysDept> sysDepts = sysUserDeptMapper.selectDeptListByUserId(userId); |
| | | // List<String> deptCode = new ArrayList<>(); |
| | | // for (SysDept sysDept : sysDepts) { |
| | | // deptCode.add(sysDept.getDeptId().toString()); |
| | | // } |
| | | // patMedReq.setDeptcodeList(deptCode); |
| | | // } |
| | | return patMedOuthospMapper.selectPatMedOuthospCount(patMedReq); |
| | | } |
| | | |
| | |
| | | patMedOuthosp.setDiagcheckFlag("0"); |
| | | List<PatMedOuthosp> patMedOuthosps = selectPatMedOuthospList(patMedOuthosp); |
| | | for (PatMedOuthosp patMedOuthosp1 : patMedOuthosps) { |
| | | PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedOuthosp1.getPatid()); |
| | | |
| | | //该患者有可能提前来复诊了,那他后面的本科室的通知就可以不用再发短信了 |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | if (StringUtils.isNotEmpty(patMedOuthosp1.getDeptcode())) { |
| | | serviceSubtaskVO.setDeptcode(patMedOuthosp1.getDeptcode()); |
| | | serviceSubtaskVO.setSfzh(patArchive.getIdcardno()); |
| | | serviceSubtaskVO.setType("3"); |
| | | serviceSubtaskVO.setSendstate(2L); |
| | | serviceSubtaskVO.setPreachform("4"); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | | if (!CollectionUtils.isEmpty(serviceSubtaskList)) { |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | serviceSubtask.setSendstate(6L); |
| | | serviceSubtask.setRemark("已回来复诊,无需再进行短信通知"); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 根据患者的疾病,获取该疾病的长期任务 |
| | | ServiceTaskdiag serviceTaskdiag = new ServiceTaskdiag(); |
| | | serviceTaskdiag.setLongtask(1L); |
| | | serviceTaskdiag.setIcd10code(patMedOuthosp1.getIcd10code()); |
| | | List<ServiceTaskdiag> serviceTaskdiags = serviceTaskdiagMapper.selectServiceTaskdiagList(serviceTaskdiag); |
| | | PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedOuthosp1.getPatid()); |
| | | //如果部门模板为空(将deptIsNull设置为true) |
| | | if (org.apache.commons.collections4.CollectionUtils.isEmpty(serviceTaskdiags) || serviceTaskdiags.size() == 0) { |
| | | patMedOuthosp1.setDiagcheckFlag("2"); |
| | |
| | | serviceSubtask.setUpdateTime(new Date()); |
| | | serviceSubtask.setUpdateBy(serviceTask.getUpdateBy()); |
| | | serviceSubtask.setUpdateTime(new Date()); |
| | | serviceSubtask.setVisitDeptCode(patMedOuthosp.getDeptcode()); |
| | | serviceSubtask.setVisitDeptName(patMedOuthosp.getDeptname()); |
| | | serviceSubtask.setUpdateTime(new Date()); |
| | | //设置发送时间 |
| | | if (serviceTask.getSendDay() == null) serviceTask.setSendDay(1L); |
| | | Date newDate = addDays(patMedOuthosp.getAdmitdate(), serviceTask.getSendDay().intValue()); |
| | | if (patMedOuthosp.getFudate() != null) { |
| | | //如果门诊表有指定随访时间,那就用指定的 |
| | | newDate = patMedOuthosp.getFudate(); |
| | | } |
| | | serviceSubtask.setLongSendTime(newDate); |
| | | serviceSubtask.setVisitTime(newDate); |
| | | //患者发送时间 |