feat:梅州三院视图报告采集
parent
a83fc1c096
commit
061aeeb742
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"lis":"lis对应的分段",
|
||||||
|
"us":"us对应的分段",
|
||||||
|
"dx":"dx对应的分段",
|
||||||
|
"ct":"ct对应的分段",
|
||||||
|
"ecg":"ecg对应的分段",
|
||||||
|
"mect":"mect对应的分段",
|
||||||
|
"default":"默认文件分段"
|
||||||
|
}
|
@ -0,0 +1,111 @@
|
|||||||
|
package com.docus.server.mzsy.job;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.docus.core.util.Func;
|
||||||
|
import com.docus.infrastructure.core.utils.TableJsonRead;
|
||||||
|
import com.docus.infrastructure.web.api.CommonResult;
|
||||||
|
import com.docus.infrastructure.web.api.ResultCode;
|
||||||
|
import com.docus.server.mzsy.entity.MzsyReportDataView;
|
||||||
|
import com.docus.server.mzsy.mapper.MzsyReportDataViewMapper;
|
||||||
|
import com.docus.server.rpc.DownPlatformService;
|
||||||
|
import com.docus.server.rpc.TaskDistributeService;
|
||||||
|
import com.docus.server.rpc.dto.*;
|
||||||
|
import com.xxl.job.core.context.XxlJobHelper;
|
||||||
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @date 2024/8/16 14:45
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class MzsyReportCollectJob {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DownPlatformService downPlatformService;
|
||||||
|
@Autowired
|
||||||
|
private TaskDistributeService taskDistributeService;
|
||||||
|
@Autowired
|
||||||
|
private MzsyReportDataViewMapper reportDataViewMapper;
|
||||||
|
|
||||||
|
@XxlJob("MzsyReportCollectJob")
|
||||||
|
public void reportCollect() {
|
||||||
|
// 1.获取任务和患者信息 2.查询视图信息 3.上报下载
|
||||||
|
String jobParam = XxlJobHelper.getJobParam();
|
||||||
|
JSONObject jobParamJsonObject = JSONObject.parseObject(jobParam);
|
||||||
|
String collectorId = jobParamJsonObject.getString("collectorId");
|
||||||
|
String extraCondition = jobParamJsonObject.getString("extraCondition");
|
||||||
|
if (Func.isBlank(collectorId)) {
|
||||||
|
log.warn(">>>>>>>>>>>>>>>>>>>>>> 梅州三院 检查、检验、心电等报告视图采集,未配置采集器获取任务信息");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CommonResult<ReportDownTwoDto> commonResult = taskDistributeService.getNoViewTaskByCollectorId(collectorId);
|
||||||
|
if (ResultCode.SUCCESS.getCode().equals(commonResult.getCode())
|
||||||
|
&& commonResult.getData() != null) {
|
||||||
|
ReportDownTwoDto downTwoDto = commonResult.getData();
|
||||||
|
ReportTaskTwoDto task = downTwoDto.getTasks().get(0);
|
||||||
|
log.info(">>>>>>>>>>>>>>>>>>>>>> 梅州三院 检查、检验、心电等报告视图采集任务,获取了任务:{}", Func.toJson(task));
|
||||||
|
|
||||||
|
ReportHospitalTwoDto hospitalTwoDto = downTwoDto.getHospitals().get(0);
|
||||||
|
ReportPatientTwoDto reportPatientTwoDto = downTwoDto.getPatient();
|
||||||
|
String jzh = downTwoDto.getJzh();
|
||||||
|
|
||||||
|
List<MzsyReportDataView> mzsyReportDataViewList = reportDataViewMapper.findByPatJzhAndOtherCondition(jzh, extraCondition);
|
||||||
|
int size = mzsyReportDataViewList.size();
|
||||||
|
log.info("住院号:{},住院次数:{},记账号:{} 采集视图数据:{} 条!数据:{}", reportPatientTwoDto.getInpatientNo(), hospitalTwoDto.getAdmissTimes(), jzh, size,Func.toJson(mzsyReportDataViewList));
|
||||||
|
if (size <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
TableJsonRead tableJsonRead = new TableJsonRead();
|
||||||
|
JSONObject moduleAlisConfig = tableJsonRead.Read("data-config", "mzsy-module-alis", JSONObject.class);
|
||||||
|
|
||||||
|
ReportDownPatientDto patient = new ReportDownPatientDto();
|
||||||
|
patient.setPatientid(downTwoDto.getPatientId());
|
||||||
|
|
||||||
|
ReportDownDto reportDownDto = new ReportDownDto();
|
||||||
|
reportDownDto.setCollectorid(collectorId);
|
||||||
|
reportDownDto.setIp("");
|
||||||
|
reportDownDto.setPatient(patient);
|
||||||
|
int sort=0;
|
||||||
|
for (MzsyReportDataView mzsyReportDataView : mzsyReportDataViewList) {
|
||||||
|
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
||||||
|
reportDownScanFileDto.setDownurl(mzsyReportDataView.getFfilePath());
|
||||||
|
reportDownScanFileDto.setFiletitle(mzsyReportDataView.getFfileName());
|
||||||
|
reportDownScanFileDto.setSerialnum(mzsyReportDataView.getFfileId());
|
||||||
|
reportDownScanFileDto.setFilesource(1);
|
||||||
|
reportDownScanFileDto.setFiletype(1);
|
||||||
|
reportDownScanFileDto.setFilestoragetype(1);
|
||||||
|
reportDownScanFileDto.setTaskid(task.getTaskId());
|
||||||
|
reportDownScanFileDto.setSort(++sort);
|
||||||
|
List<ReportDownScanFileDto> scanFiles = Collections.singletonList(reportDownScanFileDto);
|
||||||
|
|
||||||
|
String assortId;
|
||||||
|
String fpatModule = mzsyReportDataView.getFpatModule();
|
||||||
|
if (Func.isBlank(fpatModule)) {
|
||||||
|
assortId = moduleAlisConfig.getString("default");
|
||||||
|
} else {
|
||||||
|
assortId = moduleAlisConfig.getString(fpatModule.toLowerCase().trim());
|
||||||
|
if (Func.isBlank(assortId)) {
|
||||||
|
assortId = moduleAlisConfig.getString("default");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reportDownDto.setAssortid(assortId);
|
||||||
|
reportDownDto.setScanfiles(scanFiles);
|
||||||
|
downPlatformService.report(reportDownDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
TableJsonRead tableJsonRead = new TableJsonRead();
|
||||||
|
JSONObject moduleAlisConfig = tableJsonRead.Read("data-config", "mzsy-module-alis", JSONObject.class);
|
||||||
|
System.out.println(moduleAlisConfig);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.docus.server.mzsy.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.docus.server.mzsy.entity.MzsyReportDataView;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author YongBin Wen
|
||||||
|
* @date 2024/8/16 14:42
|
||||||
|
*/
|
||||||
|
@DS("mzsy")
|
||||||
|
@Mapper
|
||||||
|
public interface MzsyReportDataViewMapper {
|
||||||
|
/**
|
||||||
|
* 根据患者记账号和额外条件查询视图数据
|
||||||
|
*
|
||||||
|
* @param patJzh 记账号
|
||||||
|
* @param extCondition 额外条件
|
||||||
|
* @return 视图数据
|
||||||
|
*/
|
||||||
|
List<MzsyReportDataView> findByPatJzhAndOtherCondition(@Param("jzh") String patJzh, @Param("ext") String extCondition);
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.docus.server.mzsy.mapper.MzsyReportDataViewMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="findByPatJzhAndOtherCondition" resultType="com.docus.server.mzsy.entity.MzsyReportDataView">
|
||||||
|
select
|
||||||
|
ZYH,
|
||||||
|
ZYCS,
|
||||||
|
FFILE_ID AS ffileId,
|
||||||
|
FFILE_NAME AS ffileName,
|
||||||
|
FFILE_AF_TIME AS ffileAfTime,
|
||||||
|
FFILE_TIME AS ffileTime,
|
||||||
|
FFILE_PATH AS ffilePath,
|
||||||
|
FPAT_JZH AS fpatJzh,
|
||||||
|
FPAT_MODULE AS fpatModule,
|
||||||
|
UPDATE_TIME AS updateTime
|
||||||
|
from dbo.V_REPORT_DATA
|
||||||
|
where FPAT_JZH=#{jzh}
|
||||||
|
<if test="ext != null and ext != ''">
|
||||||
|
${ext}
|
||||||
|
</if>
|
||||||
|
order by FPAT_MODULE asc,FFILE_AF_TIME asc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue