|
|
|
@ -155,17 +155,22 @@ public class ReportJob {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<ReportDto> getInspectReportList(TBasic tBasic) {
|
|
|
|
|
List<ReportDto> reportDtoList = new ArrayList<>();
|
|
|
|
|
// 根据基础信息查顺德报告业务系统索引,查 交叉索引
|
|
|
|
|
List<String> sdRyReportPatientIds = getSdRyReportPatientIds(tBasic.getPatientId());
|
|
|
|
|
if (sdRyReportPatientIds.isEmpty()) {
|
|
|
|
|
log.warn("patientId:{} 未查询到检查报告患者交叉索引", tBasic.getPatientId());
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
List<String> sdRyMzReportPatientIds = getSdRyMzReportPatientIds(tBasic.getPatientId());
|
|
|
|
|
if (sdRyMzReportPatientIds.isEmpty()) {
|
|
|
|
|
log.warn("patientId:{} 未查询到门诊检查报告患者交叉索引", tBasic.getPatientId());
|
|
|
|
|
} else {
|
|
|
|
|
// 根据门诊交叉索引查询报告
|
|
|
|
|
for (String mzSdRyReportPatientId : sdRyMzReportPatientIds) {
|
|
|
|
|
List<ReportDto> reportDtoList2 = getMzInspectReportBySdRyJxId(mzSdRyReportPatientId, tBasic);
|
|
|
|
|
reportDtoList.addAll(reportDtoList2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
List<ReportDto> reportDtoList = new ArrayList<>();
|
|
|
|
|
// 根据交叉索引查询报告
|
|
|
|
|
for (String sdRyReportPatientId : sdRyReportPatientIds) {
|
|
|
|
|
List<ReportDto> reportDtoList2 = getInspectReportBySdRyJxId(sdRyReportPatientId, tBasic);
|
|
|
|
|
reportDtoList.addAll(reportDtoList2);
|
|
|
|
|
String sDryIndex = tBasicMapper.getSdRyIndexByPatientId(tBasic.getPatientId());
|
|
|
|
|
if (Func.isNotBlank(sDryIndex)) {
|
|
|
|
|
List<ReportDto> zyInspectReportDtos = getZyInspectReportBySdRyJxId(sDryIndex, tBasic);
|
|
|
|
|
reportDtoList.addAll(zyInspectReportDtos);
|
|
|
|
|
}
|
|
|
|
|
return reportDtoList;
|
|
|
|
|
}
|
|
|
|
@ -261,7 +266,6 @@ public class ReportJob {
|
|
|
|
|
sdJxReportDto.setPatentTypeCode("3");
|
|
|
|
|
sdJxReportDto.setOrgCode("4560886379");
|
|
|
|
|
String respBody = shunDePeopleService.getInspectReportByJxId(sdJxReportDto);
|
|
|
|
|
|
|
|
|
|
List<ReportDto> reportDtoList = parseQuerySdRyInspectReport(respBody, tBasic);
|
|
|
|
|
if (reportDtoList.isEmpty()) {
|
|
|
|
|
break;
|
|
|
|
@ -343,7 +347,7 @@ public class ReportJob {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String saveBase64(String base64) throws IOException {
|
|
|
|
|
private String saveBase64(String base64) throws IOException {
|
|
|
|
|
String dir;
|
|
|
|
|
try {
|
|
|
|
|
File current = new File(".");
|
|
|
|
@ -392,14 +396,14 @@ public class ReportJob {
|
|
|
|
|
|
|
|
|
|
private List<ReportDto> getLisReportList(TBasic tBasic) {
|
|
|
|
|
// 根据基础信息查顺德报告业务系统索引,查 交叉索引
|
|
|
|
|
List<String> sdRyReportPatientIds = getSdRyReportPatientIds(tBasic.getPatientId());
|
|
|
|
|
if (sdRyReportPatientIds.isEmpty()) {
|
|
|
|
|
log.warn("patientId:{} 未查询到Lis检验报告患者交叉索引", tBasic.getPatientId());
|
|
|
|
|
List<String> sdRyMzReportPatientIds = getSdRyMzReportPatientIds(tBasic.getPatientId());
|
|
|
|
|
if (sdRyMzReportPatientIds.isEmpty()) {
|
|
|
|
|
log.warn("patientId:{} 未查询到门诊Lis检验报告患者交叉索引", tBasic.getPatientId());
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
List<ReportDto> reportDtoList = new ArrayList<>();
|
|
|
|
|
// 根据交叉索引查询报告
|
|
|
|
|
for (String sdRyReportPatientId : sdRyReportPatientIds) {
|
|
|
|
|
for (String sdRyReportPatientId : sdRyMzReportPatientIds) {
|
|
|
|
|
List<ReportDto> reportDtoList2 = getLisReportBySdRyJxId(sdRyReportPatientId, tBasic);
|
|
|
|
|
reportDtoList.addAll(reportDtoList2);
|
|
|
|
|
}
|
|
|
|
@ -577,25 +581,44 @@ public class ReportJob {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据归档病案主键查询报告交叉索引
|
|
|
|
|
* 根据归档病案主键查询门诊报告交叉索引
|
|
|
|
|
*
|
|
|
|
|
* @param patientId 归档病案主键
|
|
|
|
|
* @return 报告交叉索引
|
|
|
|
|
* @return 门诊报告交叉索引
|
|
|
|
|
*/
|
|
|
|
|
private List<String> getSdRyReportPatientIds(String patientId) {
|
|
|
|
|
private List<String> getSdRyMzReportPatientIds(String patientId) {
|
|
|
|
|
try {
|
|
|
|
|
String sDryIndex = tBasicMapper.getSdRyIndexByPatientId(patientId);
|
|
|
|
|
if (Func.isBlank(sDryIndex)) {
|
|
|
|
|
log.warn("归档系统 patientId:{} 未关联到第三方索引", patientId);
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
return shunDePeopleService.getSdRyReportJxIds(sDryIndex);
|
|
|
|
|
return shunDePeopleService.getSdRyMzReportJxIds(sDryIndex);
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error(ex.getMessage(), ex);
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据归档病案主键查询住院报告交叉索引
|
|
|
|
|
*
|
|
|
|
|
* @param patientId 归档病案主键
|
|
|
|
|
* @return 住院报告交叉索引
|
|
|
|
|
*/
|
|
|
|
|
private List<String> getSdRyZyReportPatientIds(String patientId) {
|
|
|
|
|
try {
|
|
|
|
|
String sDryIndex = tBasicMapper.getSdRyIndexByPatientId(patientId);
|
|
|
|
|
if (Func.isBlank(sDryIndex)) {
|
|
|
|
|
log.warn("归档系统 patientId:{} 未关联到第三方索引", patientId);
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
return shunDePeopleService.getSdRyZyReportJxIds(sDryIndex);
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error(ex.getMessage(), ex);
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void refreshTime(AfJobTime afJobTime) {
|
|
|
|
|
if (afJobTime.getId() == null) {
|
|
|
|
|