添加补偿报告查询接口,并可做测试

3.2.4.44
wyb 2 years ago
parent da3cdba293
commit d68d96787d

@ -46,4 +46,6 @@ public interface TBasicMapper{
String getSdRyIndexByPatientId(@Param("patientId")String patientId);
List<TBasic> selectBasicListByCreateOrUpdateTime(@Param("startDate")String queryBasicStartDate, @Param("endDate")String queryBasicEndDate, @Param("offset") int offset,@Param("size") int size);
List<TBasic> selectBasicListByPatientIds(@Param("patientIds") List<String> patientIds);
}

@ -3,6 +3,8 @@ 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.job.ReportJob;
import com.docus.server.report.service.ReportService;
import io.swagger.annotations.Api;
@ -25,9 +27,11 @@ import java.util.Map;
public class ReportDownController {
@Resource
private ReportService reportService;
@Resource
private TBasicMapper tBasicMapper;
@Resource
ReportJob reportJob;
@ApiOperation(value = "report lis job 测试")
@PostMapping("/lisreportJobTest")
public CommonResult<String> LisreportJobTest(){
@ -43,6 +47,34 @@ public class ReportDownController {
}
@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);
return CommonResult.success("成功");
}
@ApiOperation(value = "根据任务id补偿报告下载")
@PostMapping("/makeupReportByTaskIds")

@ -86,16 +86,8 @@ public class ReportJob {
if (basicList.size() < pageSize) {
loopCondition = false;
}
for (TBasic tBasic : basicList) {
List<ReportDto> reportDtoList = getLisReportList(tBasic);
if (reportDtoList.isEmpty()) {
log.warn("病案主键 patientId {} 未查询 LIS 检验报告!", tBasic.getPatientId());
continue;
}
reportDtoList.forEach(reportDto -> {
reportService.report(reportDto);
});
}
queryLisReport(basicList);
offset += pageSize;
} while (loopCondition);
} catch (Exception ex) {
@ -107,6 +99,19 @@ public class ReportJob {
log.info("LIS检验报告报告查询 任务结束了,本次查询出院时间段 {} - {}", "", "");
}
public void queryLisReport(List<TBasic> basicList) {
for (TBasic tBasic : basicList) {
List<ReportDto> reportDtoList = getLisReportList(tBasic);
if (reportDtoList.isEmpty()) {
log.warn("病案主键 patientId {} 未查询 LIS 检验报告!", tBasic.getPatientId());
continue;
}
reportDtoList.forEach(reportDto -> {
reportService.report(reportDto);
});
}
}
/**
* 3
@ -136,16 +141,7 @@ public class ReportJob {
if (basicList.size() < pageSize) {
loopCondition = false;
}
for (TBasic tBasic : basicList) {
List<ReportDto> reportDtoList = getInspectReportList(tBasic);
if (reportDtoList.isEmpty()) {
log.warn("病案主键 patientId {} 未查询 检查报告!", tBasic.getPatientId());
continue;
}
reportDtoList.forEach(reportDto -> {
reportService.report(reportDto);
});
}
queryInspectReport(basicList);
offset += pageSize;
} while (loopCondition);
} catch (Exception ex) {
@ -157,6 +153,19 @@ public class ReportJob {
log.info("检查报告报告查询 任务结束了,本次查询出院时间段 {} - {}", "", "");
}
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> getInspectReportList(TBasic tBasic) {
// 根据基础信息查顺德报告业务系统索引,查 交叉索引
List<String> sdRyReportPatientIds = getSdRyReportPatientIds(tBasic.getPatientId());

@ -40,6 +40,8 @@ spring:
file-extension: yml
shared-configs:
- comm.${spring.cloud.nacos.config.file-extension}
profiles:
active: dev
sdry:
# 顺德人医查询检查、检验报告之前查患者交叉索引的wsdl配置

@ -105,7 +105,7 @@
</select>
<select id="selectBasicListByAdmissDate" resultType="com.docus.server.collection.entity.TBasic">
select *
from t_basic
from `docus_medicalrecord`.`t_basic`
where admiss_date between #{admissStartDate} AND #{admissEndDate}
limit #{offset}
, #{size}
@ -131,11 +131,32 @@
`update_time`,
`file_source`,
`jzh`
from t_basic
from `docus_medicalrecord`.`t_basic`
where (`create_time` between #{startDate} AND #{endDate}
or `update_time` between #{startDate} AND #{endDate})
and `dis_date` > '1801-02-03 00:00:00'
limit #{offset}
, #{size}
</select>
<select id="selectBasicListByPatientIds" resultType="com.docus.server.collection.entity.TBasic">
select `patient_id`,
`admiss_times`,
`inpatient_no`,
`admiss_id`,
`ph`,
`sex`,
`age`,
`id_card`,
`admiss_date`,
`dis_date`,
`admiss_days`,
`create_time`,
`update_time`,
`file_source`,
`jzh`
from `docus_medicalrecord`.`t_basic`
where patient_id in <foreach collection="patientIds" item="patientId" open="(" close=")" separator=",">
#{patientId}
</foreach>
</select>
</mapper>

Loading…
Cancel
Save