保存的索引即是住院的交叉索引

3.2.4.44
wyb 2 years ago
parent aff2e801d8
commit 55e0c14708

@ -11,12 +11,21 @@ import java.util.List;
*/ */
public interface ShunDePeopleService { public interface ShunDePeopleService {
/** /**
* *
* *
* @param sdRyIndex * @param sdRyIndex
* @return * @return
*/ */
List<String> getSdRyReportJxIds(String sdRyIndex); List<String> getSdRyMzReportJxIds(String sdRyIndex);
/**
*
*
* @param sdRyIndex
* @return
*/
List<String> getSdRyZyReportJxIds(String sdRyIndex);
/** /**
* *

@ -54,9 +54,9 @@ public class ShunDePeopleServiceImpl implements ShunDePeopleService {
String respBody = this.sendPost(url, requestParam); String respBody = this.sendPost(url, requestParam);
log.info("查询检查报告请求成功,响应参数:{}", respBody); log.info("查询检查报告请求成功,响应参数:{}", respBody);
TimeUnit.MILLISECONDS.sleep(sdRyReportQueryConfig.getReportQueryInspectInterval()); TimeUnit.MILLISECONDS.sleep(sdRyReportQueryConfig.getReportQueryInspectInterval());
return respBody; return respBody;
} catch (Exception ex) { } catch (Exception ex) {
log.error("查询检查报告失败:"+ex.getMessage(), ex); log.error("查询检查报告失败:" + ex.getMessage(), ex);
return ""; return "";
} finally { } finally {
INSPECT_REPORT_LOCK.unlock(); INSPECT_REPORT_LOCK.unlock();
@ -73,9 +73,9 @@ public class ShunDePeopleServiceImpl implements ShunDePeopleService {
String respBody = this.sendPost(url, requestParam); String respBody = this.sendPost(url, requestParam);
log.info("查询LIS检验报告请求成功,响应参数:{}", respBody); log.info("查询LIS检验报告请求成功,响应参数:{}", respBody);
TimeUnit.MILLISECONDS.sleep(sdRyReportQueryConfig.getReportQueryLisInterval()); TimeUnit.MILLISECONDS.sleep(sdRyReportQueryConfig.getReportQueryLisInterval());
return respBody; return respBody;
} catch (Exception ex) { } catch (Exception ex) {
log.error("查询LIS检验报告失败"+ex.getMessage(), ex); log.error("查询LIS检验报告失败" + ex.getMessage(), ex);
return ""; return "";
} finally { } finally {
LIS_REPORT_LOCK.unlock(); LIS_REPORT_LOCK.unlock();
@ -83,17 +83,36 @@ public class ShunDePeopleServiceImpl implements ShunDePeopleService {
} }
@Override @Override
public List<String> getSdRyReportJxIds(String sdRyIndex) { public List<String> getSdRyMzReportJxIds(String sdRyIndex) {
List<String> indexes = new ArrayList<>(); List<String> indexes = new ArrayList<>();
try { try {
String zyParam = organizationQuerySdRyReportIndexParam(sdRyIndex, 3);
String mzParam = organizationQuerySdRyReportIndexParam(sdRyIndex, 1); String mzParam = organizationQuerySdRyReportIndexParam(sdRyIndex, 1);
String[] zyParams = {"HIP1179", zyParam};
String[] mzParams = {"HIP1179", mzParam}; String[] mzParams = {"HIP1179", mzParam};
List<String> zyIndex = getIndex(zyParams); return getSdRyReportJxIds(mzParams);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
}
return indexes;
}
@Override
public List<String> getSdRyZyReportJxIds(String sdRyIndex) {
List<String> indexes = new ArrayList<>();
try {
String zyParam = organizationQuerySdRyReportIndexParam(sdRyIndex, 3);
String[] zyParams = {"HIP1179", zyParam};
return getSdRyReportJxIds(zyParams);
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
}
return indexes;
}
private List<String> getSdRyReportJxIds(String[] qrIndexParams) {
List<String> indexes = new ArrayList<>();
try {
List<String> zyIndex = getIndex(qrIndexParams);
indexes.addAll(zyIndex); indexes.addAll(zyIndex);
List<String> mzIndex = getIndex(mzParams);
indexes.addAll(mzIndex);
} catch (Exception ex) { } catch (Exception ex) {
log.error(ex.getMessage(), ex); log.error(ex.getMessage(), ex);
} }
@ -140,13 +159,14 @@ public class ShunDePeopleServiceImpl implements ShunDePeopleService {
+ "&creationTime=" + Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI); + "&creationTime=" + Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI);
} }
private String organizationQuerySdRyInspectReportParam(SdJxReportDto dto) { private String organizationQuerySdRyInspectReportParam(SdJxReportDto dto) {
String patientId = dto.getPatientId(); String patientId = dto.getPatientId();
if("1".equals(dto.getPatentTypeCode())){ if ("1".equals(dto.getPatentTypeCode())) {
patientId="m"+patientId; patientId = "m" + patientId;
} }
if("3".equals(dto.getPatentTypeCode())){ if ("3".equals(dto.getPatentTypeCode())) {
patientId="z"+patientId; patientId = "z" + patientId;
} }
HashMap<Object, Object> map = new HashMap<>(7); HashMap<Object, Object> map = new HashMap<>(7);
map.put("isPage", dto.isPage()); map.put("isPage", dto.isPage());
@ -170,11 +190,11 @@ public class ShunDePeopleServiceImpl implements ShunDePeopleService {
private String organizationQuerySdRyLisReportParam(SdJxReportDto dto) { private String organizationQuerySdRyLisReportParam(SdJxReportDto dto) {
String patientId = dto.getPatientId(); String patientId = dto.getPatientId();
if("1".equals(dto.getPatentTypeCode())){ if ("1".equals(dto.getPatentTypeCode())) {
patientId="m"+patientId; patientId = "m" + patientId;
} }
if("3".equals(dto.getPatentTypeCode())){ if ("3".equals(dto.getPatentTypeCode())) {
patientId="z"+patientId; patientId = "z" + patientId;
} }
HashMap<Object, Object> map = new HashMap<>(7); HashMap<Object, Object> map = new HashMap<>(7);
map.put("isPage", dto.isPage()); map.put("isPage", dto.isPage());
@ -189,8 +209,6 @@ public class ShunDePeopleServiceImpl implements ShunDePeopleService {
} }
private String getPdfReportBase64InputString(String examNo, String reportNo, SdPacsServerConfig config) { private String getPdfReportBase64InputString(String examNo, String reportNo, SdPacsServerConfig config) {
return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<!-- PDF报告请求消息 -->\n" + "<!-- PDF报告请求消息 -->\n" +

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

Loading…
Cancel
Save