| | |
| | | import com.smartor.mapper.ServiceTaskMapper; |
| | | import com.smartor.mapper.SysUserImportMapper; |
| | | import com.smartor.service.*; |
| | | import com.sun.org.apache.bcel.internal.generic.NEW; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | |
| | | |
| | | @Autowired |
| | | private IPatMedInhospService iPatMedInhospService; |
| | | |
| | | @Autowired |
| | | private IPatMedOperationService iPatMedOperationService; |
| | | |
| | | @Autowired |
| | | private IServiceSubtaskService iServiceSubtaskService; |
| | |
| | | public void dealHisData2() { |
| | | //将患者信息、出院、门诊数据全部采集 |
| | | // 指定的开始日期 |
| | | LocalDate endDate = LocalDate.of(2024, 9, 1); |
| | | LocalDate endDate = LocalDate.of(2025, 3, 3); |
| | | // 当前日期 |
| | | LocalDate currentDate = LocalDate.now(); |
| | | // 定义日期格式 |
| | |
| | | * 处理手术信息,进入子任务表 |
| | | */ |
| | | public void dealOperationInfo() { |
| | | iPatMedInhospService.dealOutHospInfo(); |
| | | iPatMedOperationService.dealOperationInfo(); |
| | | } |
| | | |
| | | /** |
| | |
| | | //如何任务被“暂停”或“终止” |
| | | break; |
| | | } |
| | | if (org.apache.commons.lang3.StringUtils.isEmpty(serviceSubtask.getPhone())) { |
| | | serviceSubtask.setRemark("手机号为空"); |
| | | serviceSubtask.setSendstate(4L); |
| | | serviceSubtask.setResult("error"); |
| | | serviceSubtask.setFinishtime(new Date()); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | continue; |
| | | } |
| | | boolean dateToday = isDateToday(serviceSubtask.getLongSendTime()); |
| | | //说明是立即发送(先把消息放到cache-0中, displayNo不知道怎么配置) |
| | | if (dateToday) { |
| | |
| | | //纸质 |
| | | } else if (descByCode.equals("微信小程序")) { |
| | | //微信小程序 |
| | | if (ivrTask1.getPatCycle() == 1) { |
| | | log.error("ivrTask1的值为:{}", ivrTask1); |
| | | if (ObjectUtils.isNotEmpty(ivrTask1) && ivrTask1.getPatCycle() == 1) { |
| | | //说明该任务的患者是循环执行的 |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | serviceSubtaskVO.setTaskid(ivrTask1.getTaskid()); |
| | |
| | | //将子任务ID删除 、sendstate改成3 |
| | | serviceSubtask.setSendstate(3L); |
| | | serviceSubtask.setId(null); |
| | | serviceSubtask.setFinishtime(null); |
| | | serviceSubtask.setCreateTime(new Date()); |
| | | serviceSubtask.setUpdateTime(new Date()); |
| | | serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); |
| | | //处理重复新增问题,先查一下今天是不是有新增过,新增过就不新增了 |
| | | ServiceSubtaskVO ssvo = new ServiceSubtaskVO(); |
| | | LocalDate today = LocalDate.now(); |
| | | LocalTime startOfDay = LocalTime.of(0, 0, 0); |
| | | LocalTime endOfDay = LocalTime.of(23, 59, 59); |
| | | Date startOfDayDate = Date.from(today.atTime(startOfDay).atZone(ZoneId.systemDefault()).toInstant()); |
| | | Date endOfDayDate = Date.from(today.atTime(endOfDay).atZone(ZoneId.systemDefault()).toInstant()); |
| | | ssvo.setCreateStartTime(startOfDayDate); |
| | | ssvo.setCreateEndTime(endOfDayDate); |
| | | ssvo.setCreateBy(serviceSubtask.getCreateBy()); |
| | | ssvo.setSendname(serviceSubtask.getSendname()); |
| | | ssvo.setSfzh(serviceSubtask.getSfzh()); |
| | | List<ServiceSubtask> serviceSubtaskListByCreateTime = serviceSubtaskMapper.selectServiceSubtaskListByCreateTime(ssvo); |
| | | if (CollectionUtils.isEmpty(serviceSubtaskListByCreateTime)) |
| | | serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); |
| | | } |
| | | } |
| | | } else if (descByCode.equals("短信")) { |
| | |
| | | continue; |
| | | } |
| | | String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key); |
| | | String subId = rsaPublicKeyExample.encryptedData(serviceSubtask.getId().toString(), pub_key); |
| | | SendMagParam sendMagParam = new SendMagParam(); |
| | | sendMagParam.setType("4"); |
| | | ServiceOutPath serviceOutPath = new ServiceOutPath(); |
| | | serviceOutPath.setParam1(taskId); |
| | | serviceOutPath.setParam2(patid); |
| | | serviceOutPath.setParam3(ivrTask1.getTaskName()); |
| | | serviceOutPath.setParam6(subId); |
| | | serviceOutPath.setCreateTime(new Date()); |
| | | iServiceOutPathService.insertServiceOutPath(serviceOutPath); |
| | | String format = String.format("%03X", serviceOutPath.getId()); |
| | |
| | | String filename = null; |
| | | if (cry.equals("0")) filename = "入院信息" + System.currentTimeMillis(); |
| | | if (cry.equals("1")) filename = "出院信息" + System.currentTimeMillis(); |
| | | File file = new File("D:\\public\\华卓集成平台数据\\" + filename); |
| | | File file = new File("D:\\public\\HIS数据采集\\" + filename); |
| | | if (!file.exists()) { |
| | | // 如果文件不存在,则创建新文件 |
| | | try { |
| | |
| | | patArchive.setSex(thiedInhospInfo.getPatiRecordGender().equals("男") ? 1L : 2L); |
| | | patArchive.setNation(thiedInhospInfo.getPatiNation()); |
| | | patArchive.setNativePlace(thiedInhospInfo.getPatiNationality()); |
| | | patArchive.setPlaceOfResidence(thiedInhospInfo.getPatiHomeAddr()); |
| | | patArchive.setPlaceOfResidence(StringUtils.isNotEmpty(thiedInhospInfo.getPatiHomeAddr()) ? thiedInhospInfo.getPatiHomeAddr().replace("null", "") : ""); |
| | | try { |
| | | if (StringUtils.isNotEmpty(thiedInhospInfo.getPatiBirthday())) |
| | | patArchive.setBirthdate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getPatiBirthday())); |
| | |
| | | patMedInhosp.setLeavehospitaldistrictcode(thiedInhospInfo.getCurrWardId()); |
| | | patMedInhosp.setLeavehospitaldistrictname(thiedInhospInfo.getCurrWardName()); |
| | | patMedInhosp.setLeaveldeptid(thiedInhospInfo.getCurrDeptCode()); |
| | | patMedInhosp.setOrgid("1"); |
| | | //如果是出院,先通过患者编号和流水号去查一下,患者是否存在,如果存在,则进行修改 |
| | | PatMedInhosp inhosp = new PatMedInhosp(); |
| | | inhosp.setPatno(patArchive.getPatientno()); |