From bc81a06cc3e0a2091827783aefefc8fa919e507f Mon Sep 17 00:00:00 2001 From: wyb <1977763549@qq.com> Date: Mon, 19 Jun 2023 10:46:34 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=BA=E5=BE=B7=E4=BA=BA=E5=8C=BB=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=8A=A5=E5=91=8A=20=E9=97=A8=E8=AF=8A=E4=BD=8F?= =?UTF-8?q?=E9=99=A2=E5=88=86=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/config/SdRyReportQueryConfig.java | 7 +- .../controller/ReportDownController.java | 48 +++-------- .../docus/server/report/job/ReportJob.java | 84 ++++++++++++------- src/main/resources/bootstrap.yml | 7 +- 4 files changed, 78 insertions(+), 68 deletions(-) diff --git a/src/main/java/com/docus/server/report/config/SdRyReportQueryConfig.java b/src/main/java/com/docus/server/report/config/SdRyReportQueryConfig.java index 84542e8..1ad82e2 100644 --- a/src/main/java/com/docus/server/report/config/SdRyReportQueryConfig.java +++ b/src/main/java/com/docus/server/report/config/SdRyReportQueryConfig.java @@ -7,6 +7,7 @@ import org.springframework.stereotype.Component; /** * 应用业务配置 + * * @author wyb */ @Component @@ -42,6 +43,8 @@ public class SdRyReportQueryConfig { private String reportQueryInspectAccessKey; @Value("${sdry.report-query-url.inspect.interval:1000}") private int reportQueryInspectInterval; - @Value("${sdry.report-query-url.inspect.collectorId}") - private String reportQueryInspectCollectorId; + @Value("${sdry.report-query-url.inspect.mz-collectorId}") + private String reportQueryMzInspectCollectorId; + @Value("${sdry.report-query-url.inspect.zy-collectorId}") + private String reportQueryZyInspectCollectorId; } diff --git a/src/main/java/com/docus/server/report/controller/ReportDownController.java b/src/main/java/com/docus/server/report/controller/ReportDownController.java index 1ceca15..05514f0 100644 --- a/src/main/java/com/docus/server/report/controller/ReportDownController.java +++ b/src/main/java/com/docus/server/report/controller/ReportDownController.java @@ -3,11 +3,10 @@ package com.docus.server.report.controller; import com.alibaba.fastjson.JSONObject; import com.docus.core.util.Func; 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.report.api.ShunDePeopleService; -import com.docus.server.report.job.ReportJob; import com.docus.server.report.api.TaskDistributeService; +import com.docus.server.report.job.ReportJob; import com.docus.server.report.service.ReportService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -38,10 +37,11 @@ public class ReportDownController { private TaskDistributeService taskDistributeService; @Resource private ShunDePeopleService shunDePeopleService; + @ApiOperation(value = "获取pacs Pdf") @GetMapping("/pacsBase64Test") - public CommonResult pacsBase64Test(@Param("examNo") String examNo,@Param("reportNo") String reportNo) { - return CommonResult.success(shunDePeopleService.getBase64PdfFromPacs(examNo,reportNo)); + public CommonResult pacsBase64Test(@Param("examNo") String examNo, @Param("reportNo") String reportNo) { + return CommonResult.success(shunDePeopleService.getBase64PdfFromPacs(examNo, reportNo)); } @ApiOperation(value = "获取任务测试") @@ -57,38 +57,17 @@ public class ReportDownController { return CommonResult.success("成功"); } - @ApiOperation(value = " inspect 检查 采集 job 测试") - @GetMapping("/sdRyInspectCollectJob") - public CommonResult sdRyInspectCollectJob() { - reportJob.sdRyInspectCollectJob(); + @ApiOperation(value = " 检查(门诊) 采集 job 测试") + @GetMapping("/sdRyMzInspectCollectJob") + public CommonResult sdRyMzInspectCollectJob() { + reportJob.sdRyMzInspectCollectJob(); return CommonResult.success("成功"); } - @ApiOperation(value = " inspectReport 根据病案主键补偿") - @PostMapping("/inspectReportMakeup") - public CommonResult inspectReportMakeup(@RequestBody List patientIds) { - if (Func.isEmpty(patientIds)) { - return CommonResult.failed("病案主键不能为空!"); - } - List tBasics = tBasicMapper.selectBasicListByPatientIds(patientIds); - if (Func.isEmpty(tBasics)) { - return CommonResult.failed("未查询到病案基础数据!"); - } - reportJob.queryInspectReport(tBasics); - return CommonResult.success("成功"); - } - - @ApiOperation(value = "lisReport 根据病案主键补偿") - @PostMapping("/lisReportMakeup") - public CommonResult lisReportMakeup(@RequestBody List patientIds) { - if (Func.isEmpty(patientIds)) { - return CommonResult.failed("病案主键不能为空!"); - } - List tBasics = tBasicMapper.selectBasicListByPatientIds(patientIds); - if (Func.isEmpty(tBasics)) { - return CommonResult.failed("未查询到病案基础数据!"); - } - reportJob.queryLisReport(tBasics); + @ApiOperation(value = " 检查(住院) 采集 job 测试") + @GetMapping("/sdRyZyInspectCollectJob") + public CommonResult sdRyZyInspectCollectJob() { + reportJob.sdRyZyInspectCollectJob(); return CommonResult.success("成功"); } @@ -109,9 +88,6 @@ public class ReportDownController { } - - - @ApiOperation(value = "inspect检查报告测试地址", hidden = true) @PostMapping("/inspectTest/query") public JSONObject inspectTest(@RequestParam("uuid") String uuid, diff --git a/src/main/java/com/docus/server/report/job/ReportJob.java b/src/main/java/com/docus/server/report/job/ReportJob.java index dae4a68..8c57d53 100644 --- a/src/main/java/com/docus/server/report/job/ReportJob.java +++ b/src/main/java/com/docus/server/report/job/ReportJob.java @@ -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 reportDtoList = collectInspectReport(basicList.get(0)); + List 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 basicList = tBasicMapper.selectBasicListByPatientIds(Collections.singletonList(patientId)); + if (basicList.isEmpty()) { + log.warn("patientId {} 未找到基础数据!", patientId); + } + List reportDtoList = collectZyInspectReport(basicList.get(0)); + reportDtoList.forEach(reportDto -> { + reportDto.setSysFlag(reportQueryZyInspectCollectorId); + reportDto.setTaskId(reportDownTwoDto.getTasks().get(0).getTaskId()); + reportService.report(reportDto); + }); + + } public List collectLisReport(TBasic tBasic) { List reportDtoList = getLisReportList(tBasic); @@ -119,10 +142,19 @@ public class ReportJob { return reportDtoList; } - public List collectInspectReport(TBasic basic) { - List reportDtoList = getInspectReportList(basic); + + public List collectMzInspectReport(TBasic basic) { + List reportDtoList = getMzInspectReportList(basic); + if (reportDtoList.isEmpty()) { + log.warn("病案主键 patientId {} 未查询 检查(门诊)报告!", basic.getPatientId()); + } + return reportDtoList; + } + + public List collectZyInspectReport(TBasic basic) { + List 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 basicList) { - for (TBasic tBasic : basicList) { - List reportDtoList = getInspectReportList(tBasic); - if (reportDtoList.isEmpty()) { - log.warn("病案主键 patientId {} 未查询 检查报告!", tBasic.getPatientId()); - continue; - } - reportDtoList.forEach(reportDto -> { - reportService.report(reportDto); - }); + + private List 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 getInspectReportList(TBasic tBasic) { - List reportDtoList = new ArrayList<>(); + private List getMzInspectReportList(TBasic tBasic) { // 根据基础信息查顺德报告业务系统索引,查 交叉索引 List sdRyMzReportPatientIds = getSdRyMzReportPatientIds(tBasic.getPatientId()); if (sdRyMzReportPatientIds.isEmpty()) { log.warn("patientId:{} 未查询到门诊检查报告患者交叉索引", tBasic.getPatientId()); + return new ArrayList<>(); } else { + List reportDtoList = new ArrayList<>(); // 根据门诊交叉索引查询报告 for (String mzSdRyReportPatientId : sdRyMzReportPatientIds) { List reportDtoList2 = getMzInspectReportBySdRyJxId(mzSdRyReportPatientId, tBasic); reportDtoList.addAll(reportDtoList2); } + return reportDtoList; } - String sDryIndex = tBasicMapper.getSdRyIndexByPatientId(tBasic.getPatientId()); - if (Func.isNotBlank(sDryIndex)) { - List zyInspectReportDtos = getZyInspectReportBySdRyJxId(sDryIndex, tBasic); - reportDtoList.addAll(zyInspectReportDtos); - } - return reportDtoList; + } private List getInspectReportBySdRyJxId(String sdRyReportPatientId, TBasic tBasic) { diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml index 22f6dc2..2375ecf 100644 --- a/src/main/resources/bootstrap.yml +++ b/src/main/resources/bootstrap.yml @@ -53,7 +53,7 @@ sdry: # operationName: querySdJxIndexNoResultTest # 顺德人医查询检查、检验报告的地址配置 report-query-url: - # lis检验报告地址 和文件分段 + # 门急诊lis检验报告地址 lis: collectorId: 4 url: http://127.0.0.1:9311/report/makeup/lisTest @@ -62,7 +62,10 @@ sdry: interval: 1000 # 检查报告地址 inspect: - collectorId: 3 + #门诊的检查采集器id + mz-collectorId: 3 + #住院的检查采集器id + zy-collectorId: 3 url: http://127.0.0.1:9311/report/makeup/inspectTest action: inspectac accessKey: inspectaskey