|
|
|
@ -14,6 +14,7 @@ import com.docus.server.report.api.ShunDePeopleService;
|
|
|
|
|
import com.docus.server.report.api.TaskDistributeService;
|
|
|
|
|
import com.docus.server.report.api.dto.*;
|
|
|
|
|
import com.docus.server.report.api.vo.SdRyBloodReportVO;
|
|
|
|
|
import com.docus.server.report.api.vo.SdRyLiangBiaoReportVO;
|
|
|
|
|
import com.docus.server.report.config.SdRyCollectNurseInsertSugarConfig;
|
|
|
|
|
import com.docus.server.report.config.SdRyReportQueryConfig;
|
|
|
|
|
import com.docus.server.report.config.TaskValidateConfig;
|
|
|
|
@ -119,6 +120,59 @@ public class ReportJob {
|
|
|
|
|
log.info("病案号:{},住院次数:{},输血报告单采集:{} 份", inpatientNo, admissTimes, Func.isEmpty(sdRyBloodReportVOList) ? 0 : sdRyBloodReportVOList.size());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 量表报告采集
|
|
|
|
|
*/
|
|
|
|
|
@XxlJob("SdRyLiangbiaoCollectJob")
|
|
|
|
|
public void sdRyLiangbiaoCollectJob() {
|
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>量表采集JOB开始");
|
|
|
|
|
String liangbiaoCollectorId = sdRyReportQueryConfig.getLiangbiaoCollectorId();
|
|
|
|
|
String liangbiaoDefaultAssortType = sdRyReportQueryConfig.getLiangbiaoDefaultAssortType();
|
|
|
|
|
ReportDownTwoDto reportDownTwoDto = taskDistributeService.getNoViewTaskByCollectorId(liangbiaoCollectorId);
|
|
|
|
|
if (reportDownTwoDto == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Long taskId = reportDownTwoDto.getTasks().get(0).getTaskId();
|
|
|
|
|
String patientId = reportDownTwoDto.getPatient().getPatientId();
|
|
|
|
|
String inpatientNo = reportDownTwoDto.getPatient().getInpatientNo();
|
|
|
|
|
ReportHospitalTwoDto hospitalTwoDto = reportDownTwoDto.getHospitals().get(0);
|
|
|
|
|
String admissDateStr = hospitalTwoDto.getAdmissDate();
|
|
|
|
|
String disDateStr = hospitalTwoDto.getDisDate();
|
|
|
|
|
Integer admissTimes = hospitalTwoDto.getAdmissTimes();
|
|
|
|
|
LocalDate admissDate = Func.parseDateTime(admissDateStr).toLocalDate();
|
|
|
|
|
LocalDate disDate = Func.parseDateTime(disDateStr).toLocalDate();
|
|
|
|
|
String beginDate = admissDate.toString();
|
|
|
|
|
String endDate = disDate.plusDays(7).toString();
|
|
|
|
|
List<SdRyLiangBiaoReportVO> liangBiaoReports = shunDePeopleService.getLinagBiaoReport(inpatientNo, beginDate, endDate);
|
|
|
|
|
int size = 0;
|
|
|
|
|
if (Func.isNotEmpty(liangBiaoReports)) {
|
|
|
|
|
// 查出多个记录,可能指的是同一个已经合并的文件,只是描述了项目而已,所以根据pdf路径去重,唯一值和命名取文件名
|
|
|
|
|
List<String> fileUrls = liangBiaoReports.stream().map(SdRyLiangBiaoReportVO::getFileUrl).distinct().collect(Collectors.toList());
|
|
|
|
|
ReportDto reportDto;
|
|
|
|
|
for (String fileUrl : fileUrls) {
|
|
|
|
|
String fileTitle = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);
|
|
|
|
|
String serialnum = fileTitle;
|
|
|
|
|
reportDto = new ReportDto();
|
|
|
|
|
reportDto.setSysFlag(liangbiaoCollectorId);
|
|
|
|
|
reportDto.setTaskId(taskId);
|
|
|
|
|
reportDto.setDownUrl(fileUrl);
|
|
|
|
|
reportDto.setFileTitle(fileTitle);
|
|
|
|
|
reportDto.setSerialnum(serialnum);
|
|
|
|
|
reportDto.setAssortId(ZdAssortConfig.getZdAssortId(liangbiaoDefaultAssortType));
|
|
|
|
|
reportDto.setAdmisstimes(admissTimes);
|
|
|
|
|
reportDto.setInpatientNo(inpatientNo);
|
|
|
|
|
reportDto.setPatientId(patientId);
|
|
|
|
|
reportDto.setDowntype(1);
|
|
|
|
|
reportDto.setFileSource("1");
|
|
|
|
|
reportDto.setFilestoragetype("1");
|
|
|
|
|
reportService.report(reportDto);
|
|
|
|
|
}
|
|
|
|
|
size = fileUrls.size();
|
|
|
|
|
}
|
|
|
|
|
log.info("病案号:{},住院次数:{},量表报告单采集:{} 份", inpatientNo, admissTimes, Func.isEmpty(liangBiaoReports) ? 0 : size);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@XxlJob("SdRyLisCollectJob")
|
|
|
|
|
public void sdRyLisCollectJob() {
|
|
|
|
|
String reportQueryLisCollectorId = sdRyReportQueryConfig.getReportQueryLisCollectorId();
|
|
|
|
@ -299,6 +353,7 @@ public class ReportJob {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 保存延迟验证护理消息
|
|
|
|
|
*/
|
|
|
|
|