修改采集保存路径
parent
4433370d56
commit
4e8edf16d8
@ -1,61 +0,0 @@
|
||||
package com.shibofu.spring.config;
|
||||
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionFactoryBean;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* @author potter.fu
|
||||
* @date 2018-12-07 15:27
|
||||
*/
|
||||
@Configuration
|
||||
@MapperScan(basePackages = "com.shibofu.spring.db1.dao", sqlSessionTemplateRef = "db1SqlSessionTemplate")
|
||||
public class DataSource1Config {
|
||||
/**
|
||||
* 生成数据源. @Primary 注解声明为默认数据源
|
||||
*/
|
||||
@Bean(name = "db1DataSource")
|
||||
@ConfigurationProperties(prefix = "spring.datasource.hikari.db1")
|
||||
@Primary
|
||||
public DataSource testDataSource() {
|
||||
return DataSourceBuilder.create().build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建 SqlSessionFactory
|
||||
*/
|
||||
@Bean(name = "db1SqlSessionFactory")
|
||||
@Primary
|
||||
public SqlSessionFactory testSqlSessionFactory(@Qualifier("db1DataSource") DataSource dataSource) throws Exception {
|
||||
SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
|
||||
bean.setDataSource(dataSource);
|
||||
bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/db1/*.xml"));
|
||||
return bean.getObject();
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置事务管理
|
||||
*/
|
||||
@Bean(name = "db1TransactionManager")
|
||||
@Primary
|
||||
public DataSourceTransactionManager testTransactionManager(@Qualifier("db1DataSource") DataSource dataSource) {
|
||||
return new DataSourceTransactionManager(dataSource);
|
||||
}
|
||||
|
||||
@Bean(name = "db1SqlSessionTemplate")
|
||||
@Primary
|
||||
public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("db1SqlSessionFactory") SqlSessionFactory sqlSessionFactory) {
|
||||
return new SqlSessionTemplate(sqlSessionFactory);
|
||||
}
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
package com.shibofu.spring.config;
|
||||
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionFactoryBean;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* @author potter.fu
|
||||
* @date 2018-12-07 15:30
|
||||
*/
|
||||
@Configuration
|
||||
@MapperScan(basePackages = "com.shibofu.spring.db3.dao", sqlSessionTemplateRef = "db3SqlSessionTemplate")
|
||||
public class DataSource3Config {
|
||||
|
||||
@Bean(name = "db3DataSource")
|
||||
@ConfigurationProperties(prefix = "spring.datasource.hikari.db3")
|
||||
public DataSource testDataSource() {
|
||||
return DataSourceBuilder.create().build();
|
||||
}
|
||||
|
||||
@Bean(name = "db3SqlSessionFactory")
|
||||
public SqlSessionFactory testSqlSessionFactory(@Qualifier("db3DataSource") DataSource dataSource) throws Exception {
|
||||
SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
|
||||
bean.setDataSource(dataSource);
|
||||
bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/db3/*.xml"));
|
||||
return bean.getObject();
|
||||
}
|
||||
|
||||
@Bean(name = "db3TransactionManager")
|
||||
public DataSourceTransactionManager testTransactionManager(@Qualifier("db3DataSource") DataSource dataSource) {
|
||||
return new DataSourceTransactionManager(dataSource);
|
||||
}
|
||||
|
||||
@Bean(name = "db3SqlSessionTemplate")
|
||||
public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("db3SqlSessionFactory") SqlSessionFactory sqlSessionFactory) {
|
||||
return new SqlSessionTemplate(sqlSessionFactory);
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.shibofu.spring.db1.service;
|
||||
|
||||
import com.shibofu.spring.util.Msg;
|
||||
|
||||
/**
|
||||
* @InterfaceName ECGPollingService
|
||||
* @Description 心电接口
|
||||
* @Author linjj
|
||||
* @Date 2024/7/8 8:55
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface ECGPollingService {
|
||||
|
||||
|
||||
/**
|
||||
* @description: 定时查询每天出院患者
|
||||
* @author linjj
|
||||
* @date: 2024/1/18 9:29
|
||||
*/
|
||||
Msg ECGDayPolling() ;
|
||||
|
||||
Msg ECGDayPollingByPatientId(String patientId);
|
||||
|
||||
Msg makeUp();
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
package com.shibofu.spring.db1.service;
|
||||
|
||||
import com.shibofu.spring.util.Msg;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @InterfaceName PollingService
|
||||
* @Description pacs轮询接口
|
||||
* @Author linjj
|
||||
* @Date 2024/1/18 9:26
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
public interface PacsPollingService {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description: 定时查询每天出院患者
|
||||
* @author linjj
|
||||
* @date: 2024/1/18 9:29
|
||||
*/
|
||||
void PacsEveryDayPolling() ;
|
||||
|
||||
|
||||
Msg pacsAnxu();
|
||||
|
||||
/**
|
||||
* @description: 定时查询每星期出院患者
|
||||
* @author linjj
|
||||
* @date: 2024/1/18 9:29
|
||||
*/
|
||||
Msg PacsEveryWeekPolling();
|
||||
/**
|
||||
* @description: pacs按需采集
|
||||
* @author linjj
|
||||
* @date: 2024/4/29 10:36
|
||||
*/
|
||||
Msg makeUpPacsByMasterId(String masterId);
|
||||
/**
|
||||
* @description: 轮询pacs提交采集病历
|
||||
* @author linjj
|
||||
* @date: 2024/4/29 10:36
|
||||
*/
|
||||
Msg makeUpPacsPush();
|
||||
}
|
@ -0,0 +1,228 @@
|
||||
package com.shibofu.spring.db1.serviceImpl;
|
||||
|
||||
import com.shibofu.spring.db1.dao.ArchiveDetailDao;
|
||||
import com.shibofu.spring.db1.dao.ArchiveMasterDao;
|
||||
import com.shibofu.spring.db1.service.ECGPollingService;
|
||||
import com.shibofu.spring.db2.dao.ECGDao;
|
||||
import com.shibofu.spring.dto.ArchiveDetailDto;
|
||||
import com.shibofu.spring.util.Msg;
|
||||
import com.shibofu.spring.vo.ArchiveDetailVo;
|
||||
import com.shibofu.spring.vo.ArchiveMasterVo;
|
||||
import com.shibofu.spring.vo.ECGVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ECGPollingServiceImpl
|
||||
* @Description 心电接口
|
||||
* @Author linjj
|
||||
* @Date 2024/7/8 8:55
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ECGPollingServiceImpl implements ECGPollingService {
|
||||
|
||||
@Autowired
|
||||
private ArchiveMasterDao archiveMasterDao;
|
||||
@Autowired
|
||||
private ECGDao ecgDao;
|
||||
@Value("${savePath}")
|
||||
private String savePath;
|
||||
@Autowired
|
||||
private ArchiveDetailDao archiveDetailDao;
|
||||
|
||||
@Override
|
||||
public Msg ECGDayPolling() {
|
||||
//查询当前时间24小时内需要采集数据
|
||||
List<ArchiveMasterVo> archiveMasters = archiveMasterDao.PollingECG();
|
||||
if (CollectionUtils.isEmpty(archiveMasters)) {
|
||||
log.info("当前时间段查询不到心跳数据");
|
||||
return Msg.success("当前时间段查询不到心跳数据");
|
||||
}
|
||||
log.info("--------------------------------------------当前时间段心电需要采集:" + archiveMasters.size() + "个患者--------------------------------------------");
|
||||
//循环所有患者采集
|
||||
for (ArchiveMasterVo list : archiveMasters) {
|
||||
log.info("---------------------开始采集记帐号为:" + list.getPatientId() + "的患者---------------------");
|
||||
List<ECGVo> ecgs = ecgDao.getECG(list.getPatientId());
|
||||
if (CollectionUtils.isEmpty(ecgs)) {
|
||||
log.info("记帐号为:" + list.getPatientId() + "的患者没有心电数据");
|
||||
continue;
|
||||
}
|
||||
//获取需要插入archiveDetai表数据
|
||||
ArrayList<ArchiveDetailDto> archiveDetailList = getArchiveDetailDtos(list, ecgs);
|
||||
if (CollectionUtils.isEmpty(archiveDetailList)) {
|
||||
log.info("记帐号为:" + list.getPatientId()+"没有保存文件表数据");
|
||||
continue;
|
||||
}
|
||||
//更新文件表
|
||||
updateArchiveDetail(list, archiveDetailList);
|
||||
}
|
||||
log.info("--------------------------------------------此时间段采集完成--------------------------------------------");
|
||||
return Msg.success("此时间段采集完成");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Msg ECGDayPollingByPatientId(String patientId){
|
||||
List<ArchiveMasterVo> archiveMasters = archiveMasterDao.PollingECGByPatientId(patientId);
|
||||
if (CollectionUtils.isEmpty(archiveMasters)) {
|
||||
log.info("当前时间段查询不到心跳数据");
|
||||
return Msg.success("当前时间段查询不到心跳数据");
|
||||
}
|
||||
log.info("--------------------------------------------心电按需:" + archiveMasters.size() + "个患者--------------------------------------------");
|
||||
//循环所有患者采集
|
||||
for (ArchiveMasterVo list : archiveMasters) {
|
||||
log.info("---------------------开始采集记帐号为:" + list.getPatientId() + "的患者---------------------");
|
||||
List<ECGVo> ecgs = ecgDao.getECG(list.getPatientId());
|
||||
if (CollectionUtils.isEmpty(ecgs)) {
|
||||
log.info("记帐号为:" + list.getPatientId() + "的患者没有心电数据");
|
||||
continue;
|
||||
}
|
||||
//获取需要插入archiveDetai表数据
|
||||
ArrayList<ArchiveDetailDto> archiveDetailList = getArchiveDetailDtos(list, ecgs);
|
||||
if (CollectionUtils.isEmpty(archiveDetailList)) {
|
||||
log.info("记帐号为:" + list.getPatientId()+"没有保存文件表数据");
|
||||
continue;
|
||||
}
|
||||
//更新文件表
|
||||
updateArchiveDetail(list, archiveDetailList);
|
||||
}
|
||||
log.info("--------------------------------------------心电按需采集完成--------------------------------------------");
|
||||
return Msg.success("心电按需采集完成");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Msg makeUp() {
|
||||
List<ArchiveMasterVo> archiveMasters = archiveMasterDao.makeUp();
|
||||
if (CollectionUtils.isEmpty(archiveMasters)) {
|
||||
log.info("当前时间段查询不到心跳数据");
|
||||
return Msg.success("当前时间段查询不到心跳数据");
|
||||
}
|
||||
log.info("--------------------------------------------心电补偿:" + archiveMasters.size() + "个患者--------------------------------------------");
|
||||
//循环所有患者采集
|
||||
for (ArchiveMasterVo list : archiveMasters) {
|
||||
log.info("---------------------开始采集记帐号为:" + list.getPatientId() + "的患者---------------------");
|
||||
List<ECGVo> ecgs = ecgDao.getECG(list.getPatientId());
|
||||
if (CollectionUtils.isEmpty(ecgs)) {
|
||||
log.info("记帐号为:" + list.getPatientId() + "的患者没有心电数据");
|
||||
continue;
|
||||
}
|
||||
//获取需要插入archiveDetai表数据
|
||||
ArrayList<ArchiveDetailDto> archiveDetailList = getArchiveDetailDtos(list, ecgs);
|
||||
if (CollectionUtils.isEmpty(archiveDetailList)) {
|
||||
log.info("记帐号为:" + list.getPatientId()+"没有保存文件表数据");
|
||||
continue;
|
||||
}
|
||||
//更新文件表
|
||||
updateArchiveDetail(list, archiveDetailList);
|
||||
}
|
||||
log.info("--------------------------------------------心电补偿采集完成--------------------------------------------");
|
||||
return Msg.success("心电补偿采集完成");
|
||||
}
|
||||
//更新文件表数据
|
||||
private void updateArchiveDetail(ArchiveMasterVo list, ArrayList<ArchiveDetailDto> archiveDetailList) {
|
||||
//判断是否存在数据,存在删除并且删除原文件
|
||||
List<ArchiveDetailVo> ecgList = archiveDetailDao.getArchiveDetailBySourceAndMid("ECG", list.getId());
|
||||
if (!CollectionUtils.isEmpty(ecgList)) {
|
||||
archiveDetailDao.delDetailBySourceAndMid("ECG", list.getId());
|
||||
//删除原文件数据
|
||||
deleteFliepath(ecgList);
|
||||
}
|
||||
if (archiveDetailDao.addArchiveDetail(archiveDetailList)){
|
||||
log.info("记帐号为:" + list.getPatientId()+"采集了"+ archiveDetailList.size()+"张图像");
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayList<ArchiveDetailDto> getArchiveDetailDtos(ArchiveMasterVo list, List<ECGVo> ecgs) {
|
||||
ArrayList<ArchiveDetailDto> archiveDetailList = null;
|
||||
try {
|
||||
String filePathdir;
|
||||
//文件保存目录
|
||||
filePathdir = savePath + File.separatorChar + list.getPatientId();
|
||||
// 本地磁盘的路径
|
||||
Path localPath = Paths.get(filePathdir);
|
||||
//确保目录存在
|
||||
if (createDirectory(localPath)) return null;
|
||||
//保存文件表集合
|
||||
archiveDetailList = new ArrayList<>();
|
||||
//患者所有心电记录采集到本地磁盘
|
||||
for (ECGVo ecg : ecgs) {
|
||||
String newPath;
|
||||
String pPath = ecg.getPPath();
|
||||
//使用yyyyMMddHHmmssSSS格式作为文件名
|
||||
Date date = new Date();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
||||
String newDate = format.format(date);
|
||||
String savaPath = filePathdir + File.separatorChar + newDate + ".PDF";
|
||||
if (pPath.contains("E:\\ecgdata\\ECG")) {
|
||||
newPath = pPath.replace("E:\\ecgdata\\ECG", "Z:");
|
||||
} else {
|
||||
newPath = pPath.replace("E:\\ECGDATA\\ECG", "Z:");
|
||||
}
|
||||
// 构建网络文件的完整路径
|
||||
Path networkFilePath = Paths.get(newPath);
|
||||
// 从网络磁盘拷贝文件到本地磁盘
|
||||
try {
|
||||
Files.copy(networkFilePath, Paths.get(savaPath));
|
||||
} catch (Exception e) {
|
||||
log.error("记帐号为:" + list.getPatientId() + "的病历文件名为:" + networkFilePath.getFileName() + "的文件拷贝失败", e);
|
||||
continue;
|
||||
}
|
||||
//组织保存文件表数据
|
||||
ArchiveDetailDto archiveDetailDto = new ArchiveDetailDto();
|
||||
archiveDetailDto.setMasterId(list.getId());
|
||||
archiveDetailDto.setUploadDateTime(new Date());
|
||||
archiveDetailDto.setAssortId("DA342ED81CEE4A8EA827424626F3F577");
|
||||
archiveDetailDto.setSource("ECG");
|
||||
archiveDetailDto.setFlag("0");
|
||||
archiveDetailDto.setSys("ECG");
|
||||
archiveDetailDto.setTitle("心电图报告");
|
||||
archiveDetailDto.setPdfPath(savaPath);
|
||||
archiveDetailList.add(archiveDetailDto);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("记帐号为:" + list.getPatientId() + "的病历异常处理");
|
||||
return null;
|
||||
}
|
||||
return archiveDetailList;
|
||||
}
|
||||
|
||||
|
||||
private void deleteFliepath(List<ArchiveDetailVo> ecgList) {
|
||||
for (ArchiveDetailVo list : ecgList) {
|
||||
File file = new File(list.getPdfPath());
|
||||
try {
|
||||
file.delete(); // 删除照片
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean createDirectory(Path localPath) {
|
||||
try {
|
||||
if (!Files.exists(localPath)) {
|
||||
Files.createDirectories(localPath);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,228 +0,0 @@
|
||||
package com.shibofu.spring.db1.serviceImpl;
|
||||
|
||||
import com.shibofu.spring.db1.dao.ArchiveDetailDao;
|
||||
import com.shibofu.spring.db1.dao.ArchiveMasterDao;
|
||||
import com.shibofu.spring.db1.service.PacsPollingService;
|
||||
import com.shibofu.spring.db2.dao.PacsDao;
|
||||
import com.shibofu.spring.dto.ArchiveDetailDto;
|
||||
import com.shibofu.spring.dto.ArchiveMasterDto;
|
||||
import com.shibofu.spring.util.*;
|
||||
import com.shibofu.spring.vo.ArchiveDetailVo;
|
||||
import com.shibofu.spring.vo.ArchiveMasterVo;
|
||||
|
||||
import com.shibofu.spring.vo.PacsVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @ClassName PollingServiceImpl
|
||||
* @Description pacs轮询实现类
|
||||
* @Author linjj
|
||||
* @Date 2024/1/18 9:26
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PacsPollingServiceImpl implements PacsPollingService {
|
||||
@Value("${savePath}")
|
||||
private String savePath;
|
||||
|
||||
@Autowired
|
||||
private ArchiveDetailDao archiveDetailDao;
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(PacsPollingServiceImpl.class);
|
||||
@Autowired
|
||||
private ArchiveMasterDao archiveMasterDao;
|
||||
@Autowired
|
||||
private PacsDao pacsDao;
|
||||
|
||||
@Override
|
||||
public void PacsEveryDayPolling() {
|
||||
List<ArchiveMasterVo> archiveMasterVos = archiveMasterDao.PollingPacs();
|
||||
if (!CollectionUtils.isEmpty(archiveMasterVos)) {
|
||||
logger.info("一共:"+archiveMasterVos.size()+"条病历!!!!");
|
||||
gather(archiveMasterVos);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Msg pacsAnxu() {
|
||||
List<ArchiveMasterVo> archiveMasterVos = archiveMasterDao.PollingPacsAnXu();
|
||||
if (CollectionUtils.isEmpty(archiveMasterVos)) {
|
||||
return Msg.fail("无需采集数据");
|
||||
}
|
||||
gather(archiveMasterVos);
|
||||
return Msg.success("采集完成");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Msg PacsEveryWeekPolling() {
|
||||
List<ArchiveMasterVo> archiveMasterVos = archiveMasterDao.PacsEveryWeekPolling();
|
||||
if (CollectionUtils.isEmpty(archiveMasterVos)) {
|
||||
return Msg.fail("无需采集数据");
|
||||
}
|
||||
gather(archiveMasterVos);
|
||||
return Msg.success("采集完成");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Msg makeUpPacsByMasterId(String masterId) {
|
||||
List<ArchiveMasterVo> archiveMasterVos = archiveMasterDao.makeUpPacsByMasterId(masterId);
|
||||
if (CollectionUtils.isEmpty(archiveMasterVos)) {
|
||||
return Msg.fail("无需采集数据");
|
||||
}
|
||||
logger.info("一共:"+archiveMasterVos.size()+"条病历!!!!");
|
||||
gather(archiveMasterVos);
|
||||
return Msg.success("采集完成");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Msg makeUpPacsPush() {
|
||||
String masterId = archiveMasterDao.selectPacsPush();
|
||||
List<ArchiveMasterVo> archiveMasterVos = archiveMasterDao.makeUpPacsByMasterId(masterId);
|
||||
if (CollectionUtils.isEmpty(archiveMasterVos)) {
|
||||
return Msg.fail("无需采集数据");
|
||||
}
|
||||
gather(archiveMasterVos);
|
||||
archiveMasterDao.updatePacsCompenSate(masterId);
|
||||
return Msg.success("采集完成");
|
||||
}
|
||||
|
||||
|
||||
private void deleteFliepath(List<ArchiveDetailVo> listPath) {
|
||||
for (ArchiveDetailVo list : listPath) {
|
||||
archiveDetailDao.delSubAssort(list.getId());
|
||||
File file = new File(list.getPdfPath());
|
||||
try {
|
||||
file.delete(); // 删除照片
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void gather(List<ArchiveMasterVo> archiveMasterVos) {
|
||||
// 创建 JNI 实例
|
||||
PacsAutoPrintPDF.INSTANCE.setServerInfo("10.36.116.100", 204);
|
||||
for (ArchiveMasterVo list : archiveMasterVos) {
|
||||
try {
|
||||
ArchiveMasterDto dto = new ArchiveMasterDto();
|
||||
BeanUtils.copyProperties(list, dto);
|
||||
//根据入院前六小时出院后六小时住院号查询要下载pdf的路径
|
||||
List<PacsVo> vo = pacsDao.getVo(dto);
|
||||
if (CollectionUtils.isEmpty(vo)) {
|
||||
logger.info("该住院号时间内无数据" + list.getInpNo() + "住院次数为:" + list.getVisitId());
|
||||
continue;
|
||||
}
|
||||
logger.info("住院号为:"+list.getInpNo() + "住院次数为:" + list.getVisitId()+"当前记录为:"+vo.size()+"条");
|
||||
//插入文件表数据集合
|
||||
List<ArchiveDetailDto> ArchiveDetailList = new ArrayList<>();
|
||||
//需要同步的数据
|
||||
for (PacsVo pacsList : vo) {
|
||||
//查询文件是否存在,如果存在先删除后新增
|
||||
List<ArchiveDetailVo> subAssort = archiveDetailDao.getSubAssort(pacsList.getAccessionnumber());
|
||||
if (subAssort.size() > 0) {
|
||||
deleteFliepath(subAssort);
|
||||
}
|
||||
//使用yyyyMMddHHmmssSSS格式作为文件名
|
||||
Date date = new Date();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
||||
String newDate = format.format(date);
|
||||
//组织路径
|
||||
String filePathdir = savePath + File.separatorChar + list.getInpNo() + File.separatorChar + list.getVisitId();
|
||||
File file = new File(filePathdir);
|
||||
//判断文件夹是否存在不存在创建文件夹
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
String filePath = filePathdir + File.separatorChar + newDate + ".pdf";
|
||||
logger.info("-----------------文件id:" + pacsList.getAccessionnumber() + ",路径:" + filePath);
|
||||
// 调用 GetPDF 函数
|
||||
try {
|
||||
boolean result = PacsAutoPrintPDF.INSTANCE.GetPDF(pacsList.getAccessionnumber(), filePath);
|
||||
} catch (Throwable e) {
|
||||
logger.info(pacsList.getAccessionnumber()+"异常处理");
|
||||
continue;
|
||||
}
|
||||
//成功存在文件表中,不成功输出到日志中
|
||||
saveArchiveDetailDto(list, dto, ArchiveDetailList, pacsList, filePath);
|
||||
}
|
||||
//插入文件表
|
||||
boolean b = archiveDetailDao.addArchiveDetail(ArchiveDetailList);
|
||||
if (b) {
|
||||
ArchiveDetailList.clear();
|
||||
logger.info("住院号:" + list.getInpNo() + "住院次数为:" + list.getVisitId() + "采集完成");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.info(list.getId()+"异常处理");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void saveArchiveDetailDto(ArchiveMasterVo list, ArchiveMasterDto dto, List<ArchiveDetailDto> ArchiveDetailList, PacsVo pacsList, String filePath) {
|
||||
//成功存在文件表中,不成功输出到日志中
|
||||
if (new File(filePath).exists()) {
|
||||
ArchiveDetailDto archiveDetailDto = new ArchiveDetailDto();
|
||||
archiveDetailDto.setMasterId(dto.getId());
|
||||
archiveDetailDto.setUploadDateTime(new Date());
|
||||
String emrAssort = getEmrAssort(pacsList.getProf());
|
||||
archiveDetailDto.setAssortId(emrAssort);
|
||||
archiveDetailDto.setSource("pacs");
|
||||
archiveDetailDto.setFlag("0");
|
||||
archiveDetailDto.setTitle(pacsList.getExamItem());
|
||||
archiveDetailDto.setPdfPath(filePath);
|
||||
archiveDetailDto.setSubAssort(pacsList.getAccessionnumber());
|
||||
ArchiveDetailList.add(archiveDetailDto);
|
||||
//记录保存文件表
|
||||
} else {
|
||||
logger.info("-----------------住院号:" + list.getInpNo() + ",文件名:" + pacsList.getExamItem() + "解析不返回图片");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String getEmrAssort(String prof) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("1", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("2", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("3", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("4", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("5", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("6", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("7", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("8", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("9", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("20", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("22", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("23", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("24", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("25", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("26", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("27", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("28", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("29", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("30", "DE599D770E8347CCB5122BC357D96F37");
|
||||
map.put("32", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("33", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("34", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
map.put("36", "DE599D770E8347CCB5122BC357D96F37");
|
||||
map.put("37", "DE599D770E8347CCB5122BC357D96F37");
|
||||
map.put("38", "DE599D770E8347CCB5122BC357D96F37");
|
||||
map.put("39", "DA342ED81CEE4A8EA827424626F3F577");
|
||||
return map.get(prof);
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.shibofu.spring.db2.dao;
|
||||
|
||||
import com.shibofu.spring.vo.ECGVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ECGDao
|
||||
* @Description 心跳接口
|
||||
* @Author linjj
|
||||
* @Date 2024/7/8 9:05
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface ECGDao {
|
||||
|
||||
List<ECGVo> getECG(@Param("patientID") String patientID);
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package com.shibofu.spring.db2.dao;
|
||||
|
||||
import com.shibofu.spring.dto.ArchiveMasterDto;
|
||||
import com.shibofu.spring.vo.PacsVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName PacsDao
|
||||
* @Description
|
||||
* @Author linjj
|
||||
* @Date 2024/1/18 15:35
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface PacsDao {
|
||||
|
||||
List<PacsVo> getVo(ArchiveMasterDto archiveMasterDto);
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
package com.shibofu.spring.db3.dao;
|
||||
|
||||
import com.shibofu.spring.vo.CostListVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName CostListServiceMapper
|
||||
* @Description
|
||||
* @Author linjj
|
||||
* @Date 2024/5/22 10:30
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface CostListDao {
|
||||
|
||||
List<CostListVo>getCostList(int offset);
|
||||
|
||||
int getConut();
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package com.shibofu.spring.db3.service;
|
||||
|
||||
/**
|
||||
* @InterfaceName CostListService
|
||||
* @Description 费用清单接口
|
||||
* @Author linjj
|
||||
* @Date 2024/5/22 10:18
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface CostListService {
|
||||
|
||||
void collectionCostList();
|
||||
}
|
@ -1,141 +0,0 @@
|
||||
package com.shibofu.spring.db3.serviceImpl;
|
||||
|
||||
import com.shibofu.spring.db1.dao.ArchiveDetailDao;
|
||||
import com.shibofu.spring.db1.dao.ArchiveMasterDao;
|
||||
import com.shibofu.spring.db3.dao.CostListDao;
|
||||
import com.shibofu.spring.db3.service.CostListService;
|
||||
import com.shibofu.spring.dto.ArchiveDetailDto;
|
||||
import com.shibofu.spring.vo.ArchiveDetailVo;
|
||||
import com.shibofu.spring.vo.CostListVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName CostListServiceImpl
|
||||
* @Description 费用清单
|
||||
* @Author linjj
|
||||
* @Date 2024/5/22 10:19
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class CostListServiceImpl implements CostListService {
|
||||
|
||||
@Autowired
|
||||
private CostListDao costListDao;
|
||||
@Autowired
|
||||
private ArchiveMasterDao archiveMasterDao;
|
||||
@Autowired
|
||||
private ArchiveDetailDao archiveDetailDao;
|
||||
@Value("${savePath}")
|
||||
private String savePath;
|
||||
|
||||
|
||||
/**
|
||||
* @description: 采集费用清单
|
||||
* @author linjj
|
||||
* @date: 2024/5/22 10:21
|
||||
*/
|
||||
@Override
|
||||
public void collectionCostList() {
|
||||
//插入文件表数据集合
|
||||
List<ArchiveDetailDto> ArchiveDetailList = new ArrayList<>();
|
||||
//查询一共有多条记录
|
||||
int conut = costListDao.getConut();
|
||||
//每次查询50条记录
|
||||
int pollingNum = (int) Math.floor((double) conut / (double) 50);
|
||||
for (int i = 0; i <= pollingNum; i++) {
|
||||
//每次查询50条记录
|
||||
int offset = i * 50;
|
||||
//查询需要采集清单病历
|
||||
List<CostListVo> costList = costListDao.getCostList(offset);
|
||||
if (!CollectionUtils.isEmpty(costList)) {
|
||||
log.info("费用清单本次采集" + costList.size() + "份!!!");
|
||||
for (CostListVo list : costList) {
|
||||
if (StringUtils.isEmpty(list.getFpdf())) {
|
||||
log.info(list.getFjzh() + "路径为空!!");
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
download(list, ArchiveDetailList);
|
||||
} catch (IOException e) {
|
||||
log.info(e.getMessage());
|
||||
}
|
||||
}
|
||||
archiveDetailDao.addArchiveDetail(ArchiveDetailList);
|
||||
log.info("完成采集" + ArchiveDetailList.size() + "份!!!");
|
||||
ArchiveDetailList.clear();
|
||||
}
|
||||
}
|
||||
log.info("本次采集没有费用清单记录");
|
||||
}
|
||||
|
||||
private void download(CostListVo costListVo, List<ArchiveDetailDto> ArchiveDetailList) throws IOException {
|
||||
ArchiveDetailDto archiveDetailDto = new ArchiveDetailDto();
|
||||
//使用yyyyMMddHHmmssSSS格式作为文件名
|
||||
Date date = new Date();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
||||
String newDate = format.format(date);
|
||||
//根据jzh查询患者主键id
|
||||
String masterId = archiveMasterDao.getIdbyJzh(costListVo.getFjzh());
|
||||
//判断文件是否存在存在删除后新增不存在新增
|
||||
List<ArchiveDetailVo> subAssort = archiveDetailDao.getSubAssort(masterId);
|
||||
if (subAssort.size() > 0) {
|
||||
deleteFliepath(subAssort);
|
||||
}
|
||||
//组织保存目录
|
||||
String filePathdir = savePath + File.separatorChar + costListVo.getFpatid() + File.separatorChar + costListVo.getFtimes();
|
||||
File file = new File(filePathdir);
|
||||
//判断文件夹是否存在不存在创建文件夹
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
//文件保存路径
|
||||
String filePath = filePathdir + File.separatorChar + newDate + ".pdf";
|
||||
//下载文件
|
||||
try (FileOutputStream fileOutputStream = new FileOutputStream(filePath)) {
|
||||
// 将二进制数据写入文件
|
||||
fileOutputStream.write(costListVo.getFpdf());
|
||||
fileOutputStream.flush();
|
||||
} catch (IOException e) {
|
||||
log.info(masterId + "异常处理" + e.getMessage());
|
||||
}
|
||||
//保存文件表
|
||||
archiveDetailDto.setMasterId(masterId);
|
||||
archiveDetailDto.setUploadDateTime(new Date());
|
||||
archiveDetailDto.setAssortId("DE599D770E8347CCB5122BC357D96F47");
|
||||
archiveDetailDto.setSource("pacs");
|
||||
archiveDetailDto.setFlag("0");
|
||||
archiveDetailDto.setTitle("费用结算清单");
|
||||
archiveDetailDto.setPdfPath(filePath);
|
||||
archiveDetailDto.setSubAssort(masterId);
|
||||
ArchiveDetailList.add(archiveDetailDto);
|
||||
}
|
||||
|
||||
|
||||
private void deleteFliepath(List<ArchiveDetailVo> listPath) {
|
||||
for (ArchiveDetailVo list : listPath) {
|
||||
archiveDetailDao.delSubAssort(list.getId());
|
||||
File file = new File(list.getPdfPath());
|
||||
try {
|
||||
file.delete(); // 删除照片
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.shibofu.spring.quartz;
|
||||
|
||||
|
||||
|
||||
import com.shibofu.spring.db1.service.ECGPollingService;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @description: pacs定时任务采集
|
||||
* @author linjj
|
||||
* @date: 2024/1/18 9:22
|
||||
*/
|
||||
public class ECGQuartz extends QuartzJobBean {
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
private ECGPollingService ecgPollingService;
|
||||
|
||||
@Override
|
||||
protected void executeInternal(JobExecutionContext jobExecutionContext) {
|
||||
//每天轮询查询昨天数据进来采集
|
||||
ecgPollingService.ECGDayPolling();
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package com.shibofu.spring.quartz;
|
||||
|
||||
|
||||
|
||||
import com.shibofu.spring.db1.dao.ArchiveMasterDao;
|
||||
import com.shibofu.spring.db1.service.PacsPollingService;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @description: pacs定时任务轮询
|
||||
* @author linjj
|
||||
* @date: 2024/41/29 9:22
|
||||
*/
|
||||
public class PacsPushQuartz extends QuartzJobBean {
|
||||
|
||||
@Resource
|
||||
private PacsPollingService pacsPollingService;
|
||||
|
||||
|
||||
@Override
|
||||
protected void executeInternal(JobExecutionContext jobExecutionContext) {
|
||||
//查询1条需要采集的记录
|
||||
pacsPollingService.makeUpPacsPush();
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
package com.shibofu.spring.quartz;
|
||||
|
||||
|
||||
|
||||
import com.shibofu.spring.db1.service.PacsPollingService;
|
||||
import com.shibofu.spring.db3.service.CostListService;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @description: pacs定时任务采集
|
||||
* @author linjj
|
||||
* @date: 2024/1/18 9:22
|
||||
*/
|
||||
public class PacsQuartz extends QuartzJobBean {
|
||||
|
||||
@Resource
|
||||
private PacsPollingService pacsPollingService;
|
||||
@Resource
|
||||
private CostListService costListService;
|
||||
|
||||
@Override
|
||||
protected void executeInternal(JobExecutionContext jobExecutionContext) {
|
||||
//每天轮询查询昨天数据进来采集
|
||||
pacsPollingService.PacsEveryDayPolling();
|
||||
//费用清单采集
|
||||
costListService.collectionCostList();
|
||||
//每天轮询查询一周内数据进来采集
|
||||
pacsPollingService.PacsEveryWeekPolling();
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
package com.shibofu.spring.util;
|
||||
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Platform;
|
||||
import com.sun.jna.win32.StdCallLibrary;
|
||||
|
||||
public interface PacsAutoPrintPDF extends StdCallLibrary {
|
||||
PacsAutoPrintPDF INSTANCE = (PacsAutoPrintPDF) Native.loadLibrary(
|
||||
(Platform.isWindows() ? "PacsAutoPrintPDF" : "c"),
|
||||
PacsAutoPrintPDF.class);
|
||||
|
||||
boolean GetPDF(String accessionNumber, String filename);
|
||||
void setServerInfo(String host, int port);
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package com.shibofu.spring.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName CostListVo
|
||||
* @Description 采集病历清单实体
|
||||
* @Author linjj
|
||||
* @Date 2024/5/22 10:32
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class CostListVo {
|
||||
|
||||
//住院号
|
||||
private String fpatid;
|
||||
//住院次数
|
||||
private String ftimes;
|
||||
//二进制文件
|
||||
private byte[] fpdf;
|
||||
//记帐号
|
||||
private String fjzh;
|
||||
//出院时间
|
||||
private String ffirstdate;
|
||||
//最后更新时间
|
||||
private String fnewdate;
|
||||
//文件地址
|
||||
private String filepath;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.shibofu.spring.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName ECGVo
|
||||
* @Description 心跳返回实体类
|
||||
* @Author linjj
|
||||
* @Date 2024/7/8 9:09
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ECGVo {
|
||||
private String patientId;
|
||||
|
||||
private String WriteDateTime;
|
||||
|
||||
private String PPath;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package com.shibofu.spring.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName PacsVo
|
||||
* @Description pacs视图返回
|
||||
* @Author linjj
|
||||
* @Date 2024/1/18 15:34
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PacsVo {
|
||||
//文件唯一标识
|
||||
private String accessionnumber;
|
||||
//文件名
|
||||
private String ExamItem;
|
||||
|
||||
private String prof;
|
||||
}
|
@ -1,36 +1,27 @@
|
||||
server.port=3391
|
||||
server.port=3397
|
||||
#sqlserver
|
||||
spring.datasource.hikari.db1.jdbc-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=yd_record
|
||||
spring.datasource.hikari.db1.username=sa
|
||||
spring.datasource.hikari.db1.password=admin123
|
||||
spring.datasource.hikari.db1.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
##sqlserver
|
||||
spring.datasource.hikari.db2.jdbc-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=yd_record
|
||||
spring.datasource.hikari.db2.username=sa
|
||||
spring.datasource.hikari.db2.password=admin123
|
||||
spring.datasource.hikari.db2.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
#pg
|
||||
spring.datasource.hikari.db3.jdbc-url=jdbc:postgresql://localhost:5432/yd
|
||||
spring.datasource.hikari.db3.username=postgres
|
||||
spring.datasource.hikari.db3.password=admin123
|
||||
spring.datasource.hikari.db3.driver-class-name=org.postgresql.Driver
|
||||
|
||||
|
||||
#sqlserver
|
||||
#spring.datasource.hikari.db1.jdbc-url=jdbc:sqlserver://10.36.116.108:1433;DatabaseName=emr_record
|
||||
#spring.datasource.hikari.db1.jdbc-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=yd_record
|
||||
#spring.datasource.hikari.db1.username=sa
|
||||
#spring.datasource.hikari.db1.password=xjgs+docus911
|
||||
#spring.datasource.hikari.db1.password=admin123
|
||||
#spring.datasource.hikari.db1.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
##sqlserver
|
||||
#spring.datasource.hikari.db2.jdbc-url=jdbc:sqlserver://10.36.116.100:1433;DatabaseName=pacsdb
|
||||
#spring.datasource.hikari.db2.username=AP
|
||||
#spring.datasource.hikari.db2.password=AP
|
||||
###sqlserver
|
||||
#spring.datasource.hikari.db2.jdbc-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=qf_record
|
||||
#spring.datasource.hikari.db2.username=sa
|
||||
#spring.datasource.hikari.db2.password=admin123
|
||||
#spring.datasource.hikari.db2.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
##pg
|
||||
#spring.datasource.hikari.db3.jdbc-url=jdbc:postgresql://192.168.55.230:5432/postgres
|
||||
#spring.datasource.hikari.db3.username=postgres
|
||||
#spring.datasource.hikari.db3.password=pl4grWwt
|
||||
#spring.datasource.hikari.db3.driver-class-name=org.postgresql.Driver
|
||||
|
||||
|
||||
#sqlserver
|
||||
spring.datasource.hikari.db1.jdbc-url=jdbc:sqlserver://10.36.116.108:1433;DatabaseName=emr_record
|
||||
spring.datasource.hikari.db1.username=sa
|
||||
spring.datasource.hikari.db1.password=xjgs+docus911
|
||||
spring.datasource.hikari.db1.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
#ECG
|
||||
spring.datasource.hikari.db2.jdbc-url=jdbc:sqlserver://192.168.10.50:1433;DatabaseName=medexmemrsECG
|
||||
spring.datasource.hikari.db2.username=sa
|
||||
spring.datasource.hikari.db2.password=MedExSQLServerAdmin
|
||||
spring.datasource.hikari.db2.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
|
||||
# MyBatis-Plus ??
|
||||
mybatis-plus.mapper-locations=classpath:mapper/db1/*.xml,classpath:mapper/db2/*.xml
|
||||
mybatis-plus.type-aliases-package=com.shibofu.spring.vo
|
||||
|
@ -1,7 +1,4 @@
|
||||
#文件保存路径
|
||||
savePath: F:\jiashi\reload
|
||||
savePath: F:\ECG\reload
|
||||
#定时补偿任务时间
|
||||
quartzTime: 0 0 1 * * ?
|
||||
#定时轮速pacs任务表时间
|
||||
pacsQuartzTime: 0 */1 * * * ?
|
||||
#quartzTime: "0 10 16 * * ?
|
||||
quartzTime: 0 0 3 * * ?
|
||||
|
@ -0,0 +1,11 @@
|
||||
<?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.shibofu.spring.db2.dao.ECGDao">
|
||||
|
||||
|
||||
<select id="getECG" resultType="com.shibofu.spring.vo.ECGVo">
|
||||
select patientid AS patientId, WriteDateTime, ReportFileLocate+reportfileName 'PPath' from [dbo].[v_EMR_Report] where PatientID=#{patientID}
|
||||
</select>
|
||||
</mapper>
|
@ -1,16 +0,0 @@
|
||||
<?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.shibofu.spring.db2.dao.PacsDao">
|
||||
|
||||
|
||||
<select id="getVo" resultType="com.shibofu.spring.vo.PacsVo">
|
||||
SELECT accessionnumber,
|
||||
ExamItem,
|
||||
prof
|
||||
FROM pacsdb.dbo.AutoPrint_1
|
||||
WHERE RegisterDT BETWEEN DATEADD(hh, -6, #{admissionDateTime}) and DATEADD(hh, 6, #{dischargeDateTime})
|
||||
AND (OutHospitalNo = #{inpNo} OR InHospitalNo = #{inpNo} OR PhysicalNumber = #{inpNo} )
|
||||
</select>
|
||||
</mapper>
|
@ -1,19 +0,0 @@
|
||||
<?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.shibofu.spring.db3.dao.CostListDao">
|
||||
|
||||
<select id="getConut" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
from public.bajsdpdf
|
||||
where fnewdate between CURRENT_DATE - INTERVAL '6 days' AND CURRENT_DATE
|
||||
</select>
|
||||
<select id="getCostList" resultType="com.shibofu.spring.vo.CostListVo">
|
||||
SELECT fpatid, ftimes, fpdf, fjzh, ffirstdate, fnewdate, filepath
|
||||
FROM public.bajsdpdf
|
||||
where fnewdate between CURRENT_DATE - INTERVAL '6 days' AND CURRENT_DATE
|
||||
order by fnewdate DESC
|
||||
LIMIT 50 OFFSET #{offset}
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue