| | |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.entity.ServiceSubtaskEntity; |
| | | import com.smartor.mapper.*; |
| | | import com.smartor.service.IPatArchiveService; |
| | | import com.smartor.service.IPatMedInhospService; |
| | |
| | | private PatArchivecontactMapper patArchivecontactMapper; |
| | | |
| | | @Autowired |
| | | private IPatMedPhysicalService patMedPhysicalService; |
| | | private PatMedOuthospMapper patMedOuthospMapper; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | |
| | | patArchiveMapper.updatePatArchive(patArchive); |
| | | if (StringUtils.isNotEmpty(patArchive.getNotrequiredFlag()) && patArchive.getNotrequiredFlag().equals("1")) { |
| | | //不需要服务了,需要通过patid和sendstate=2或者sendstate=1去查询一下,service_subtask里是否有正在执行的任务,有的话,立即停了 |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | ServiceSubtaskEntity serviceSubtaskVO = new ServiceSubtaskEntity(); |
| | | serviceSubtaskVO.setPatid(patArchive.getId()); |
| | | serviceSubtaskVO.setSendstate(2L); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); |
| | |
| | | } |
| | | } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 2) { |
| | | // 查看住院 1 查看门诊 2 查看体检 3 |
| | | List<PatArchiveOthreInfo> patArchives2 = patArchiveMapper.selectPatArchiveInfoByOuthosp(patArchiveReq); |
| | | if (CollectionUtils.isNotEmpty(patArchives2)) { |
| | | patArchiveList.addAll(patArchives2); |
| | | // List<PatArchiveOthreInfo> patArchives2 = patArchiveMapper.selectPatArchiveInfoByOuthosp(patArchiveReq); |
| | | List<PatArchiveOthreInfo> patientInfoQC = getPatientInfoUtils(patArchiveReq); |
| | | |
| | | if (CollectionUtils.isNotEmpty(patientInfoQC)) { |
| | | patArchiveList.addAll(patientInfoQC); |
| | | } |
| | | } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 3) { |
| | | // 查看住院 1 查看门诊 2 查看体检 3 |
| | |
| | | patArchiveList.addAll(patArchives1); |
| | | } |
| | | } else if (patArchive.getAllhosp() != null && patArchive.getAllhosp() == 2) { |
| | | List<PatArchiveOthreInfo> patArchives2 = patArchiveMapper.selectPatArchiveInfoByOuthosp(patArchive); |
| | | if (CollectionUtils.isNotEmpty(patArchives2)) { |
| | | patArchiveList.addAll(patArchives2); |
| | | List<PatArchiveOthreInfo> patientInfoUtils = getPatientInfoUtils(patArchive); |
| | | if (CollectionUtils.isNotEmpty(patientInfoUtils)) { |
| | | patArchiveList.addAll(patientInfoUtils); |
| | | } |
| | | } else if (patArchive.getAllhosp() != null && patArchive.getAllhosp() == 3) { |
| | | List<PatArchiveOthreInfo> patArchives3 = patArchiveMapper.selectPatArchiveInfoByPhysical(patArchive); |
| | |
| | | } |
| | | } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 2) { |
| | | // 查看住院 1 查看门诊 2 查看体检 3 查看出院 4 |
| | | List<PatArchiveOthreInfo> patArchives2 = patArchiveMapper.selectPatArchiveInfoByOuthospQC(patArchiveReq); |
| | | if (CollectionUtils.isNotEmpty(patArchives2)) { |
| | | patArchiveList.addAll(patArchives2); |
| | | List<PatArchiveOthreInfo> patArchives2 = new ArrayList<>(); |
| | | // List<PatArchiveOthreInfo> patArchives2 = patArchiveMapper.selectPatArchiveInfoByOuthospQC(patArchiveReq); |
| | | |
| | | //门急诊信息,采用分表查询(先查门急诊的存储过程,再查患者基本信息表,关联条件:patid) |
| | | List<PatArchiveOthreInfo> patientInfoUtils = getPatientInfoUtils(patArchiveReq); |
| | | if (CollectionUtils.isNotEmpty(patientInfoUtils)) { |
| | | patArchiveList.addAll(patientInfoUtils); |
| | | } |
| | | } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 3) { |
| | | // 查看住院 1 查看门诊 2 查看体检 3 查看出院 4 |
| | |
| | | count = patArchiveMapper.countPatArchiveInfoByInhospQC(patArchiveReq); |
| | | } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 2) { |
| | | // 查看住院 1 查看门诊 2 查看体检 3 查看出院 4 |
| | | count = patArchiveMapper.countPatArchiveInfoByOuthospQC(patArchiveReq); |
| | | // count = patArchiveMapper.countPatArchiveInfoByOuthospQC(patArchiveReq); |
| | | PatMedOuthospQueryReq req=new PatMedOuthospQueryReq(); |
| | | String deptcodes = CollectionUtils.isEmpty(patArchiveReq.getLeaveldeptcodes()) ? null : String.join(",", patArchiveReq.getLeaveldeptcodes()); |
| | | String leavehospitaldistrictcodes = CollectionUtils.isEmpty(patArchiveReq.getLeavehospitaldistrictcodes()) ? null : String.join(",", patArchiveReq.getLeavehospitaldistrictcodes()); |
| | | req.setDeptcode(deptcodes); |
| | | req.setHospitaldistrictcode(leavehospitaldistrictcodes); |
| | | req.setOrgid(patArchiveReq.getOrgid()); |
| | | req.setDrname(StringUtils.isNotEmpty(patArchiveReq.getDrname()) ? patArchiveReq.getDrname() : null); |
| | | req.setPatname(StringUtils.isNotEmpty(patArchiveReq.getName()) ? patArchiveReq.getName() : null); |
| | | req.setDiagname(StringUtils.isNotEmpty(patArchiveReq.getLeavediagname()) ? patArchiveReq.getLeavediagname() : null); |
| | | count = patMedOuthospMapper.callSpQueryOuthospCount(req); |
| | | |
| | | |
| | | } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 3) { |
| | | // 查看住院 1 查看门诊 2 查看体检 3 查看出院 4 |
| | | count = patArchiveMapper.countPatArchiveInfoByPhysicalQC(patArchiveReq); |
| | |
| | | |
| | | return count; |
| | | } |
| | | |
| | | private List<PatArchiveOthreInfo> getPatientInfoUtils(PatArchiveReq patArchiveReq) { |
| | | List<PatArchiveOthreInfo> patArchiveList = new ArrayList<>(); |
| | | |
| | | //门急诊信息,采用分表查询(先查门急诊的存储过程,再查患者基本信息表,关联条件:patid) |
| | | PatMedOuthospQueryReq req=new PatMedOuthospQueryReq(); |
| | | String deptcodes = CollectionUtils.isEmpty(patArchiveReq.getLeaveldeptcodes()) ? null : String.join(",", patArchiveReq.getLeaveldeptcodes()); |
| | | String leavehospitaldistrictcodes = CollectionUtils.isEmpty(patArchiveReq.getLeavehospitaldistrictcodes()) ? null : String.join(",", patArchiveReq.getLeavehospitaldistrictcodes()); |
| | | req.setDeptcode(deptcodes); |
| | | req.setHospitaldistrictcode(leavehospitaldistrictcodes); |
| | | req.setOrgid(patArchiveReq.getOrgid()); |
| | | req.setDrname(StringUtils.isNotEmpty(patArchiveReq.getDrname()) ? patArchiveReq.getDrname() : null); |
| | | req.setPatname(StringUtils.isNotEmpty(patArchiveReq.getName()) ? patArchiveReq.getName() : null); |
| | | req.setDiagname(StringUtils.isNotEmpty(patArchiveReq.getLeavediagname()) ? patArchiveReq.getLeavediagname() : null); |
| | | req.setPageNum(patArchiveReq.getPageNum()==null?null:patArchiveReq.getPageNum()); |
| | | req.setPageSize(patArchiveReq.getPageSize()==null?null:patArchiveReq.getPageSize()); |
| | | List<PatMedOuthosp> patMedOuthosps = patMedOuthospMapper.callSpQueryOuthosp(req); |
| | | for (PatMedOuthosp patMedOuthosp:patMedOuthosps ) { |
| | | PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedOuthosp.getPatid()); |
| | | PatArchiveOthreInfo patArchiveOthreInfo = DtoConversionUtils.sourceToTarget(patArchive, PatArchiveOthreInfo.class); |
| | | patArchiveOthreInfo.setDeptcode(patMedOuthosp.getDeptcode()); |
| | | patArchiveOthreInfo.setDeptname(patMedOuthosp.getDeptname()); |
| | | patArchiveOthreInfo.setDrcode(patMedOuthosp.getDrcode()); |
| | | patArchiveOthreInfo.setDrname(patMedOuthosp.getDrname()); |
| | | patArchiveList.add(patArchiveOthreInfo); |
| | | } |
| | | return patArchiveList; |
| | | } |
| | | } |
| | | |