|
|
|
@ -86,12 +86,12 @@ public class ReportJob {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查报告查询
|
|
|
|
|
* 门诊检查报告查询
|
|
|
|
|
*/
|
|
|
|
|
@XxlJob("SdRyInspectCollectJob")
|
|
|
|
|
public void sdRyInspectCollectJob() {
|
|
|
|
|
String reportQueryInspectCollectorId = sdRyReportQueryConfig.getReportQueryInspectCollectorId();
|
|
|
|
|
ReportDownTwoDto reportDownTwoDto = taskDistributeService.getNoviewTaskByCollectorId(reportQueryInspectCollectorId);
|
|
|
|
|
@XxlJob("SdRyMzInspectCollectJob")
|
|
|
|
|
public void sdRyMzInspectCollectJob() {
|
|
|
|
|
String reportQueryMzInspectCollectorId = sdRyReportQueryConfig.getReportQueryMzInspectCollectorId();
|
|
|
|
|
ReportDownTwoDto reportDownTwoDto = taskDistributeService.getNoviewTaskByCollectorId(reportQueryMzInspectCollectorId);
|
|
|
|
|
if (reportDownTwoDto == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -100,16 +100,39 @@ public class ReportJob {
|
|
|
|
|
if (basicList.isEmpty()) {
|
|
|
|
|
log.warn("patientId {} 未找到基础数据!", patientId);
|
|
|
|
|
}
|
|
|
|
|
List<ReportDto> reportDtoList = collectInspectReport(basicList.get(0));
|
|
|
|
|
List<ReportDto> reportDtoList = collectMzInspectReport(basicList.get(0));
|
|
|
|
|
|
|
|
|
|
reportDtoList.forEach(reportDto -> {
|
|
|
|
|
reportDto.setSysFlag(reportQueryInspectCollectorId);
|
|
|
|
|
reportDto.setSysFlag(reportQueryMzInspectCollectorId);
|
|
|
|
|
reportDto.setTaskId(reportDownTwoDto.getTasks().get(0).getTaskId());
|
|
|
|
|
reportService.report(reportDto);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 住院检查报告查询
|
|
|
|
|
*/
|
|
|
|
|
@XxlJob("SdRyZyInspectCollectJob")
|
|
|
|
|
public void sdRyZyInspectCollectJob() {
|
|
|
|
|
String reportQueryZyInspectCollectorId = sdRyReportQueryConfig.getReportQueryZyInspectCollectorId();
|
|
|
|
|
ReportDownTwoDto reportDownTwoDto = taskDistributeService.getNoviewTaskByCollectorId(reportQueryZyInspectCollectorId);
|
|
|
|
|
if (reportDownTwoDto == null) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
String patientId = reportDownTwoDto.getPatient().getPatientId();
|
|
|
|
|
List<TBasic> basicList = tBasicMapper.selectBasicListByPatientIds(Collections.singletonList(patientId));
|
|
|
|
|
if (basicList.isEmpty()) {
|
|
|
|
|
log.warn("patientId {} 未找到基础数据!", patientId);
|
|
|
|
|
}
|
|
|
|
|
List<ReportDto> reportDtoList = collectZyInspectReport(basicList.get(0));
|
|
|
|
|
reportDtoList.forEach(reportDto -> {
|
|
|
|
|
reportDto.setSysFlag(reportQueryZyInspectCollectorId);
|
|
|
|
|
reportDto.setTaskId(reportDownTwoDto.getTasks().get(0).getTaskId());
|
|
|
|
|
reportService.report(reportDto);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<ReportDto> collectLisReport(TBasic tBasic) {
|
|
|
|
|
List<ReportDto> reportDtoList = getLisReportList(tBasic);
|
|
|
|
@ -119,10 +142,19 @@ public class ReportJob {
|
|
|
|
|
return reportDtoList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<ReportDto> collectInspectReport(TBasic basic) {
|
|
|
|
|
List<ReportDto> reportDtoList = getInspectReportList(basic);
|
|
|
|
|
|
|
|
|
|
public List<ReportDto> collectMzInspectReport(TBasic basic) {
|
|
|
|
|
List<ReportDto> reportDtoList = getMzInspectReportList(basic);
|
|
|
|
|
if (reportDtoList.isEmpty()) {
|
|
|
|
|
log.warn("病案主键 patientId {} 未查询 检查(门诊)报告!", basic.getPatientId());
|
|
|
|
|
}
|
|
|
|
|
return reportDtoList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<ReportDto> collectZyInspectReport(TBasic basic) {
|
|
|
|
|
List<ReportDto> reportDtoList = getZyInspectReportList(basic);
|
|
|
|
|
if (reportDtoList.isEmpty()) {
|
|
|
|
|
log.warn("病案主键 patientId {} 未查询 检查报告!", basic.getPatientId());
|
|
|
|
|
log.warn("病案主键 patientId {} 未查询 检查(住院)报告!", basic.getPatientId());
|
|
|
|
|
}
|
|
|
|
|
return reportDtoList;
|
|
|
|
|
}
|
|
|
|
@ -141,38 +173,34 @@ public class ReportJob {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void queryInspectReport(List<TBasic> basicList) {
|
|
|
|
|
for (TBasic tBasic : basicList) {
|
|
|
|
|
List<ReportDto> reportDtoList = getInspectReportList(tBasic);
|
|
|
|
|
if (reportDtoList.isEmpty()) {
|
|
|
|
|
log.warn("病案主键 patientId {} 未查询 检查报告!", tBasic.getPatientId());
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
reportDtoList.forEach(reportDto -> {
|
|
|
|
|
reportService.report(reportDto);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
private List<ReportDto> getZyInspectReportList(TBasic tBasic) {
|
|
|
|
|
|
|
|
|
|
String sDryIndex = tBasicMapper.getSdRyIndexByPatientId(tBasic.getPatientId());
|
|
|
|
|
if (Func.isNotBlank(sDryIndex)) {
|
|
|
|
|
return getZyInspectReportBySdRyJxId(sDryIndex, tBasic);
|
|
|
|
|
} else {
|
|
|
|
|
log.warn("patientId :{},未保存索引信息", tBasic.getPatientId());
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<ReportDto> getInspectReportList(TBasic tBasic) {
|
|
|
|
|
List<ReportDto> reportDtoList = new ArrayList<>();
|
|
|
|
|
private List<ReportDto> getMzInspectReportList(TBasic tBasic) {
|
|
|
|
|
// 根据基础信息查顺德报告业务系统索引,查 交叉索引
|
|
|
|
|
List<String> sdRyMzReportPatientIds = getSdRyMzReportPatientIds(tBasic.getPatientId());
|
|
|
|
|
if (sdRyMzReportPatientIds.isEmpty()) {
|
|
|
|
|
log.warn("patientId:{} 未查询到门诊检查报告患者交叉索引", tBasic.getPatientId());
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
} else {
|
|
|
|
|
List<ReportDto> reportDtoList = new ArrayList<>();
|
|
|
|
|
// 根据门诊交叉索引查询报告
|
|
|
|
|
for (String mzSdRyReportPatientId : sdRyMzReportPatientIds) {
|
|
|
|
|
List<ReportDto> reportDtoList2 = getMzInspectReportBySdRyJxId(mzSdRyReportPatientId, tBasic);
|
|
|
|
|
reportDtoList.addAll(reportDtoList2);
|
|
|
|
|
}
|
|
|
|
|
return reportDtoList;
|
|
|
|
|
}
|
|
|
|
|
String sDryIndex = tBasicMapper.getSdRyIndexByPatientId(tBasic.getPatientId());
|
|
|
|
|
if (Func.isNotBlank(sDryIndex)) {
|
|
|
|
|
List<ReportDto> zyInspectReportDtos = getZyInspectReportBySdRyJxId(sDryIndex, tBasic);
|
|
|
|
|
reportDtoList.addAll(zyInspectReportDtos);
|
|
|
|
|
}
|
|
|
|
|
return reportDtoList;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<ReportDto> getInspectReportBySdRyJxId(String sdRyReportPatientId, TBasic tBasic) {
|
|
|
|
|