feat: 梅州三院手麻视图采集

master
wyb 9 months ago
parent ec311f57aa
commit dce5abdc3e

@ -0,0 +1,36 @@
package com.docus.server.mzsy.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
*
*
* @author YongBin Wen
* @date 2024/8/16 14:39
*/
@Data
@ApiModel("梅州三院手麻报告视图")
public class MzsyShoumaReportDataView {
@ApiModelProperty("住院号")
private String zyh;
@ApiModelProperty("住院次数")
private String zycs;
@ApiModelProperty("文件路径 HTTP路径")
private String filePath;
@ApiModelProperty("报告标题")
private String fileTitle;
@ApiModelProperty("申请单号")
private String requestNo;
@ApiModelProperty("归档时间")
private Date archiveTime;
}

@ -6,7 +6,9 @@ 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.entity.MzsyShoumaReportDataView;
import com.docus.server.mzsy.mapper.MzsyReportDataViewMapper;
import com.docus.server.mzsy.mapper.MzsyShoumaReportDataViewMapper;
import com.docus.server.rpc.DownPlatformService;
import com.docus.server.rpc.TaskDistributeService;
import com.docus.server.rpc.dto.*;
@ -33,6 +35,8 @@ public class MzsyReportCollectJob {
private TaskDistributeService taskDistributeService;
@Autowired
private MzsyReportDataViewMapper reportDataViewMapper;
@Autowired
private MzsyShoumaReportDataViewMapper shoumaReportDataViewMapper;
@XxlJob("MzsyReportCollectJob")
public void reportCollect() {
@ -59,7 +63,7 @@ public class MzsyReportCollectJob {
List<MzsyReportDataView> mzsyReportDataViewList = reportDataViewMapper.findByPatJzhAndOtherCondition(jzh, extraCondition);
int size = mzsyReportDataViewList.size();
log.info("住院号:{},住院次数:{},记账号:{} 采集视图数据:{} 条!数据:{}", reportPatientTwoDto.getInpatientNo(), hospitalTwoDto.getAdmissTimes(), jzh, size,Func.toJson(mzsyReportDataViewList));
log.info("住院号:{},住院次数:{},记账号:{} 采集视图数据:{} 条!数据:{}", reportPatientTwoDto.getInpatientNo(), hospitalTwoDto.getAdmissTimes(), jzh, size, Func.toJson(mzsyReportDataViewList));
if (size <= 0) {
return;
}
@ -73,7 +77,7 @@ public class MzsyReportCollectJob {
reportDownDto.setCollectorid(collectorId);
reportDownDto.setIp("");
reportDownDto.setPatient(patient);
int sort=0;
int sort = 0;
for (MzsyReportDataView mzsyReportDataView : mzsyReportDataViewList) {
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
reportDownScanFileDto.setDownurl(mzsyReportDataView.getFfilePath());
@ -103,6 +107,67 @@ public class MzsyReportCollectJob {
}
}
@XxlJob("MzsyShouMaReportCollectJob")
public void shouMaReportCollect() {
// 1.获取任务和患者信息 2.查询视图信息 3.上报下载
String jobParam = XxlJobHelper.getJobParam();
JSONObject jobParamJsonObject = JSONObject.parseObject(jobParam);
String collectorId = jobParamJsonObject.getString("collectorId");
String extraCondition = jobParamJsonObject.getString("extraCondition");
String assortId = jobParamJsonObject.getString("assortId");
if (Func.isBlank(collectorId) || Func.isBlank(assortId)) {
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();
String inpatientNo = reportPatientTwoDto.getInpatientNo();
Integer admissTimes = hospitalTwoDto.getAdmissTimes();
List<MzsyShoumaReportDataView> shoumaReportDataViewList = shoumaReportDataViewMapper.findByinpNoAndTimesAndOtherCondition(inpatientNo, String.valueOf(admissTimes), extraCondition);
int size = shoumaReportDataViewList.size();
log.info("住院号:{},住院次数:{},记账号:{} 采集视图数据:{} 条!数据:{}", inpatientNo, admissTimes, jzh, size, Func.toJson(shoumaReportDataViewList));
if (size <= 0) {
return;
}
ReportDownPatientDto patient = new ReportDownPatientDto();
patient.setPatientid(downTwoDto.getPatientId());
ReportDownDto reportDownDto = new ReportDownDto();
reportDownDto.setCollectorid(collectorId);
reportDownDto.setIp("");
reportDownDto.setPatient(patient);
int sort = 0;
for (MzsyShoumaReportDataView mzsyShouMaReportDataView : shoumaReportDataViewList) {
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
reportDownScanFileDto.setDownurl(mzsyShouMaReportDataView.getFilePath());
reportDownScanFileDto.setFiletitle(mzsyShouMaReportDataView.getFileTitle());
reportDownScanFileDto.setSerialnum(mzsyShouMaReportDataView.getFilePath());
reportDownScanFileDto.setFilesource(1);
reportDownScanFileDto.setFiletype(1);
reportDownScanFileDto.setFilestoragetype(1);
reportDownScanFileDto.setTaskid(task.getTaskId());
reportDownScanFileDto.setSort(++sort);
List<ReportDownScanFileDto> scanFiles = Collections.singletonList(reportDownScanFileDto);
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);

@ -0,0 +1,26 @@
package com.docus.server.mzsy.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.docus.server.mzsy.entity.MzsyShoumaReportDataView;
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-shouma")
@Mapper
public interface MzsyShoumaReportDataViewMapper {
/**
*
*
* @param inpatientNo
* @param admissTimes
* @param extCondition
* @return
*/
List<MzsyShoumaReportDataView> findByinpNoAndTimesAndOtherCondition(@Param("inpatientNo") String inpatientNo, @Param("admissTimes")String admissTimes, @Param("ext") String extCondition);
}

@ -55,6 +55,28 @@ spring:
test-on-borrow: false
test-on-return: false
validation-query: select 1
mzsy-shouma:
url: jdbc:sqlserver://192.168.0.251:1433;DatabaseName=kbamis-mzsy
username: sa
password: hospital
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
type: com.alibaba.druid.pool.DruidDataSource
# 初始化配置
initial-size: 3
# 最小连接数
min-idle: 3
# 最大连接数
max-active: 10
# 获取连接超 时时间
max-wait: 5000
# 连接有效性检测时间
time-between-eviction-runs-millis: 90000
# 最大空闲时间
min-evictable-idle-time-millis: 1800000
test-while-idle: true
test-on-borrow: false
test-on-return: false
validation-query: select 1
ydzyy-pacs:
url: jdbc:sqlserver://10.10.100.105;DatabaseName=pacsdb
username: wzhpacs

@ -0,0 +1,25 @@
<?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.MzsyShoumaReportDataViewMapper">
<select id="findByinpNoAndTimesAndOtherCondition"
resultType="com.docus.server.mzsy.entity.MzsyShoumaReportDataView">
select
住院号 as zyh,
住院次数 as zycs,
报告文件路径 as filePath,
报告标题 as fileTitle,
归档时间 as archiveTime,
申请单号 as requestNo
from dbo.V_病历共享
where 住院号=#{inpatientNo}
and 住院次数=#{admissTimes}
<if test="ext != null and ext != ''">
${ext}
</if>
order by 归档时间 asc
</select>
</mapper>
Loading…
Cancel
Save