| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | | import com.smartor.mapper.*; |
| | | import com.smartor.service.IPatMedInhospService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private ServiceTaskdeptMapper serviceTaskdeptMapper; |
| | | @Autowired |
| | | private ServiceTaskdiagMapper serviceTaskdiagMapper; |
| | | @Autowired |
| | | private ServiceTaskoperMapper serviceTaskoperMapper; |
| | | @Autowired |
| | | private PatArchiveMapper patArchiveMapper; |
| | | @Autowired |
| | |
| | | pmiJB.setDiagcheckFlag("2"); |
| | | pmiJB.setLongTaskReason("人员疾病处理异常:" + e.getMessage()); |
| | | patMedInhospMapper.updatePatMedInhosp(pmiJB); |
| | | } |
| | | } |
| | | |
| | | PatMedInhosp pmss = new PatMedInhosp(); |
| | | //获取需要出院疾病随访,未处理的数据 |
| | | pmss.setOpercheckFlag("0"); |
| | | pmss.setInhospstate("1"); |
| | | pmss.setFuflag("1"); |
| | | List<PatMedInhosp> patMedInhospSSs = patMedInhospMapper.selectPatMedInhospList(pmss); |
| | | log.info("dealOutHospInfo需要处理的出院疾病患者信息:{}", CollectionUtils.isNotEmpty(patMedInhospSSs) ? patMedInhospSSs.size() : null); |
| | | for (PatMedInhosp patMedInhosp1 : patMedInhospSSs) { |
| | | String tagname = patMedInhospMapper.getTagnameBypatid(patMedInhosp1.getPatid()); |
| | | patMedInhosp1.setTagname(tagname); |
| | | } |
| | | |
| | | for (PatMedInhosp pmiSS : patMedInhospSSs) { |
| | | //获取患者信息 |
| | | PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(pmiSS.getPatid()); |
| | | if (Objects.isNull(patArchive)) { |
| | | pmiSS.setDiagcheckFlag("2"); |
| | | pmiSS.setLongTaskReason("患者基本信息为空"); |
| | | patMedInhospMapper.updatePatMedInhosp(pmiSS); |
| | | continue; |
| | | } |
| | | try { |
| | | // if (StringUtils.isEmpty(pmiSS.getLeaveicd10code())) { |
| | | // continue; |
| | | // } |
| | | // 根据患者的疾病,获取该疾病的长期任务 |
| | | ServiceTaskoper serviceTaskoper = new ServiceTaskoper(); |
| | | serviceTaskoper.setLongtask(1L); |
| | | serviceTaskoper.setOrgid(pmiSS.getOrgid()); |
| | | //todo |
| | | serviceTaskoper.setOplevelcode(""); |
| | | |
| | | List<ServiceTaskoper> serviceTaskopers = serviceTaskoperMapper.selectServiceTaskoperList(serviceTaskoper); |
| | | //如果部门模板为空(将deptIsNull设置为true) |
| | | if (CollectionUtils.isEmpty(serviceTaskopers) || serviceTaskopers.size() == 0) { |
| | | PatMedInhosp patMedInhosp = patMedInhospMapper.selectPatMedInhospByInhospid(pmiSS.getInhospid()); |
| | | pmiSS.setOpercheckFlag("2"); |
| | | pmiSS.setLongTaskReason(patMedInhosp.getLongTaskReason() + "所患的手术未配置长期任务;"); |
| | | patMedInhospMapper.updatePatMedInhosp(pmiSS); |
| | | } else { |
| | | for (ServiceTaskoper serviceTaskoper1 : serviceTaskopers) { |
| | | writeInSubTask(serviceTaskoper1.getTaskId(), true, pmiSS, patArchive, 3, config); |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("人员手术处理出异常了:{}", e.getMessage()); |
| | | pmiSS.setOpercheckFlag("2"); |
| | | pmiSS.setLongTaskReason("人员手术处理异常:" + e.getMessage()); |
| | | patMedInhospMapper.updatePatMedInhosp(pmiSS); |
| | | } |
| | | } |
| | | } |
| | |
| | | //先判断一下,是否需要校验 |
| | | if (check && (Objects.isNull(serviceSubtask.getTaskSituation()) || serviceSubtask.getTaskSituation() != 6)) { |
| | | //在新增之前,先通过患者ID,sendstate=2查询一下,在所有长期任务中,是不是还有该患者待执行的任务,有的话,比较之前的endtime是否小于当前的endtaime,如果之前的小于现在的,则直接将之前的停掉(原因再入院) |
| | | ServiceSubtaskVO subtask = new ServiceSubtaskVO(); |
| | | ServiceSubtaskEntity subtask = new ServiceSubtaskEntity(); |
| | | subtask.setPatid(patArchive.getId()); |
| | | subtask.setSendstate(2L); |
| | | subtask.setTaskid(taskid); |
| | |
| | | serviceSubtask.setLongSendTime(newDate); |
| | | serviceSubtask.setVisitTime(newDate); |
| | | |
| | | if (patMedInhosp1.getFudate() != null) serviceSubtask.setVisitTime(patMedInhosp1.getFudate()); |
| | | // if (patMedInhosp1.getFudate() != null && !patMedInhosp1.getOrgid().equals("47255004333112711A1001")) serviceSubtask.setVisitTime(patMedInhosp1.getFudate()); |
| | | //如果是通知的话,需要提前几天将通过短信发出去(具体几天,这个可以配置在sys_conf表中) |
| | | if ("3".equals(serviceTask.getType())) { |
| | | serviceSubtask.setVisitTime(minusDay(newDate, StringUtils.isNotEmpty(config) ? Integer.parseInt(config) : 0)); |
| | |
| | | for (PatMedInhosp patMedInhosp1 : patMedInhospList) { |
| | | try { |
| | | //获取当前入院患者的待执行的出院子任务随访信息 |
| | | ServiceSubtaskVO subtask = new ServiceSubtaskVO(); |
| | | ServiceSubtaskEntity subtask = new ServiceSubtaskEntity(); |
| | | subtask.setPatid(patMedInhosp1.getPatid()); |
| | | subtask.setSendstate(2L); |
| | | List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(subtask); |