顺德人医检查报告 门诊住院分开

3.2.4.44
wyb 2 years ago
parent 55e0c14708
commit bc81a06cc3

@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
/** /**
* *
*
* @author wyb * @author wyb
*/ */
@Component @Component
@ -42,6 +43,8 @@ public class SdRyReportQueryConfig {
private String reportQueryInspectAccessKey; private String reportQueryInspectAccessKey;
@Value("${sdry.report-query-url.inspect.interval:1000}") @Value("${sdry.report-query-url.inspect.interval:1000}")
private int reportQueryInspectInterval; private int reportQueryInspectInterval;
@Value("${sdry.report-query-url.inspect.collectorId}") @Value("${sdry.report-query-url.inspect.mz-collectorId}")
private String reportQueryInspectCollectorId; private String reportQueryMzInspectCollectorId;
@Value("${sdry.report-query-url.inspect.zy-collectorId}")
private String reportQueryZyInspectCollectorId;
} }

@ -3,11 +3,10 @@ package com.docus.server.report.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.docus.core.util.Func; import com.docus.core.util.Func;
import com.docus.infrastructure.web.api.CommonResult; import com.docus.infrastructure.web.api.CommonResult;
import com.docus.server.collection.entity.TBasic;
import com.docus.server.collection.mapper.TBasicMapper; import com.docus.server.collection.mapper.TBasicMapper;
import com.docus.server.report.api.ShunDePeopleService; import com.docus.server.report.api.ShunDePeopleService;
import com.docus.server.report.job.ReportJob;
import com.docus.server.report.api.TaskDistributeService; import com.docus.server.report.api.TaskDistributeService;
import com.docus.server.report.job.ReportJob;
import com.docus.server.report.service.ReportService; import com.docus.server.report.service.ReportService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -38,10 +37,11 @@ public class ReportDownController {
private TaskDistributeService taskDistributeService; private TaskDistributeService taskDistributeService;
@Resource @Resource
private ShunDePeopleService shunDePeopleService; private ShunDePeopleService shunDePeopleService;
@ApiOperation(value = "获取pacs Pdf") @ApiOperation(value = "获取pacs Pdf")
@GetMapping("/pacsBase64Test") @GetMapping("/pacsBase64Test")
public CommonResult<Object> pacsBase64Test(@Param("examNo") String examNo,@Param("reportNo") String reportNo) { public CommonResult<Object> pacsBase64Test(@Param("examNo") String examNo, @Param("reportNo") String reportNo) {
return CommonResult.success(shunDePeopleService.getBase64PdfFromPacs(examNo,reportNo)); return CommonResult.success(shunDePeopleService.getBase64PdfFromPacs(examNo, reportNo));
} }
@ApiOperation(value = "获取任务测试") @ApiOperation(value = "获取任务测试")
@ -57,38 +57,17 @@ public class ReportDownController {
return CommonResult.success("成功"); return CommonResult.success("成功");
} }
@ApiOperation(value = " inspect 检查 采集 job 测试") @ApiOperation(value = " 检查(门诊) 采集 job 测试")
@GetMapping("/sdRyInspectCollectJob") @GetMapping("/sdRyMzInspectCollectJob")
public CommonResult<String> sdRyInspectCollectJob() { public CommonResult<String> sdRyMzInspectCollectJob() {
reportJob.sdRyInspectCollectJob(); reportJob.sdRyMzInspectCollectJob();
return CommonResult.success("成功"); return CommonResult.success("成功");
} }
@ApiOperation(value = " inspectReport 根据病案主键补偿") @ApiOperation(value = " 检查(住院) 采集 job 测试")
@PostMapping("/inspectReportMakeup") @GetMapping("/sdRyZyInspectCollectJob")
public CommonResult<String> inspectReportMakeup(@RequestBody List<String> patientIds) { public CommonResult<String> sdRyZyInspectCollectJob() {
if (Func.isEmpty(patientIds)) { reportJob.sdRyZyInspectCollectJob();
return CommonResult.failed("病案主键不能为空!");
}
List<TBasic> tBasics = tBasicMapper.selectBasicListByPatientIds(patientIds);
if (Func.isEmpty(tBasics)) {
return CommonResult.failed("未查询到病案基础数据!");
}
reportJob.queryInspectReport(tBasics);
return CommonResult.success("成功");
}
@ApiOperation(value = "lisReport 根据病案主键补偿")
@PostMapping("/lisReportMakeup")
public CommonResult<String> lisReportMakeup(@RequestBody List<String> patientIds) {
if (Func.isEmpty(patientIds)) {
return CommonResult.failed("病案主键不能为空!");
}
List<TBasic> tBasics = tBasicMapper.selectBasicListByPatientIds(patientIds);
if (Func.isEmpty(tBasics)) {
return CommonResult.failed("未查询到病案基础数据!");
}
reportJob.queryLisReport(tBasics);
return CommonResult.success("成功"); return CommonResult.success("成功");
} }
@ -109,9 +88,6 @@ public class ReportDownController {
} }
@ApiOperation(value = "inspect检查报告测试地址", hidden = true) @ApiOperation(value = "inspect检查报告测试地址", hidden = true)
@PostMapping("/inspectTest/query") @PostMapping("/inspectTest/query")
public JSONObject inspectTest(@RequestParam("uuid") String uuid, public JSONObject inspectTest(@RequestParam("uuid") String uuid,

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

@ -53,7 +53,7 @@ sdry:
# operationName: querySdJxIndexNoResultTest # operationName: querySdJxIndexNoResultTest
# 顺德人医查询检查、检验报告的地址配置 # 顺德人医查询检查、检验报告的地址配置
report-query-url: report-query-url:
# lis检验报告地址 和文件分段 # 门急诊lis检验报告地址
lis: lis:
collectorId: 4 collectorId: 4
url: http://127.0.0.1:9311/report/makeup/lisTest url: http://127.0.0.1:9311/report/makeup/lisTest
@ -62,7 +62,10 @@ sdry:
interval: 1000 interval: 1000
# 检查报告地址 # 检查报告地址
inspect: inspect:
collectorId: 3 #门诊的检查采集器id
mz-collectorId: 3
#住院的检查采集器id
zy-collectorId: 3
url: http://127.0.0.1:9311/report/makeup/inspectTest url: http://127.0.0.1:9311/report/makeup/inspectTest
action: inspectac action: inspectac
accessKey: inspectaskey accessKey: inspectaskey

Loading…
Cancel
Save