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

3.2.4.44
wyb 2 years ago
parent 55e0c14708
commit bc81a06cc3

@ -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;
}

@ -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<Object> pacsBase64Test(@Param("examNo") String examNo,@Param("reportNo") String reportNo) {
return CommonResult.success(shunDePeopleService.getBase64PdfFromPacs(examNo,reportNo));
public CommonResult<Object> 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<String> sdRyInspectCollectJob() {
reportJob.sdRyInspectCollectJob();
@ApiOperation(value = " 检查(门诊) 采集 job 测试")
@GetMapping("/sdRyMzInspectCollectJob")
public CommonResult<String> sdRyMzInspectCollectJob() {
reportJob.sdRyMzInspectCollectJob();
return CommonResult.success("成功");
}
@ApiOperation(value = " inspectReport 根据病案主键补偿")
@PostMapping("/inspectReportMakeup")
public CommonResult<String> inspectReportMakeup(@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.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);
@ApiOperation(value = " 检查(住院) 采集 job 测试")
@GetMapping("/sdRyZyInspectCollectJob")
public CommonResult<String> 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,

@ -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) {

@ -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

Loading…
Cancel
Save