feat:初始化广东省中医,住院电子病历和住院护理推送服务
commit
004b4b84ed
@ -0,0 +1,36 @@
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
docus-services/docus-services-system1/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
*.log
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
mvnw*
|
||||
*.cmd
|
||||
*.mvn
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
logs*
|
||||
rebel.xml
|
||||
@ -0,0 +1,4 @@
|
||||
{
|
||||
"assortId": "xxxxId",
|
||||
"collectorId": "22"
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
{
|
||||
"assortId": "hlxxxxId",
|
||||
"collectorId": "1"
|
||||
}
|
||||
@ -0,0 +1,161 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.5.6</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.docus</groupId>
|
||||
<artifactId>docus-gdszy-report</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>docus-gdszy-report</name>
|
||||
<description>广东省中医院报告服务</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dom4j</groupId>
|
||||
<artifactId>dom4j</artifactId>
|
||||
<version>2.1.1</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/jaxen/jaxen -->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.75</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.15</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.14</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.docus</groupId>
|
||||
<artifactId>docus-tool-starter</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.spring4all</groupId>
|
||||
<artifactId>swagger-spring-boot-starter</artifactId>
|
||||
<version>1.9.0.RELEASE</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcore</artifactId>
|
||||
<version>4.4.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpmime</artifactId>
|
||||
<version>4.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.axis</groupId>
|
||||
<artifactId>axis</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.axis/axis-jaxrpc -->
|
||||
<dependency>
|
||||
<groupId>org.apache.axis</groupId>
|
||||
<artifactId>axis-jaxrpc</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/commons-discovery/commons-discovery -->
|
||||
<dependency>
|
||||
<groupId>commons-discovery</groupId>
|
||||
<artifactId>commons-discovery</artifactId>
|
||||
<version>0.2</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/wsdl4j/wsdl4j -->
|
||||
<dependency>
|
||||
<groupId>wsdl4j</groupId>
|
||||
<artifactId>wsdl4j</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.axis</groupId>
|
||||
<artifactId>axis</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-discovery</groupId>
|
||||
<artifactId>commons-discovery</artifactId>
|
||||
<version>0.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.axis</groupId>
|
||||
<artifactId>axis-jaxrpc</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,19 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@EnableScheduling
|
||||
@SpringBootApplication
|
||||
public class DemoApplication {
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
|
||||
SpringApplication.run(DemoApplication.class, args);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.docus.bgts.config;
|
||||
|
||||
|
||||
/**
|
||||
* @Description 自定义异常
|
||||
* @Author JacksonTu
|
||||
* @Date 2018/12/10 13:59
|
||||
*/
|
||||
|
||||
|
||||
public class BaseException extends RuntimeException implements IErrorCode {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 异常编码
|
||||
*/
|
||||
private String msgCode;
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String message;
|
||||
|
||||
|
||||
|
||||
public BaseException(IErrorCode errorCode) {
|
||||
super(errorCode.getMessage());
|
||||
this.msgCode = errorCode.getCode();
|
||||
this.message = errorCode.getMessage();
|
||||
}
|
||||
|
||||
|
||||
public BaseException(IErrorCode errorCode,String msg) {
|
||||
super(errorCode.getMessage());
|
||||
this.msgCode = errorCode.getCode();
|
||||
this.message = msg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public BaseException(String message) {
|
||||
super(message);
|
||||
this.msgCode = "Sys1001";
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getCode() {
|
||||
return this.msgCode;
|
||||
}
|
||||
@Override
|
||||
public String getMessage(){
|
||||
return this.message;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.config;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("响应")
|
||||
@Data
|
||||
public class CommonResult<T> {
|
||||
@ApiModelProperty("响应码")
|
||||
private Integer code;
|
||||
@ApiModelProperty("业务异常错误码")
|
||||
private String msgCode;
|
||||
@ApiModelProperty("响应消息")
|
||||
private String msg;
|
||||
@ApiModelProperty("响应实体")
|
||||
private T data;
|
||||
|
||||
public CommonResult() {
|
||||
}
|
||||
|
||||
public CommonResult(Integer code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public CommonResult(Integer code, String msgCode, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public CommonResult(final Integer code, final String msgCode, final String msg, final T data) {
|
||||
this.code = code;
|
||||
this.msgCode = msgCode;
|
||||
this.msg = msg;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.docus.bgts.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author YongBin Wen
|
||||
* @date 2024/3/29 14:00
|
||||
*/
|
||||
@Component
|
||||
@Data
|
||||
public class DocusServerUrlConfig {
|
||||
|
||||
|
||||
@Value("${docus.url.downploadlatform-server}")
|
||||
private String downloadPlatformServerUrl;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.config;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.jws.WebService;
|
||||
|
||||
/**
|
||||
* @author wyb
|
||||
*/
|
||||
@WebService
|
||||
@Service
|
||||
public class EmptyWebService implements IEmptyWebService {}
|
||||
@ -0,0 +1,16 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.config;
|
||||
|
||||
import javax.jws.WebService;
|
||||
|
||||
/**
|
||||
* @author wyb
|
||||
*/
|
||||
@WebService
|
||||
public interface IEmptyWebService {
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package com.docus.bgts.config;
|
||||
|
||||
/**
|
||||
* @Description 封装API的错误码
|
||||
* @Author JacksonTu
|
||||
* @Date 2020/3/28 16:26
|
||||
*/
|
||||
public interface IErrorCode {
|
||||
String getCode();
|
||||
|
||||
String getMessage();
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.config;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties;
|
||||
import com.baomidou.mybatisplus.core.MybatisConfiguration;
|
||||
import com.baomidou.mybatisplus.core.config.GlobalConfig;
|
||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
import org.apache.ibatis.logging.nologging.NoLoggingImpl;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.beans.ConstructorProperties;
|
||||
import java.util.Objects;
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@MapperScan({"com.docus.bgts.**.mapper"})
|
||||
@ConditionalOnClass({PaginationInterceptor.class})
|
||||
public class MybatisPlusConfig {
|
||||
private final MybatisPlusProperties mybatisPlusProperties;
|
||||
|
||||
@Bean
|
||||
public PaginationInterceptor paginationInterceptor() {
|
||||
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
|
||||
return paginationInterceptor;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void initMybatisConfig() {
|
||||
this.mybatisPlusProperties.setMapperLocations(new String[]{"classpath*:/mapper/*Mapper.xml"});
|
||||
this.mybatisPlusProperties.setTypeAliasesPackage("com.docus.bgts.wzh.entity");
|
||||
MybatisConfiguration configuration = this.mybatisPlusProperties.getConfiguration();
|
||||
if (Objects.isNull(configuration)) {
|
||||
configuration = new MybatisConfiguration();
|
||||
}
|
||||
|
||||
configuration.setMapUnderscoreToCamelCase(true);
|
||||
configuration.setCacheEnabled(true);
|
||||
configuration.setLogImpl(NoLoggingImpl.class);
|
||||
this.mybatisPlusProperties.setConfiguration(configuration);
|
||||
GlobalConfig globalConfig = this.mybatisPlusProperties.getGlobalConfig();
|
||||
if (Objects.isNull(globalConfig)) {
|
||||
globalConfig = new GlobalConfig();
|
||||
}
|
||||
|
||||
GlobalConfig.DbConfig dbConfig = globalConfig.getDbConfig();
|
||||
if (Objects.isNull(dbConfig)) {
|
||||
dbConfig = new GlobalConfig.DbConfig();
|
||||
}
|
||||
|
||||
configuration.setCallSettersOnNulls(true);
|
||||
dbConfig.setIdType(IdType.ASSIGN_ID);
|
||||
dbConfig.setTableUnderline(true);
|
||||
dbConfig.setLogicDeleteValue("1");
|
||||
dbConfig.setLogicNotDeleteValue("0");
|
||||
dbConfig.setLogicDeleteField("def_flag");
|
||||
globalConfig.setDbConfig(dbConfig);
|
||||
globalConfig.setBanner(false);
|
||||
}
|
||||
|
||||
@ConstructorProperties({"mybatisPlusProperties"})
|
||||
public MybatisPlusConfig(final MybatisPlusProperties mybatisPlusProperties) {
|
||||
this.mybatisPlusProperties = mybatisPlusProperties;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.config;
|
||||
|
||||
public enum ResultCode {
|
||||
SUCCESS(0, "操作成功"),
|
||||
FAILED(500, "操作失败"),
|
||||
VALIDATE_FAILED(404, "参数检验失败"),
|
||||
BASE_EXCEPTION(406, "业务异常"),
|
||||
UNAUTHORIZED(401, "暂未登录或token已经过期"),
|
||||
FORBIDDEN(403, "没有相关权限"),
|
||||
PREVENT_REPLAY(405, "重复请求"),
|
||||
NOT_EXIST(601, "数据不存在"),
|
||||
NOT_ENABLE(600, "数据未启用");
|
||||
|
||||
private Integer code;
|
||||
private String message;
|
||||
|
||||
private ResultCode(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return this.message;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Configuration
|
||||
public class ThreadPoolConfig {
|
||||
@Bean
|
||||
public ThreadPoolExecutor threadPoolExecutor() {
|
||||
return new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(),
|
||||
(int) ((double) Runtime.getRuntime().availableProcessors() * 2),
|
||||
60L, TimeUnit.SECONDS,
|
||||
new LinkedBlockingQueue<>(200),
|
||||
Executors.defaultThreadFactory(),
|
||||
new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.config;
|
||||
|
||||
import com.docus.bgts.emr.handler.IEmrWebService;
|
||||
import com.docus.bgts.nursing.handler.NursingWebService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.xml.ws.Endpoint;
|
||||
|
||||
@Configuration
|
||||
@Slf4j
|
||||
public class WebServiceConfig {
|
||||
@Value("${system.code}")
|
||||
private String systemCode;
|
||||
@Value("${system.prop}")
|
||||
private String systemProp;
|
||||
@Value("${system.type}")
|
||||
private String systemType;
|
||||
|
||||
@Autowired
|
||||
private EmptyWebService emptyWebService;
|
||||
@Autowired
|
||||
private IEmrWebService emrWebService;
|
||||
@Autowired
|
||||
private NursingWebService nursingWebService;
|
||||
|
||||
|
||||
@Bean
|
||||
public Endpoint endpoint() {
|
||||
String address = "http://0.0.0.0:" + this.systemProp + "/" + this.systemCode;
|
||||
Object implementor = emptyWebService;
|
||||
// 住院电子病历
|
||||
if ("emr".equalsIgnoreCase(systemType)) {
|
||||
implementor = emrWebService;
|
||||
}
|
||||
// 住院护理
|
||||
if ("nursing".equalsIgnoreCase(systemType)) {
|
||||
implementor = nursingWebService;
|
||||
}
|
||||
|
||||
Endpoint publish = Endpoint.publish(address, implementor);
|
||||
log.info("WebService服务已发布,发布地址:{},发布处理类:{}", address, implementor.getClass().getName());
|
||||
return publish;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
package com.docus.bgts.emr.convert;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.docus.bgts.emr.dto.EmrInfo;
|
||||
import com.docus.bgts.utils.XmlUtil;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author YongBin Wen
|
||||
* @date 2025/11/17 星期一 16:12
|
||||
*/
|
||||
public class EmrWsConvert {
|
||||
public static EmrInfo convertEmrInfo(XmlUtil xmlUtil) {
|
||||
String jzh;
|
||||
String submitTime;
|
||||
String inpatientNo;
|
||||
Integer admissTimes = null;
|
||||
String pathologicalDiagnosisFlag;
|
||||
String chrgDocCode;
|
||||
String chrgDocName;
|
||||
String recSubCode;
|
||||
String recSubName;
|
||||
ArrayList<EmrInfo.ReportItem> reportItems = new ArrayList<>();
|
||||
|
||||
Node jzhNode = xmlUtil.getNode("/Request/Msg/INHOSP_NO");
|
||||
jzh = jzhNode.getTextContent();
|
||||
Node submitTimeNode = xmlUtil.getNode("/Request/Msg/SUBMIT_TIME");
|
||||
submitTime = submitTimeNode.getTextContent();
|
||||
Node inpatientNoNode = xmlUtil.getNode("/Request/Msg/INHOSP_INDEX_NO");
|
||||
inpatientNo = inpatientNoNode.getTextContent();
|
||||
Node admissTimesNode = xmlUtil.getNode("/Request/Msg/INHOSP_NUM");
|
||||
if (StrUtil.isNotBlank(admissTimesNode.getTextContent())) {
|
||||
admissTimes = Integer.parseInt(admissTimesNode.getTextContent());
|
||||
}
|
||||
Node pathologicalDiagnosisFlagNode = xmlUtil.getNode("/Request/Msg/PATHOLOGICAL_DIAGNOSIS_FLAG");
|
||||
pathologicalDiagnosisFlag = pathologicalDiagnosisFlagNode.getTextContent();
|
||||
Node chrgDocCodeNode = xmlUtil.getNode("/Request/Msg/CHRG_DOC_CODE");
|
||||
chrgDocCode = chrgDocCodeNode.getTextContent();
|
||||
Node chrgDocNameNode = xmlUtil.getNode("/Request/Msg/CHRG_DOC_NAME");
|
||||
chrgDocName = chrgDocNameNode.getTextContent();
|
||||
Node recSubCodeNode = xmlUtil.getNode("/Request/Msg/REC_SUB_CODE");
|
||||
recSubCode = recSubCodeNode.getTextContent();
|
||||
Node recSubNameNode = xmlUtil.getNode("/Request/Msg/REC_SUB_NAME");
|
||||
recSubName = recSubNameNode.getTextContent();
|
||||
|
||||
NodeList reportItemNodeList = xmlUtil.getNodeList("/Request/Msg/ITEM");
|
||||
int reportItemNodeListLength = reportItemNodeList.getLength();
|
||||
if (reportItemNodeListLength > 0) {
|
||||
for (int i = 1; i <= reportItemNodeListLength; i++) {
|
||||
Node idNoNode = xmlUtil.getNode("/Request/Msg/ITEM[" + i + "]/IDNO");
|
||||
Node pdfPathNode = xmlUtil.getNode("/Request/Msg/ITEM[" + i + "]/PDF_PATH");
|
||||
Node fileNameNode = xmlUtil.getNode("/Request/Msg/ITEM[" + i + "]/FILENAME");
|
||||
Node minTimeNode = xmlUtil.getNode("/Request/Msg/ITEM[" + i + "]/MIN_TIME");
|
||||
Node maxTimeNode = xmlUtil.getNode("/Request/Msg/ITEM[" + i + "]/MAX_TIME");
|
||||
EmrInfo.ReportItem item = new EmrInfo.ReportItem();
|
||||
item.setIdNo(idNoNode.getTextContent());
|
||||
item.setPdfPath(pdfPathNode.getTextContent());
|
||||
item.setFileName(fileNameNode.getTextContent());
|
||||
item.setMinTime(minTimeNode.getTextContent());
|
||||
item.setMaxTime(maxTimeNode.getTextContent());
|
||||
reportItems.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
EmrInfo emrInfo = new EmrInfo();
|
||||
emrInfo.setJzh(jzh);
|
||||
emrInfo.setSubmitTime(submitTime);
|
||||
emrInfo.setInpatientNo(inpatientNo);
|
||||
emrInfo.setAdmissTimes(admissTimes);
|
||||
emrInfo.setPathologicalDiagnosisFlag(pathologicalDiagnosisFlag);
|
||||
emrInfo.setChrgDocCode(chrgDocCode);
|
||||
emrInfo.setChrgDocName(chrgDocName);
|
||||
emrInfo.setRecSubCode(recSubCode);
|
||||
emrInfo.setRecSubName(recSubName);
|
||||
emrInfo.setReportItemList(reportItems);
|
||||
return emrInfo;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.emr.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SystemCollectConfig {
|
||||
private String sealCollectClassify;
|
||||
private List<CollectConfig> sealCollectConfigs;
|
||||
|
||||
|
||||
@Data
|
||||
public static class CollectConfig {
|
||||
private String desc;
|
||||
private String url;
|
||||
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
}
|
||||
|
||||
public static enum Classify {
|
||||
SEAL_COLLECT("SEAL_COLLECT");
|
||||
|
||||
final String classify;
|
||||
|
||||
private Classify(String classify) {
|
||||
this.classify = classify;
|
||||
}
|
||||
|
||||
public String getClassify() {
|
||||
return this.classify;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.emr.enums;
|
||||
|
||||
public enum Codes {
|
||||
JSON_ADDRESS("999", "\\dataConfig\\homeQualitySet.json"),
|
||||
MSG("201", "Msg"),
|
||||
DIRECTORY("1000", "directory"),
|
||||
UPLOAD("0", "uploadConnector"),
|
||||
SEALUPLOAD("0", "sealUpload"),
|
||||
REPOAL("0", "repoalConnector"),
|
||||
assortid("assortid", "assortidKey"),
|
||||
collectorid("collectorid", "collectoridKey"),
|
||||
EMP_ID("0", "indexFlag");
|
||||
|
||||
private String code;
|
||||
private String message;
|
||||
|
||||
private Codes(String code, String messgae) {
|
||||
this.code = code;
|
||||
this.message = messgae;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return this.message;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,476 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.emr.handler;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.docus.bgts.config.BaseException;
|
||||
import com.docus.bgts.config.CommonResult;
|
||||
import com.docus.bgts.config.ResultCode;
|
||||
import com.docus.bgts.emr.convert.EmrWsConvert;
|
||||
import com.docus.bgts.emr.dto.EmrInfo;
|
||||
import com.docus.bgts.emr.dto.SystemCollectConfig;
|
||||
import com.docus.bgts.rpc.DownPlatformService;
|
||||
import com.docus.bgts.rpc.dto.ReportDownDto;
|
||||
import com.docus.bgts.rpc.dto.ReportDownPatientDto;
|
||||
import com.docus.bgts.rpc.dto.ReportDownScanFileDto;
|
||||
import com.docus.bgts.utils.FileUtils;
|
||||
import com.docus.bgts.utils.HttpUtils;
|
||||
import com.docus.bgts.utils.TableJsonRead;
|
||||
import com.docus.bgts.utils.XmlUtil;
|
||||
import com.docus.bgts.utils.XmlUtils;
|
||||
import com.docus.bgts.wzh.entity.CanlcelDto;
|
||||
import com.docus.bgts.wzh.entity.ZdAssort;
|
||||
import com.docus.bgts.wzh.facade.IAfCollectTaskService;
|
||||
import com.docus.bgts.wzh.mapper.TBasicExtendMapper;
|
||||
import com.docus.bgts.wzh.mapper.TBasicMapper;
|
||||
import com.docus.bgts.wzh.mapper.TScanAssortMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.Element;
|
||||
import org.dom4j.io.SAXReader;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import sun.misc.BASE64Decoder;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.jws.WebService;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author wyb
|
||||
*/
|
||||
@WebService
|
||||
@Service
|
||||
@Slf4j
|
||||
public class EmrWebService implements IEmrWebService {
|
||||
@Autowired
|
||||
IAfCollectTaskService afCollectTaskService;
|
||||
@Autowired
|
||||
DownPlatformService downPlatformService;
|
||||
@Autowired
|
||||
TBasicMapper tBasicMapper;
|
||||
@Autowired
|
||||
TBasicExtendMapper tBasicExtendMapper;
|
||||
@Autowired
|
||||
TScanAssortMapper tScanAssortMapper;
|
||||
@Resource
|
||||
private ThreadPoolExecutor threadPoolExecutor;
|
||||
|
||||
@Override
|
||||
public String pushSurveyReport(String xml) {
|
||||
log.info("EmrWebService,pushSurveyReport,报告推送入参:{}", xml);
|
||||
try {
|
||||
XmlUtil xmlUtil = XmlUtil.of(xml);
|
||||
EmrInfo emrInfo = EmrWsConvert.convertEmrInfo(xmlUtil);
|
||||
List<EmrInfo.ReportItem> reportItemList = emrInfo.getReportItemList();
|
||||
if (CollUtil.isEmpty(reportItemList)) {
|
||||
throw new BaseException("未解析文件数据!");
|
||||
}
|
||||
|
||||
String patientId = this.afCollectTaskService.getpatientIdByJzh(emrInfo.getJzh());
|
||||
if (StrUtil.isBlank(patientId)) {
|
||||
throw new BaseException("患者索引" + emrInfo.getJzh() + "无法匹配患者!");
|
||||
}
|
||||
TableJsonRead tableJsonRead = new TableJsonRead();
|
||||
JSONObject config = tableJsonRead.Read("dataConfig", "EmrPushConf.json", JSONObject.class);
|
||||
String collectorId = config.getString("collectorId");
|
||||
String assortId = config.getString("assortId");
|
||||
|
||||
List<ReportDownScanFileDto> scanFileDtoList = new ArrayList();
|
||||
for (EmrInfo.ReportItem reportItem : reportItemList) {
|
||||
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
||||
reportDownScanFileDto.setDownurl(reportItem.getPdfPath());
|
||||
reportDownScanFileDto.setFiletitle(reportItem.getFileName());
|
||||
reportDownScanFileDto.setSerialnum(reportItem.getIdNo());
|
||||
reportDownScanFileDto.setSortdate(reportItem.getMinTime());
|
||||
reportDownScanFileDto.setFilesource(1);
|
||||
reportDownScanFileDto.setFilestoragetype(1);
|
||||
if (reportDownScanFileDto.getDownurl().length() > 200) {
|
||||
reportDownScanFileDto.setFiletype(2);
|
||||
}
|
||||
scanFileDtoList.add(reportDownScanFileDto);
|
||||
}
|
||||
|
||||
ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto();
|
||||
reportDownPatientDto.setJzh(emrInfo.getJzh());
|
||||
reportDownPatientDto.setPatientid(patientId);
|
||||
|
||||
ReportDownDto reportDownDto = new ReportDownDto();
|
||||
reportDownDto.setCollectorid(collectorId);
|
||||
reportDownDto.setAssortid(assortId);
|
||||
reportDownDto.setPatient(reportDownPatientDto);
|
||||
reportDownDto.setScanfiles(scanFileDtoList);
|
||||
|
||||
// 作废该来源的文件
|
||||
int cancelCount = this.afCollectTaskService.cancelTsaByPatientIdAndSource(patientId, collectorId);
|
||||
log.info("作废患者 {} 份文件,主键:{},来源:{}", cancelCount, patientId, collectorId);
|
||||
afCollectTaskService.insertTask(reportDownDto);
|
||||
this.afCollectTaskService.updateDoctorSubmitTime(reportDownDto, emrInfo.getSubmitTime(), emrInfo.getRecSubName());
|
||||
this.afCollectTaskService.insertDoctorState(reportDownDto, emrInfo.getSubmitTime());
|
||||
|
||||
CommonResult commonResult = downPlatformService.report(reportDownDto);
|
||||
if (commonResult.getCode().equals(ResultCode.FAILED.getCode())) {
|
||||
throw new BaseException("执行文件上传时出现错误!");
|
||||
}
|
||||
return success();
|
||||
} catch (BaseException bex) {
|
||||
log.error("报告推送出错!错误原因:" + bex.getMessage(), bex);
|
||||
return failed(bex.getMessage());
|
||||
} catch (Exception ex) {
|
||||
log.error("报告推送出错!错误原因:" + ex.getMessage(), ex);
|
||||
return failed("系统错误!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String outPatient(String xml) {
|
||||
log.info("EmrWebService,outPatient,报告推送入参:{}", xml);
|
||||
try {
|
||||
XmlUtil xmlUtil = XmlUtil.of(xml);
|
||||
EmrInfo emrInfo = EmrWsConvert.convertEmrInfo(xmlUtil);
|
||||
List<EmrInfo.ReportItem> reportItemList = emrInfo.getReportItemList();
|
||||
if (CollUtil.isEmpty(reportItemList)) {
|
||||
throw new BaseException("未解析文件数据!");
|
||||
}
|
||||
|
||||
String patientId = this.afCollectTaskService.getpatientIdByJzh(emrInfo.getJzh());
|
||||
if (StrUtil.isBlank(patientId)) {
|
||||
throw new BaseException("患者索引" + emrInfo.getJzh() + "无法匹配患者!");
|
||||
}
|
||||
TableJsonRead tableJsonRead = new TableJsonRead();
|
||||
JSONObject config = tableJsonRead.Read("dataConfig", "EmrPushConf.json", JSONObject.class);
|
||||
String collectorId = config.getString("collectorId");
|
||||
String assortId = config.getString("assortId");
|
||||
|
||||
List<ReportDownScanFileDto> scanFileDtoList = new ArrayList();
|
||||
for (EmrInfo.ReportItem reportItem : reportItemList) {
|
||||
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
||||
reportDownScanFileDto.setDownurl(reportItem.getPdfPath());
|
||||
reportDownScanFileDto.setFiletitle(reportItem.getFileName());
|
||||
reportDownScanFileDto.setSerialnum(reportItem.getIdNo());
|
||||
reportDownScanFileDto.setSortdate(reportItem.getMinTime());
|
||||
reportDownScanFileDto.setFilesource(1);
|
||||
reportDownScanFileDto.setFilestoragetype(1);
|
||||
if (reportDownScanFileDto.getDownurl().length() > 200) {
|
||||
reportDownScanFileDto.setFiletype(2);
|
||||
}
|
||||
scanFileDtoList.add(reportDownScanFileDto);
|
||||
}
|
||||
|
||||
ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto();
|
||||
reportDownPatientDto.setJzh(emrInfo.getJzh());
|
||||
reportDownPatientDto.setPatientid(patientId);
|
||||
|
||||
ReportDownDto reportDownDto = new ReportDownDto();
|
||||
reportDownDto.setCollectorid(collectorId);
|
||||
reportDownDto.setAssortid(assortId);
|
||||
reportDownDto.setPatient(reportDownPatientDto);
|
||||
reportDownDto.setScanfiles(scanFileDtoList);
|
||||
|
||||
this.afCollectTaskService.insertTask(reportDownDto);
|
||||
|
||||
CommonResult commonResult = downPlatformService.report(reportDownDto);
|
||||
if (commonResult.getCode().equals(ResultCode.FAILED.getCode())) {
|
||||
throw new BaseException("执行文件上传时出现错误!");
|
||||
}
|
||||
return success();
|
||||
} catch (BaseException bex) {
|
||||
log.error("报告推送出错!错误原因:" + bex.getMessage(), bex);
|
||||
return failed(bex.getMessage());
|
||||
} catch (Exception ex) {
|
||||
log.error("报告推送出错!错误原因:" + ex.getMessage(), ex);
|
||||
return failed("系统错误!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void sealCollect(String sealId) {
|
||||
String systemCollectConfigFileName = "dataConfig" + File.separator + "SystemCollectConfig";
|
||||
|
||||
List<SystemCollectConfig.CollectConfig> sealCollectConfigs;
|
||||
try {
|
||||
String configJson = FileUtils.readJsonFromCurrentProject(systemCollectConfigFileName);
|
||||
SystemCollectConfig systemCollectConfig = (SystemCollectConfig) JSON.parseObject(configJson, SystemCollectConfig.class);
|
||||
String sealCollectClassify = systemCollectConfig.getSealCollectClassify();
|
||||
if (!SystemCollectConfig.Classify.SEAL_COLLECT.getClassify().equals(sealCollectClassify)) {
|
||||
throw new RuntimeException("封存病案采集配置未配置!");
|
||||
}
|
||||
|
||||
sealCollectConfigs = systemCollectConfig.getSealCollectConfigs();
|
||||
|
||||
for (SystemCollectConfig.CollectConfig config : sealCollectConfigs) {
|
||||
if (StringUtils.isBlank(config.getDesc()) || StringUtils.isBlank(config.getUrl())) {
|
||||
throw new RuntimeException("封存病案采集配置中描述和地址不能为空!");
|
||||
}
|
||||
}
|
||||
} catch (RuntimeException runtimeException) {
|
||||
log.error(runtimeException.getMessage(), runtimeException);
|
||||
return;
|
||||
} catch (Exception ex) {
|
||||
log.error("封存病案获取采集配置出现未知错误!", ex);
|
||||
return;
|
||||
}
|
||||
|
||||
List<CompletableFuture<Void>> completableFutureList = new CopyOnWriteArrayList();
|
||||
|
||||
for (SystemCollectConfig.CollectConfig config : sealCollectConfigs) {
|
||||
CompletableFuture<Void> completableFuture = CompletableFuture.runAsync(() -> this.sealCollect(sealId, config), this.threadPoolExecutor);
|
||||
completableFutureList.add(completableFuture);
|
||||
}
|
||||
|
||||
if (!completableFutureList.isEmpty()) {
|
||||
CompletableFuture<Void> allFutures = CompletableFuture.allOf((CompletableFuture[]) completableFutureList.toArray(new CompletableFuture[0]));
|
||||
|
||||
try {
|
||||
allFutures.get();
|
||||
} catch (Exception ex) {
|
||||
log.error(ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Element getElementFromString(String s) {
|
||||
SAXReader builder = new SAXReader();
|
||||
Document doc = null;
|
||||
Element element = null;
|
||||
|
||||
try {
|
||||
doc = builder.read(new StringReader(s));
|
||||
} catch (DocumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (doc != null) {
|
||||
element = doc.getRootElement();
|
||||
}
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
private void sealCollect(String sealId, SystemCollectConfig.CollectConfig config) {
|
||||
String url = config.getUrl() + "?sealId=" + sealId;
|
||||
String desc = config.getDesc();
|
||||
|
||||
try {
|
||||
log.info("{},采集地址:{}", desc, url);
|
||||
String result = HttpUtils.get(url);
|
||||
log.info("{},采集地址:{},采集结果:{}", new Object[]{desc, url, result});
|
||||
} catch (Exception ex) {
|
||||
log.error(desc + ",采集地址:" + url + ",采集失败!", ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private CanlcelDto getCanlCelDtoByXml(String xml) throws UnsupportedEncodingException {
|
||||
XmlUtils xmlUtils = null;
|
||||
|
||||
try {
|
||||
xmlUtils = new XmlUtils(new ByteArrayInputStream(xml.getBytes("UTF-8")));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
List<String> repealDirectory = (List) FileUtils.getJsonByName("repealDirectory");
|
||||
Element element = xmlUtils.getElement(repealDirectory);
|
||||
String repealSerialnum = String.valueOf(FileUtils.getJsonByName("repealSerialnum"));
|
||||
Element repealSerialnumElement = element.element(repealSerialnum);
|
||||
CanlcelDto canlcelDto = new CanlcelDto();
|
||||
if (null != repealSerialnumElement && !StringUtils.isBlank(repealSerialnumElement.getText())) {
|
||||
String serialnum = repealSerialnumElement.getText();
|
||||
log.info("当前流水号为:" + serialnum);
|
||||
canlcelDto.setSerialnum(serialnum);
|
||||
return canlcelDto;
|
||||
} else {
|
||||
throw new RuntimeException(repealSerialnum + "标签必须有值");
|
||||
}
|
||||
}
|
||||
|
||||
private String getElementText(Element element, String[] args) {
|
||||
String resText = "";
|
||||
Element byElement = (Element) element.clone();
|
||||
Element byElement1 = null;
|
||||
|
||||
for (String arg : args) {
|
||||
String[] split = arg.split("&");
|
||||
if (split.length > 1) {
|
||||
for (String spi : split) {
|
||||
if (byElement1 == null) {
|
||||
byElement1 = byElement.element(spi);
|
||||
} else {
|
||||
byElement1 = byElement1.element(spi);
|
||||
}
|
||||
|
||||
if (byElement1 != null && StringUtils.isNotBlank(byElement1.getText())) {
|
||||
break;
|
||||
}
|
||||
|
||||
byElement1 = null;
|
||||
}
|
||||
} else if (byElement1 == null) {
|
||||
byElement1 = byElement.element(arg);
|
||||
} else {
|
||||
byElement1 = byElement1.element(arg);
|
||||
}
|
||||
|
||||
if (byElement1 == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
resText = byElement1.getText();
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(resText)) {
|
||||
throw new RuntimeException(args[args.length - 1] + "的值不能为空");
|
||||
} else {
|
||||
return resText;
|
||||
}
|
||||
}
|
||||
|
||||
private String getElementTextCanBeEmpty(Element element, String[] args) {
|
||||
String resText = "";
|
||||
Element byElement = (Element) element.clone();
|
||||
Element byElement1 = null;
|
||||
|
||||
for (String arg : args) {
|
||||
String[] split = arg.split("&");
|
||||
if (split.length > 1) {
|
||||
for (String spi : split) {
|
||||
if (byElement1 == null) {
|
||||
byElement1 = byElement.element(spi);
|
||||
} else {
|
||||
byElement1 = byElement1.element(spi);
|
||||
}
|
||||
|
||||
if (byElement1 != null && StringUtils.isNotBlank(byElement1.getText())) {
|
||||
break;
|
||||
}
|
||||
|
||||
byElement1 = null;
|
||||
}
|
||||
} else if (byElement1 == null) {
|
||||
byElement1 = byElement.element(arg);
|
||||
} else {
|
||||
byElement1 = byElement1.element(arg);
|
||||
}
|
||||
|
||||
if (byElement1 == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
resText = byElement1.getText();
|
||||
}
|
||||
|
||||
return resText;
|
||||
}
|
||||
|
||||
private String getAssortid(Element element) {
|
||||
String assortId = String.valueOf(FileUtils.getJsonByName("assortid"));
|
||||
if (StringUtils.isBlank(assortId)) {
|
||||
String assortIdKey = String.valueOf(FileUtils.getJsonByName("assortidParamKey"));
|
||||
if (StringUtils.isBlank(assortIdKey)) {
|
||||
assortId = "";
|
||||
} else {
|
||||
assortId = element.element(assortIdKey).getText();
|
||||
}
|
||||
|
||||
String myAssortId = this.afCollectTaskService.getAssortIdByAssortId(assortId);
|
||||
if (StringUtils.isBlank(myAssortId)) {
|
||||
myAssortId = this.afCollectTaskService.getAssortIdByAssortName(assortId);
|
||||
if (StringUtils.isBlank(myAssortId)) {
|
||||
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
|
||||
ZdAssort zdAssort = new ZdAssort();
|
||||
zdAssort.setAssortName(assortId);
|
||||
zdAssort.setAssortId(uuid);
|
||||
zdAssort.setEffective(1);
|
||||
this.afCollectTaskService.insertZdAssort(zdAssort);
|
||||
assortId = uuid;
|
||||
} else {
|
||||
assortId = myAssortId;
|
||||
}
|
||||
} else {
|
||||
assortId = myAssortId;
|
||||
}
|
||||
}
|
||||
|
||||
return assortId;
|
||||
}
|
||||
|
||||
public static void depdf() {
|
||||
Path path = Paths.get("D:\\pdf.txt");
|
||||
Stream<String> lines = null;
|
||||
|
||||
try {
|
||||
lines = Files.lines(path);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
String collect = (String) lines.collect(Collectors.joining(System.lineSeparator()));
|
||||
String encodedBytes = collect;
|
||||
BASE64Decoder decoder = new BASE64Decoder();
|
||||
byte[] decodedBytes = new byte[0];
|
||||
|
||||
try {
|
||||
decodedBytes = decoder.decodeBuffer(encodedBytes);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
File file = new File("D:\\newfile.pdf");
|
||||
FileOutputStream fop = null;
|
||||
|
||||
try {
|
||||
fop = new FileOutputStream(file);
|
||||
fop.write(decodedBytes);
|
||||
fop.flush();
|
||||
fop.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String success() {
|
||||
return "<Response>\n" +
|
||||
"\t<RetInfo>\n" +
|
||||
"\t\t<RetCode>0</RetCode>\n" +
|
||||
"\t\t<RetCon>成功</RetCon>\n" +
|
||||
"\t</RetInfo>\n" +
|
||||
"</Response>";
|
||||
}
|
||||
|
||||
public String failed(String msg) {
|
||||
return "<Response>\n" +
|
||||
"\t<RetInfo>\n" +
|
||||
"\t\t<RetCode>1</RetCode>\n" +
|
||||
"\t\t<RetCon>" + msg + "</RetCon>\n" +
|
||||
"\t</RetInfo>\n" +
|
||||
"</Response>";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.emr.handler;
|
||||
|
||||
import javax.jws.WebMethod;
|
||||
import javax.jws.WebService;
|
||||
|
||||
/**
|
||||
* @author wyb
|
||||
*/
|
||||
@WebService
|
||||
public interface IEmrWebService {
|
||||
@WebMethod
|
||||
String pushSurveyReport(String xml);
|
||||
|
||||
@WebMethod
|
||||
String outPatient(String xml);
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package com.docus.bgts.nursing.convert;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.docus.bgts.nursing.dto.NursingInfo;
|
||||
import com.docus.bgts.utils.XmlUtil;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author YongBin Wen
|
||||
* @date 2025/11/17 星期一 21:11
|
||||
*/
|
||||
public class NursingWsConvert {
|
||||
public static NursingInfo convertNursingInfo(XmlUtil xmlUtil) {
|
||||
String jzh;
|
||||
String inpatientNo;
|
||||
Integer admissTimes = null;
|
||||
String submitTime;
|
||||
String submitNurseCode;
|
||||
String submitNurseName;
|
||||
String idNo;
|
||||
String fileName;
|
||||
String pdfPath;
|
||||
String uniqueFile;
|
||||
String tableType;
|
||||
Node idNoNode = xmlUtil.getNode("/Request/Msg/IDNO");
|
||||
idNo = idNoNode.getTextContent();
|
||||
Node jzhNode = xmlUtil.getNode("/Request/Msg/INHOSP_INDEX_NO");
|
||||
jzh = jzhNode.getTextContent();
|
||||
Node inpatientNoNode = xmlUtil.getNode("/Request/Msg/INHOSP_NO");
|
||||
inpatientNo = inpatientNoNode.getTextContent();
|
||||
Node admissTimesNode = xmlUtil.getNode("/Request/Msg/INHOSP_NUM");
|
||||
if (StrUtil.isNotBlank(admissTimesNode.getTextContent())) {
|
||||
admissTimes = Integer.valueOf(admissTimesNode.getTextContent());
|
||||
}
|
||||
Node tableTypeNode = xmlUtil.getNode("/Request/Msg/TABLE_TYPE");
|
||||
tableType = tableTypeNode.getTextContent();
|
||||
Node submitTimeNode = xmlUtil.getNode("/Request/Msg/SUBMIT_TIME");
|
||||
submitTime = submitTimeNode.getTextContent();
|
||||
Node pdfPathNode = xmlUtil.getNode("/Request/Msg/PDF_PATH");
|
||||
pdfPath = pdfPathNode.getTextContent();
|
||||
Node fileNameNode = xmlUtil.getNode("/Request/Msg/FILENAME");
|
||||
fileName = fileNameNode.getTextContent();
|
||||
Node uniqueFileNode = xmlUtil.getNode("/Request/Msg/UNIQUE_FILE");
|
||||
uniqueFile = uniqueFileNode.getTextContent();
|
||||
Node submitNurseCodeNode = xmlUtil.getNode("/Request/Msg/SUBMIT_NURSE_CODE");
|
||||
submitNurseCode = submitNurseCodeNode.getTextContent();
|
||||
Node submitNurseNameNode = xmlUtil.getNode("/Request/Msg/SUBMIT_NURSE_NAME");
|
||||
submitNurseName = submitNurseNameNode.getTextContent();
|
||||
|
||||
NursingInfo nursingInfo = new NursingInfo();
|
||||
nursingInfo.setJzh(jzh);
|
||||
nursingInfo.setInpatientNo(inpatientNo);
|
||||
nursingInfo.setAdmissTimes(admissTimes);
|
||||
nursingInfo.setSubmitTime(submitTime);
|
||||
nursingInfo.setSubmitNurseCode(submitNurseCode);
|
||||
nursingInfo.setSubmitNurseName(submitNurseName);
|
||||
nursingInfo.setIdNo(idNo);
|
||||
nursingInfo.setFileName(fileName);
|
||||
nursingInfo.setPdfPath(pdfPath);
|
||||
nursingInfo.setUniqueFile(uniqueFile);
|
||||
nursingInfo.setTableType(tableType);
|
||||
return nursingInfo;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.docus.bgts.nursing.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author YongBin Wen
|
||||
* @date 2025/11/17 星期一 21:11
|
||||
*/
|
||||
@Data
|
||||
public class NursingInfo {
|
||||
@ApiModelProperty(" 住院流水号")
|
||||
private String jzh;
|
||||
@ApiModelProperty(" 住院号")
|
||||
private String inpatientNo;
|
||||
@ApiModelProperty(" 住院次数")
|
||||
private Integer admissTimes;
|
||||
@ApiModelProperty("护理提交时间 yyyy-MM-dd HH:mm:ss")
|
||||
private String submitTime;
|
||||
@ApiModelProperty(" 提交护士工号")
|
||||
private String submitNurseCode;
|
||||
@ApiModelProperty(" 提交护士姓名")
|
||||
private String submitNurseName;
|
||||
@ApiModelProperty("文件id")
|
||||
private String idNo;
|
||||
@ApiModelProperty("文件名称")
|
||||
private String fileName;
|
||||
@ApiModelProperty("文件地址")
|
||||
private String pdfPath;
|
||||
@ApiModelProperty("待确认的字段")
|
||||
private String uniqueFile;
|
||||
@ApiModelProperty("待确认的字段")
|
||||
private String tableType;
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.nursing.handler;
|
||||
|
||||
import javax.jws.WebMethod;
|
||||
import javax.jws.WebService;
|
||||
|
||||
/**
|
||||
* @author wyb
|
||||
*/
|
||||
@WebService
|
||||
public interface INursingWebService {
|
||||
@WebMethod
|
||||
String pushSurveyReport(String xml);
|
||||
|
||||
@WebMethod
|
||||
String outPatient(String xml);
|
||||
}
|
||||
@ -0,0 +1,450 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.nursing.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.docus.bgts.config.BaseException;
|
||||
import com.docus.bgts.config.CommonResult;
|
||||
import com.docus.bgts.config.ResultCode;
|
||||
import com.docus.bgts.emr.dto.SystemCollectConfig;
|
||||
import com.docus.bgts.nursing.convert.NursingWsConvert;
|
||||
import com.docus.bgts.nursing.dto.NursingInfo;
|
||||
import com.docus.bgts.rpc.DownPlatformService;
|
||||
import com.docus.bgts.rpc.dto.ReportDownDto;
|
||||
import com.docus.bgts.rpc.dto.ReportDownPatientDto;
|
||||
import com.docus.bgts.rpc.dto.ReportDownScanFileDto;
|
||||
import com.docus.bgts.utils.FileUtils;
|
||||
import com.docus.bgts.utils.HttpUtils;
|
||||
import com.docus.bgts.utils.TableJsonRead;
|
||||
import com.docus.bgts.utils.XmlUtil;
|
||||
import com.docus.bgts.utils.XmlUtils;
|
||||
import com.docus.bgts.wzh.entity.CanlcelDto;
|
||||
import com.docus.bgts.wzh.entity.ZdAssort;
|
||||
import com.docus.bgts.wzh.facade.IAfCollectTaskService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.Element;
|
||||
import org.dom4j.io.SAXReader;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import sun.misc.BASE64Decoder;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.jws.WebService;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author wyb
|
||||
*/
|
||||
@WebService
|
||||
@Service
|
||||
@Slf4j
|
||||
public class NursingWebService implements INursingWebService {
|
||||
|
||||
@Autowired
|
||||
IAfCollectTaskService afCollectTaskService;
|
||||
@Autowired
|
||||
DownPlatformService downPlatformService;
|
||||
@Resource
|
||||
private ThreadPoolExecutor threadPoolExecutor;
|
||||
|
||||
@Override
|
||||
public String pushSurveyReport(String xml) {
|
||||
log.info("NursingWebService,pushSurveyReport,报告推送入参:{}", xml);
|
||||
try {
|
||||
XmlUtil xmlUtil = XmlUtil.of(xml);
|
||||
NursingInfo nursingInfo = NursingWsConvert.convertNursingInfo(xmlUtil);
|
||||
|
||||
String patientId = this.afCollectTaskService.getpatientIdByJzh(nursingInfo.getJzh());
|
||||
if (StrUtil.isBlank(patientId)) {
|
||||
throw new BaseException("患者索引" + nursingInfo.getJzh() + "无法匹配患者!");
|
||||
}
|
||||
TableJsonRead tableJsonRead = new TableJsonRead();
|
||||
JSONObject config = tableJsonRead.Read("dataConfig", "NursingPushConf.json", JSONObject.class);
|
||||
String collectorId = config.getString("collectorId");
|
||||
String assortId = config.getString("assortId");
|
||||
|
||||
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
||||
reportDownScanFileDto.setDownurl(nursingInfo.getPdfPath());
|
||||
reportDownScanFileDto.setFiletitle(nursingInfo.getFileName());
|
||||
reportDownScanFileDto.setSerialnum(nursingInfo.getIdNo());
|
||||
reportDownScanFileDto.setFilesource(1);
|
||||
reportDownScanFileDto.setFilestoragetype(1);
|
||||
if (reportDownScanFileDto.getDownurl().length() > 200) {
|
||||
reportDownScanFileDto.setFiletype(2);
|
||||
}
|
||||
List<ReportDownScanFileDto> scanFileDtoList = Collections.singletonList(reportDownScanFileDto);
|
||||
|
||||
ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto();
|
||||
reportDownPatientDto.setJzh(nursingInfo.getJzh());
|
||||
reportDownPatientDto.setPatientid(patientId);
|
||||
|
||||
ReportDownDto reportDownDto = new ReportDownDto();
|
||||
reportDownDto.setCollectorid(collectorId);
|
||||
reportDownDto.setAssortid(assortId);
|
||||
reportDownDto.setPatient(reportDownPatientDto);
|
||||
reportDownDto.setScanfiles(scanFileDtoList);
|
||||
|
||||
afCollectTaskService.updateNurseSubmitTime(reportDownDto, nursingInfo.getSubmitTime(), nursingInfo.getSubmitNurseName());
|
||||
afCollectTaskService.insertNurseState(reportDownDto, nursingInfo.getSubmitTime());
|
||||
afCollectTaskService.insertTask(reportDownDto);
|
||||
|
||||
|
||||
CommonResult commonResult = downPlatformService.report(reportDownDto);
|
||||
if (commonResult.getCode().equals(ResultCode.FAILED.getCode())) {
|
||||
throw new BaseException("执行文件上传时出现错误!");
|
||||
}
|
||||
return success();
|
||||
} catch (BaseException bex) {
|
||||
log.error("报告推送出错!错误原因:" + bex.getMessage(), bex);
|
||||
return failed(bex.getMessage());
|
||||
} catch (Exception ex) {
|
||||
log.error("报告推送出错!错误原因:" + ex.getMessage(), ex);
|
||||
return failed("系统错误!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String outPatient(String xml) {
|
||||
log.info("NursingWebService,outPatient,报告推送入参:{}", xml);
|
||||
try {
|
||||
XmlUtil xmlUtil = XmlUtil.of(xml);
|
||||
NursingInfo nursingInfo = NursingWsConvert.convertNursingInfo(xmlUtil);
|
||||
|
||||
|
||||
String patientId = this.afCollectTaskService.getpatientIdByJzh(nursingInfo.getJzh());
|
||||
if (StrUtil.isBlank(patientId)) {
|
||||
throw new BaseException("患者索引" + nursingInfo.getJzh() + "无法匹配患者!");
|
||||
}
|
||||
TableJsonRead tableJsonRead = new TableJsonRead();
|
||||
JSONObject config = tableJsonRead.Read("dataConfig", "NursingPushConf.json", JSONObject.class);
|
||||
String collectorId = config.getString("collectorId");
|
||||
String assortId = config.getString("assortId");
|
||||
|
||||
ReportDownScanFileDto reportDownScanFileDto = new ReportDownScanFileDto();
|
||||
reportDownScanFileDto.setDownurl(nursingInfo.getPdfPath());
|
||||
reportDownScanFileDto.setFiletitle(nursingInfo.getFileName());
|
||||
reportDownScanFileDto.setSerialnum(nursingInfo.getIdNo());
|
||||
reportDownScanFileDto.setFilesource(1);
|
||||
reportDownScanFileDto.setFilestoragetype(1);
|
||||
if (reportDownScanFileDto.getDownurl().length() > 200) {
|
||||
reportDownScanFileDto.setFiletype(2);
|
||||
}
|
||||
List<ReportDownScanFileDto> scanFileDtoList = Collections.singletonList(reportDownScanFileDto);
|
||||
|
||||
ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto();
|
||||
reportDownPatientDto.setJzh(nursingInfo.getJzh());
|
||||
reportDownPatientDto.setPatientid(patientId);
|
||||
|
||||
ReportDownDto reportDownDto = new ReportDownDto();
|
||||
reportDownDto.setCollectorid(collectorId);
|
||||
reportDownDto.setAssortid(assortId);
|
||||
reportDownDto.setPatient(reportDownPatientDto);
|
||||
reportDownDto.setScanfiles(scanFileDtoList);
|
||||
|
||||
this.afCollectTaskService.insertTask(reportDownDto);
|
||||
|
||||
CommonResult commonResult = downPlatformService.report(reportDownDto);
|
||||
if (commonResult.getCode().equals(ResultCode.FAILED.getCode())) {
|
||||
throw new BaseException("执行文件上传时出现错误!");
|
||||
}
|
||||
return success();
|
||||
} catch (BaseException bex) {
|
||||
log.error("报告推送出错!错误原因:" + bex.getMessage(), bex);
|
||||
return failed(bex.getMessage());
|
||||
} catch (Exception ex) {
|
||||
log.error("报告推送出错!错误原因:" + ex.getMessage(), ex);
|
||||
return failed("系统错误!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void sealCollect(String sealId) {
|
||||
String systemCollectConfigFileName = "dataConfig" + File.separator + "SystemCollectConfig";
|
||||
|
||||
List<SystemCollectConfig.CollectConfig> sealCollectConfigs;
|
||||
try {
|
||||
String configJson = FileUtils.readJsonFromCurrentProject(systemCollectConfigFileName);
|
||||
SystemCollectConfig systemCollectConfig = (SystemCollectConfig) JSON.parseObject(configJson, SystemCollectConfig.class);
|
||||
String sealCollectClassify = systemCollectConfig.getSealCollectClassify();
|
||||
if (!SystemCollectConfig.Classify.SEAL_COLLECT.getClassify().equals(sealCollectClassify)) {
|
||||
throw new RuntimeException("封存病案采集配置未配置!");
|
||||
}
|
||||
|
||||
sealCollectConfigs = systemCollectConfig.getSealCollectConfigs();
|
||||
|
||||
for (SystemCollectConfig.CollectConfig config : sealCollectConfigs) {
|
||||
if (StringUtils.isBlank(config.getDesc()) || StringUtils.isBlank(config.getUrl())) {
|
||||
throw new RuntimeException("封存病案采集配置中描述和地址不能为空!");
|
||||
}
|
||||
}
|
||||
} catch (RuntimeException runtimeException) {
|
||||
log.error(runtimeException.getMessage(), runtimeException);
|
||||
return;
|
||||
} catch (Exception ex) {
|
||||
log.error("封存病案获取采集配置出现未知错误!", ex);
|
||||
return;
|
||||
}
|
||||
|
||||
List<CompletableFuture<Void>> completableFutureList = new CopyOnWriteArrayList();
|
||||
|
||||
for (SystemCollectConfig.CollectConfig config : sealCollectConfigs) {
|
||||
CompletableFuture<Void> completableFuture = CompletableFuture.runAsync(() -> this.sealCollect(sealId, config), this.threadPoolExecutor);
|
||||
completableFutureList.add(completableFuture);
|
||||
}
|
||||
|
||||
if (!completableFutureList.isEmpty()) {
|
||||
CompletableFuture<Void> allFutures = CompletableFuture.allOf((CompletableFuture[]) completableFutureList.toArray(new CompletableFuture[0]));
|
||||
|
||||
try {
|
||||
allFutures.get();
|
||||
} catch (Exception ex) {
|
||||
log.error(ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Element getElementFromString(String s) {
|
||||
SAXReader builder = new SAXReader();
|
||||
Document doc = null;
|
||||
Element element = null;
|
||||
|
||||
try {
|
||||
doc = builder.read(new StringReader(s));
|
||||
} catch (DocumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (doc != null) {
|
||||
element = doc.getRootElement();
|
||||
}
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
private void sealCollect(String sealId, SystemCollectConfig.CollectConfig config) {
|
||||
String url = config.getUrl() + "?sealId=" + sealId;
|
||||
String desc = config.getDesc();
|
||||
|
||||
try {
|
||||
log.info("{},采集地址:{}", desc, url);
|
||||
String result = HttpUtils.get(url);
|
||||
log.info("{},采集地址:{},采集结果:{}", new Object[]{desc, url, result});
|
||||
} catch (Exception ex) {
|
||||
log.error(desc + ",采集地址:" + url + ",采集失败!", ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private CanlcelDto getCanlCelDtoByXml(String xml) throws UnsupportedEncodingException {
|
||||
XmlUtils xmlUtils = null;
|
||||
|
||||
try {
|
||||
xmlUtils = new XmlUtils(new ByteArrayInputStream(xml.getBytes("UTF-8")));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
List<String> repealDirectory = (List) FileUtils.getJsonByName("repealDirectory");
|
||||
Element element = xmlUtils.getElement(repealDirectory);
|
||||
String repealSerialnum = String.valueOf(FileUtils.getJsonByName("repealSerialnum"));
|
||||
Element repealSerialnumElement = element.element(repealSerialnum);
|
||||
CanlcelDto canlcelDto = new CanlcelDto();
|
||||
if (null != repealSerialnumElement && !StringUtils.isBlank(repealSerialnumElement.getText())) {
|
||||
String serialnum = repealSerialnumElement.getText();
|
||||
log.info("当前流水号为:" + serialnum);
|
||||
canlcelDto.setSerialnum(serialnum);
|
||||
return canlcelDto;
|
||||
} else {
|
||||
throw new RuntimeException(repealSerialnum + "标签必须有值");
|
||||
}
|
||||
}
|
||||
|
||||
private String getElementText(Element element, String[] args) {
|
||||
String resText = "";
|
||||
Element byElement = (Element) element.clone();
|
||||
Element byElement1 = null;
|
||||
|
||||
for (String arg : args) {
|
||||
String[] split = arg.split("&");
|
||||
if (split.length > 1) {
|
||||
for (String spi : split) {
|
||||
if (byElement1 == null) {
|
||||
byElement1 = byElement.element(spi);
|
||||
} else {
|
||||
byElement1 = byElement1.element(spi);
|
||||
}
|
||||
|
||||
if (byElement1 != null && StringUtils.isNotBlank(byElement1.getText())) {
|
||||
break;
|
||||
}
|
||||
|
||||
byElement1 = null;
|
||||
}
|
||||
} else if (byElement1 == null) {
|
||||
byElement1 = byElement.element(arg);
|
||||
} else {
|
||||
byElement1 = byElement1.element(arg);
|
||||
}
|
||||
|
||||
if (byElement1 == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
resText = byElement1.getText();
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(resText)) {
|
||||
throw new RuntimeException(args[args.length - 1] + "的值不能为空");
|
||||
} else {
|
||||
return resText;
|
||||
}
|
||||
}
|
||||
|
||||
private String getElementTextCanBeEmpty(Element element, String[] args) {
|
||||
String resText = "";
|
||||
Element byElement = (Element) element.clone();
|
||||
Element byElement1 = null;
|
||||
|
||||
for (String arg : args) {
|
||||
String[] split = arg.split("&");
|
||||
if (split.length > 1) {
|
||||
for (String spi : split) {
|
||||
if (byElement1 == null) {
|
||||
byElement1 = byElement.element(spi);
|
||||
} else {
|
||||
byElement1 = byElement1.element(spi);
|
||||
}
|
||||
|
||||
if (byElement1 != null && StringUtils.isNotBlank(byElement1.getText())) {
|
||||
break;
|
||||
}
|
||||
|
||||
byElement1 = null;
|
||||
}
|
||||
} else if (byElement1 == null) {
|
||||
byElement1 = byElement.element(arg);
|
||||
} else {
|
||||
byElement1 = byElement1.element(arg);
|
||||
}
|
||||
|
||||
if (byElement1 == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
resText = byElement1.getText();
|
||||
}
|
||||
|
||||
return resText;
|
||||
}
|
||||
|
||||
private String getAssortid(Element element) {
|
||||
String assortId = String.valueOf(FileUtils.getJsonByName("assortid"));
|
||||
if (StringUtils.isBlank(assortId)) {
|
||||
String assortIdKey = String.valueOf(FileUtils.getJsonByName("assortidParamKey"));
|
||||
if (StringUtils.isBlank(assortIdKey)) {
|
||||
assortId = "";
|
||||
} else {
|
||||
assortId = element.element(assortIdKey).getText();
|
||||
}
|
||||
|
||||
String myAssortId = this.afCollectTaskService.getAssortIdByAssortId(assortId);
|
||||
if (StringUtils.isBlank(myAssortId)) {
|
||||
myAssortId = this.afCollectTaskService.getAssortIdByAssortName(assortId);
|
||||
if (StringUtils.isBlank(myAssortId)) {
|
||||
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
|
||||
ZdAssort zdAssort = new ZdAssort();
|
||||
zdAssort.setAssortName(assortId);
|
||||
zdAssort.setAssortId(uuid);
|
||||
zdAssort.setEffective(1);
|
||||
this.afCollectTaskService.insertZdAssort(zdAssort);
|
||||
assortId = uuid;
|
||||
} else {
|
||||
assortId = myAssortId;
|
||||
}
|
||||
} else {
|
||||
assortId = myAssortId;
|
||||
}
|
||||
}
|
||||
|
||||
return assortId;
|
||||
}
|
||||
|
||||
public static void depdf() {
|
||||
Path path = Paths.get("D:\\pdf.txt");
|
||||
Stream<String> lines = null;
|
||||
|
||||
try {
|
||||
lines = Files.lines(path);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
String collect = (String) lines.collect(Collectors.joining(System.lineSeparator()));
|
||||
String encodedBytes = collect;
|
||||
BASE64Decoder decoder = new BASE64Decoder();
|
||||
byte[] decodedBytes = new byte[0];
|
||||
|
||||
try {
|
||||
decodedBytes = decoder.decodeBuffer(encodedBytes);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
File file = new File("D:\\newfile.pdf");
|
||||
FileOutputStream fop = null;
|
||||
|
||||
try {
|
||||
fop = new FileOutputStream(file);
|
||||
fop.write(decodedBytes);
|
||||
fop.flush();
|
||||
fop.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String success() {
|
||||
return "<Response>\n" +
|
||||
"\t<RetInfo>\n" +
|
||||
"\t\t<RetCode>0</RetCode>\n" +
|
||||
"\t\t<RetCon>成功</RetCon>\n" +
|
||||
"\t</RetInfo>\n" +
|
||||
"</Response>";
|
||||
}
|
||||
|
||||
public String failed(String msg) {
|
||||
return "<Response>\n" +
|
||||
"\t<RetInfo>\n" +
|
||||
"\t\t<RetCode>1</RetCode>\n" +
|
||||
"\t\t<RetCon>" + msg + "</RetCon>\n" +
|
||||
"\t</RetInfo>\n" +
|
||||
"</Response>";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.docus.bgts.rpc;
|
||||
|
||||
|
||||
import com.docus.bgts.config.CommonResult;
|
||||
import com.docus.bgts.rpc.dto.ReportDownDto;
|
||||
|
||||
/**
|
||||
* 下载平台服务接口
|
||||
*
|
||||
* @author jiashi
|
||||
*/
|
||||
|
||||
public interface DownPlatformService {
|
||||
|
||||
|
||||
/**
|
||||
* 下载服务文件上报
|
||||
*
|
||||
* @param reportDownDto 下载服务上报参数
|
||||
* @return 结果
|
||||
*/
|
||||
CommonResult report(ReportDownDto reportDownDto);
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.docus.bgts.rpc.dto;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ReportDownDto {
|
||||
@ApiModelProperty(value = "采集器id")
|
||||
private String collectorid;
|
||||
|
||||
@ApiModelProperty(value = "采集器ip")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty(value = "分类id")
|
||||
private String assortid;
|
||||
|
||||
@ApiModelProperty(value = "患者信息")
|
||||
private ReportDownPatientDto patient;
|
||||
|
||||
@ApiModelProperty(value = "文件信息")
|
||||
private List<ReportDownScanFileDto> scanfiles;
|
||||
|
||||
@ApiModelProperty(value = "扫描用户代码")
|
||||
private String scanusercode;
|
||||
@ApiModelProperty(value = "扫描用户名称")
|
||||
private String scanusername;
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.docus.bgts.rpc.impl;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.docus.bgts.config.CommonResult;
|
||||
import com.docus.bgts.config.DocusServerUrlConfig;
|
||||
import com.docus.bgts.rpc.DownPlatformService;
|
||||
import com.docus.bgts.rpc.dto.ReportDownDto;
|
||||
import com.docus.core.util.Func;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 下载平台服务接口
|
||||
*
|
||||
* @author jiashi
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class DownPlatformServiceImpl implements DownPlatformService {
|
||||
|
||||
@Resource
|
||||
private DocusServerUrlConfig serverUrlConfig;
|
||||
|
||||
@Override
|
||||
public CommonResult report(ReportDownDto reportDownDto) {
|
||||
String downUrl = serverUrlConfig.getDownloadPlatformServerUrl() + "api/downplatform/report";
|
||||
String requestId = Func.randomUUID();
|
||||
String requestParam = Func.toJson(reportDownDto);
|
||||
String requestLogParam = requestParam;
|
||||
if (reportDownDto.getScanfiles().get(0).getFiletype() == 2) {
|
||||
String downurl = reportDownDto.getScanfiles().get(0).getDownurl();
|
||||
reportDownDto.getScanfiles().get(0).setDownurl("base64Str");
|
||||
requestLogParam = Func.toJson(reportDownDto);
|
||||
reportDownDto.getScanfiles().get(0).setDownurl(downurl);
|
||||
}
|
||||
log.info("[{}]调用下载服务,地址:{} ,参数:{}", requestId, downUrl, requestLogParam);
|
||||
String respBody = post(downUrl, requestParam);
|
||||
log.info("[{}]调用下载服务成功,响应参数:{}", requestId, respBody);
|
||||
return Func.readJson(respBody, CommonResult.class);
|
||||
}
|
||||
|
||||
public String post(String url, String body) {
|
||||
HttpRequest post = HttpUtil.createPost(url);
|
||||
post.setConnectionTimeout(5 * 1000);
|
||||
post.setReadTimeout(60 * 1000);
|
||||
post.header("Content-Type", "application/json; charset=utf-8");
|
||||
post.body(body);
|
||||
HttpResponse response = post.execute();
|
||||
return response.body();
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.docus.bgts.emr.enums.Codes;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
public class FileUtils {
|
||||
public static String currentPath() {
|
||||
File dir = new File(".");
|
||||
String currentpath = "";
|
||||
|
||||
try {
|
||||
currentpath = dir.getCanonicalPath();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return currentpath;
|
||||
}
|
||||
|
||||
public static Object getJsonByName(String name) {
|
||||
String path = currentPath();
|
||||
String json = JsonUtils.readJsonFile(path + Codes.JSON_ADDRESS.getMessage());
|
||||
Map jsonMap = (Map)JSON.parseObject(json, Map.class);
|
||||
return jsonMap.get(name);
|
||||
}
|
||||
|
||||
public static String readJsonFromCurrentProject(String fileName) {
|
||||
String path = currentPath();
|
||||
String filePath = path + File.separator + fileName;
|
||||
return JsonUtils.readJsonFile(filePath);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,191 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.client.methods.HttpRequestBase;
|
||||
import org.apache.http.client.methods.RequestBuilder;
|
||||
import org.apache.http.client.utils.URIBuilder;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class HttpUtils {
|
||||
private static final Logger log = LoggerFactory.getLogger(HttpUtils.class);
|
||||
private static PoolingHttpClientConnectionManager cm;
|
||||
private static String EMPTY_STR = "";
|
||||
private static String UTF_8 = "UTF-8";
|
||||
|
||||
private static void init() {
|
||||
if (cm == null) {
|
||||
cm = new PoolingHttpClientConnectionManager();
|
||||
cm.setMaxTotal(50);
|
||||
cm.setDefaultMaxPerRoute(5);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static CloseableHttpClient getHttpClient() {
|
||||
init();
|
||||
return HttpClients.custom().setConnectionManager(cm).build();
|
||||
}
|
||||
|
||||
public static String get(String url) {
|
||||
HttpGet httpGet = new HttpGet(url);
|
||||
return getResult((HttpRequestBase)httpGet);
|
||||
}
|
||||
|
||||
public static String get(String url, Map<String, String> params) throws URISyntaxException {
|
||||
URIBuilder ub = new URIBuilder();
|
||||
ub.setPath(url);
|
||||
ArrayList<NameValuePair> pairs = covertParams2NVPS(params);
|
||||
ub.setParameters(pairs);
|
||||
HttpGet httpGet = new HttpGet(ub.build());
|
||||
return getResult((HttpRequestBase)httpGet);
|
||||
}
|
||||
|
||||
public static String get(String url, Map<String, Object> headers, Map<String, String> params) throws URISyntaxException {
|
||||
URIBuilder ub = new URIBuilder();
|
||||
ub.setPath(url);
|
||||
if (params != null) {
|
||||
ArrayList<NameValuePair> pairs = covertParams2NVPS(params);
|
||||
ub.setParameters(pairs);
|
||||
}
|
||||
|
||||
HttpGet httpGet = new HttpGet(ub.build());
|
||||
|
||||
for(Map.Entry<String, Object> param : headers.entrySet()) {
|
||||
httpGet.addHeader((String)param.getKey(), String.valueOf(param.getValue()));
|
||||
}
|
||||
|
||||
return getResult((HttpRequestBase)httpGet);
|
||||
}
|
||||
|
||||
public static String post(String url) {
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
return getResult((HttpRequestBase)httpPost);
|
||||
}
|
||||
|
||||
public static String post(String url, Map<String, String> params) throws UnsupportedEncodingException {
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
httpPost.setEntity(new UrlEncodedFormEntity(covertParams2NVPS(params), "utf-8"));
|
||||
return getResult((HttpRequestBase)httpPost);
|
||||
}
|
||||
|
||||
public static String post(String url, Object params, Map<String, Object> head) throws UnsupportedEncodingException {
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
System.out.println(params);
|
||||
httpPost.setEntity(new StringEntity(params.toString()));
|
||||
if (params != null) {
|
||||
for(Map.Entry<String, Object> param : head.entrySet()) {
|
||||
httpPost.addHeader((String)param.getKey(), String.valueOf(param.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
return getResult((HttpRequestBase)httpPost);
|
||||
}
|
||||
|
||||
private static ArrayList<NameValuePair> covertParams2NVPS(Map<String, String> params) {
|
||||
ArrayList<NameValuePair> pairs = new ArrayList();
|
||||
|
||||
for(Map.Entry<String, String> param : params.entrySet()) {
|
||||
if (param.getValue() != null) {
|
||||
pairs.add(new BasicNameValuePair((String)param.getKey(), (String)param.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
return pairs;
|
||||
}
|
||||
|
||||
public static String post(String url, Map<String, Object> headers, Map<String, Object> params) throws UnsupportedEncodingException {
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
System.out.println(params);
|
||||
if (params != null) {
|
||||
for(Map.Entry<String, Object> param : headers.entrySet()) {
|
||||
httpPost.addHeader((String)param.getKey(), String.valueOf(param.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
log.info("调用下载参数----" + JSON.toJSONString(params));
|
||||
httpPost.setEntity(new StringEntity(JSON.toJSONString(params), ContentType.APPLICATION_JSON));
|
||||
return getResult((HttpRequestBase)httpPost);
|
||||
}
|
||||
|
||||
public static String postSubmit(String url, Map<String, Object> headers, Map<String, List<String>> params) throws UnsupportedEncodingException {
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
if (params != null) {
|
||||
for(Map.Entry<String, Object> param : headers.entrySet()) {
|
||||
httpPost.addHeader((String)param.getKey(), String.valueOf(param.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
httpPost.setEntity(new StringEntity(JSON.toJSONString(params), ContentType.APPLICATION_JSON));
|
||||
return getResult((HttpRequestBase)httpPost);
|
||||
}
|
||||
|
||||
private static String getResult(HttpRequestBase request) {
|
||||
CloseableHttpClient httpClient = getHttpClient();
|
||||
|
||||
try {
|
||||
CloseableHttpResponse response = httpClient.execute(request);
|
||||
HttpEntity entity = response.getEntity();
|
||||
if (entity != null) {
|
||||
String result = EntityUtils.toString(entity, UTF_8);
|
||||
response.close();
|
||||
return result;
|
||||
}
|
||||
} catch (ClientProtocolException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
;
|
||||
}
|
||||
|
||||
return EMPTY_STR;
|
||||
}
|
||||
|
||||
private static String getResult(RequestBuilder requestBuilder) {
|
||||
CloseableHttpClient httpClient = getHttpClient();
|
||||
|
||||
try {
|
||||
CloseableHttpResponse response = httpClient.execute(requestBuilder.build());
|
||||
HttpEntity entity = response.getEntity();
|
||||
if (entity != null) {
|
||||
String result = EntityUtils.toString(entity, UTF_8);
|
||||
response.close();
|
||||
return result;
|
||||
}
|
||||
} catch (ClientProtocolException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
;
|
||||
}
|
||||
|
||||
return EMPTY_STR;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
|
||||
public class JsonUtils {
|
||||
public static String readJsonFile(String fileName) {
|
||||
String jsonStr = "";
|
||||
Reader reader = null;
|
||||
FileReader fileReader = null;
|
||||
|
||||
|
||||
try {
|
||||
File jsonFile = new File(fileName);
|
||||
fileReader = new FileReader(jsonFile);
|
||||
reader = new InputStreamReader(new FileInputStream(jsonFile), "utf-8");
|
||||
int ch = 0;
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
while((ch = reader.read()) != -1) {
|
||||
sb.append((char)ch);
|
||||
}
|
||||
|
||||
fileReader.close();
|
||||
reader.close();
|
||||
jsonStr = sb.toString();
|
||||
String var7 = jsonStr;
|
||||
return var7;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
} finally {
|
||||
try {
|
||||
reader.close();
|
||||
fileReader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,205 @@
|
||||
package com.docus.bgts.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class TableJsonRead {
|
||||
|
||||
/**
|
||||
* 读取数据结构
|
||||
* @param path 路径后缀
|
||||
* @param fileName 文件名称
|
||||
* @return
|
||||
*/
|
||||
public <T> T Read(String path,String fileName,Class<T> clazz){
|
||||
String currentPath=CurrentPath();
|
||||
path = currentPath+"\\"+path;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
T dto =null;
|
||||
File file = new File(path+"\\"+fileName);
|
||||
try {
|
||||
if (!file.getParentFile().exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
}
|
||||
if (!file.exists()) {
|
||||
try {
|
||||
file.createNewFile();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
BufferedReader bufferedReader = null;
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
|
||||
String line;
|
||||
while (!StringUtils.isEmpty(line = bufferedReader.readLine())) {
|
||||
sb.append(line);
|
||||
}
|
||||
if (sb.length() > 0) {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
//dto = (T)JSONObject.parse(sb.toString());
|
||||
dto= objectMapper.readValue(sb.toString(), clazz);
|
||||
//dto = objectMapper.convertValue(o, new TypeReference<T>() { });
|
||||
}
|
||||
bufferedReader.close();
|
||||
}
|
||||
|
||||
return dto;
|
||||
}
|
||||
catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public <T> T Read(File file,Class<T> clazz) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
T dto =null;
|
||||
try {
|
||||
if (!file.getParentFile().exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
}
|
||||
if (!file.exists()) {
|
||||
try {
|
||||
file.createNewFile();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
BufferedReader bufferedReader = null;
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
|
||||
String line;
|
||||
while (!StringUtils.isEmpty(line = bufferedReader.readLine())) {
|
||||
sb.append(line);
|
||||
}
|
||||
if (sb.length() > 0) {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
//dto = (T)JSONObject.parse(sb.toString());
|
||||
dto= objectMapper.readValue(sb.toString(), clazz);
|
||||
//dto = objectMapper.convertValue(o, new TypeReference<T>() { });
|
||||
}
|
||||
bufferedReader.close();
|
||||
}
|
||||
|
||||
return dto;
|
||||
}
|
||||
catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 取得当前jar路径
|
||||
* @return
|
||||
*/
|
||||
public static String CurrentPath(){
|
||||
File dir = new File(".");
|
||||
String currentpath ="";
|
||||
try {
|
||||
currentpath = dir.getCanonicalPath();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return currentpath;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取得当前jar路径
|
||||
* @return
|
||||
*/
|
||||
public static String currentPath(String dir){
|
||||
String path = CurrentPath() + File.separator + dir;
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
TableJsonRead tableJsonRead = new TableJsonRead();
|
||||
JSONObject config = tableJsonRead.Read("dataConfig", "EmrPushConf.json", JSONObject.class);
|
||||
System.out.println(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取文件内容
|
||||
* @param path
|
||||
* @param fileName
|
||||
* @return
|
||||
*/
|
||||
public String ReadContent(String path,String fileName){
|
||||
String currentPath=CurrentPath();
|
||||
path = currentPath+"\\"+path;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
File file = new File(path+"\\"+fileName);
|
||||
try {
|
||||
if (!file.getParentFile().exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
}
|
||||
if (!file.exists()) {
|
||||
try {
|
||||
file.createNewFile();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
BufferedReader bufferedReader = null;
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
|
||||
String line;
|
||||
while (!StringUtils.isEmpty(line = bufferedReader.readLine())) {
|
||||
sb.append(line);
|
||||
}
|
||||
|
||||
bufferedReader.close();
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存json至文件
|
||||
* @param path 路径后缀
|
||||
* @param fileName 文件名称
|
||||
* @param data json信息
|
||||
* @return
|
||||
*/
|
||||
public void Save(String path,String fileName,String data){
|
||||
String currentPath=CurrentPath();
|
||||
path = currentPath+"\\"+path;
|
||||
FileWriter fwriter = null;
|
||||
try {
|
||||
File file = new File(path);
|
||||
if (!file.getParentFile().exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
}
|
||||
fwriter = new FileWriter(path+"\\"+fileName);
|
||||
fwriter.write(data);
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
fwriter.flush();
|
||||
fwriter.close();
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.docus.bgts.emr.enums.Codes;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.Element;
|
||||
import org.dom4j.io.SAXReader;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class XmlUtils {
|
||||
private SAXReader saxReader = new SAXReader();
|
||||
private Document document;
|
||||
|
||||
public Document getDocument() {
|
||||
return this.document;
|
||||
}
|
||||
|
||||
public XmlUtils(String path) {
|
||||
try {
|
||||
this.document = this.saxReader.read(path);
|
||||
} catch (DocumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public XmlUtils(InputStream path) {
|
||||
try {
|
||||
this.document = this.saxReader.read(path);
|
||||
} catch (DocumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Element getElement(List<String> directory) {
|
||||
Element root = this.document.getRootElement();
|
||||
Element current = root;
|
||||
|
||||
for(String dire : directory) {
|
||||
current = current.element(dire);
|
||||
}
|
||||
|
||||
if (current == null) {
|
||||
throw new RuntimeException("未找到对应节点");
|
||||
} else {
|
||||
return current;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Element> getJsonByName(Element root) {
|
||||
String path = FileUtils.currentPath();
|
||||
String json = JsonUtils.readJsonFile(path + Codes.JSON_ADDRESS.getMessage());
|
||||
Map jsonMap = (Map)JSON.parseObject(json, Map.class);
|
||||
List<String> basicArr = (List)jsonMap.get("doubleBasic");
|
||||
List<Element> elements = null;
|
||||
|
||||
for(String basic : basicArr) {
|
||||
elements = root.elements(basic);
|
||||
if (elements != null && elements.size() > 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (elements == null || elements.size() == 0) {
|
||||
elements = new ArrayList();
|
||||
elements.add(root);
|
||||
}
|
||||
|
||||
return elements;
|
||||
}
|
||||
|
||||
public Element getMsgElement() {
|
||||
String path = FileUtils.currentPath();
|
||||
String json = JsonUtils.readJsonFile(path + Codes.JSON_ADDRESS.getMessage());
|
||||
Map jsonMap = (Map)JSON.parseObject(json, Map.class);
|
||||
List<String> directory = (List)jsonMap.get("directory");
|
||||
Element root = this.getElement(directory);
|
||||
return root;
|
||||
}
|
||||
|
||||
public String getElementText(String name) {
|
||||
Element root = this.document.getRootElement();
|
||||
Element msg = root.element(Codes.MSG.getMessage());
|
||||
if (msg == null) {
|
||||
throw new RuntimeException("没有" + Codes.MSG.getMessage() + "节点");
|
||||
} else {
|
||||
Element element = msg.element(name);
|
||||
return element == null ? null : element.getText();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("文件库中的省中医病案采集表")
|
||||
@Data
|
||||
public class AfInterfaceCollect implements Serializable {
|
||||
private Long id;
|
||||
@ApiModelProperty("任务流水号")
|
||||
private String serialnum;
|
||||
@ApiModelProperty("记账号")
|
||||
private String jzh;
|
||||
@ApiModelProperty("任务数")
|
||||
private Integer taskCount;
|
||||
@ApiModelProperty("完成数")
|
||||
private Integer completeCount;
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ApiModel("撤销文件类")
|
||||
@Data
|
||||
public class CanlcelDto {
|
||||
@ApiModelProperty("采集流水号")
|
||||
private String serialnum;
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CqcSubmitState {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String patientId;
|
||||
private Integer doctorState;
|
||||
private Integer nurseState;
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("错误日志表")
|
||||
@Data
|
||||
public class MrReportError {
|
||||
private Long id;
|
||||
@ApiModelProperty("上报信息")
|
||||
private String xml;
|
||||
@ApiModelProperty("上报类型")
|
||||
private Integer reportType;
|
||||
@ApiModelProperty("上报时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel(
|
||||
value = "TBasicExtend对象",
|
||||
description = "病案基本信息扩展表"
|
||||
)
|
||||
@Data
|
||||
public class TBasicExtend {
|
||||
@ApiModelProperty("病案主键")
|
||||
@TableId(
|
||||
value = "patient_id",
|
||||
type = IdType.ASSIGN_ID
|
||||
)
|
||||
private String patientId;
|
||||
@ApiModelProperty("报销政策代码")
|
||||
private String claimPolicyCode;
|
||||
@ApiModelProperty("报销政策名称")
|
||||
private String claimPolicyName;
|
||||
@ApiModelProperty("医保结算类型代码")
|
||||
private String mioSettleTypeCode;
|
||||
@ApiModelProperty("医保结算类型名称")
|
||||
private String mioSettleTypeName;
|
||||
@ApiModelProperty("医生提交时间")
|
||||
private Date doctorSubmitTime;
|
||||
@ApiModelProperty("护理提交时间")
|
||||
private Date nurseSubmitTime;
|
||||
@ApiModelProperty("责任护士")
|
||||
private String dutyNurse;
|
||||
@ApiModelProperty("预住院流水号")
|
||||
private String preJzh;
|
||||
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.docus.bgts.rpc.dto.ReportDownDto;
|
||||
import com.docus.bgts.wzh.entity.AfCollectTask;
|
||||
import com.docus.bgts.wzh.entity.CanlcelDto;
|
||||
import com.docus.bgts.wzh.entity.TBasic;
|
||||
import com.docus.bgts.wzh.entity.ZdAssort;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IAfCollectTaskService extends IService<AfCollectTask> {
|
||||
String getpatientIdByJzh(String jzh);
|
||||
|
||||
String getpatientIdBysealId(String sealId);
|
||||
|
||||
String getNameByPatientId(String patientId);
|
||||
|
||||
String getOutpatientIdByJzhel(String jzh);
|
||||
|
||||
void insertTask(ReportDownDto reportDownDto);
|
||||
|
||||
void insertSeal(ReportDownDto reportDownDto);
|
||||
|
||||
void updateInterfaceCollect(String collectSubId, int state);
|
||||
|
||||
List<String> listJZHByDate(String date1, String date2);
|
||||
|
||||
void invokeRepoalFile(CanlcelDto canlcelDto) throws Exception;
|
||||
|
||||
String selectJzh(String inPatientNo, String examApplyDate);
|
||||
|
||||
String getAssortIdByAssortId(String assortId);
|
||||
|
||||
String getAssortIdByAssortName(String assortId);
|
||||
|
||||
void insertZdAssort(ZdAssort zdAssort);
|
||||
|
||||
int cancelTsaByPatientIdAndSource(String patientId, String assortId);
|
||||
|
||||
|
||||
int updateNurseSubmitTime(ReportDownDto reportDownDto, String nurseSubmitTime, String nurseSubmitName);
|
||||
|
||||
int updateDoctorSubmitTime(ReportDownDto reportDownDto, String doctorSubmitTime, String doctorSubmitName);
|
||||
|
||||
void insertNurseState(ReportDownDto reportDownDto, String nurseSubmitTime);
|
||||
|
||||
void insertDoctorState(ReportDownDto reportDownDto, String doctorSubmitTime);
|
||||
|
||||
TBasic selectDisDateIsNull(String inPatientNo);
|
||||
|
||||
String selectDisDateIsNullJzh(String inPatientNo, String examApplyDate);
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.facade;
|
||||
|
||||
public interface IMrReportErrorService {
|
||||
void insert(String xml);
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.docus.bgts.wzh.entity.AfCollectTask;
|
||||
import com.docus.bgts.wzh.entity.CqcSubmitState;
|
||||
import com.docus.bgts.wzh.entity.TBasic;
|
||||
import com.docus.bgts.wzh.entity.ZdAssort;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface AfCollectTaskMapper extends BaseMapper<AfCollectTask> {
|
||||
List<String> listJZHByDate(@Param("date1") String date1, @Param("date2") String date2);
|
||||
|
||||
String getpatientIdByJzh(@Param("jzh") String jzh);
|
||||
|
||||
String getPatientIdBysealId(@Param("sealId") String sealId);
|
||||
|
||||
String selectJzh(@Param("inPatientNo") String inPatientNo, @Param("examApplyDate") String examApplyDate);
|
||||
|
||||
TBasic selectDisDateIsNull(@Param("inPatientNo") String inPatientNo);
|
||||
|
||||
String selectDisDateIsNullJzh(@Param("inPatientNo") String inPatientNo, @Param("examApplyDate") String examApplyDate);
|
||||
|
||||
String getAssortIdByAssortId(@Param("assortId") String assortId);
|
||||
|
||||
String getAssortIdByAssortName(@Param("assortName") String assortName);
|
||||
|
||||
void insertZdAssort(@Param("zdAssort") ZdAssort zdAssort);
|
||||
|
||||
|
||||
int cancelTsaByPatientIdAndSource(@Param("patientId") String patientId, @Param("source") String source);
|
||||
|
||||
|
||||
int insertDoctorState(CqcSubmitState cqcSubmitState);
|
||||
|
||||
int updateDoctorState(CqcSubmitState cqcSubmitState);
|
||||
|
||||
CqcSubmitState selectByPatientId(String patientId);
|
||||
|
||||
String selectPatientByjzh(String jzh);
|
||||
|
||||
String selectNameByPatientId(String patientId);
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.docus.bgts.wzh.entity.AfInterfaceCollect;
|
||||
|
||||
public interface AfInterfaceCollectMapper extends BaseMapper<AfInterfaceCollect> {
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.docus.bgts.wzh.entity.AfInterfaceCollectSub;
|
||||
|
||||
public interface AfInterfaceCollectSubMapper extends BaseMapper<AfInterfaceCollectSub> {
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.mapper;
|
||||
|
||||
import com.docus.bgts.wzh.entity.MrReportError;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface MrReportErrorMapper {
|
||||
void save(@Param("mrReportError") MrReportError mrReportError);
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.docus.bgts.wzh.entity.TBasicExtend;
|
||||
|
||||
public interface TBasicExtendMapper extends BaseMapper<TBasicExtend> {
|
||||
TBasicExtend selectByPatientId(String patientId);
|
||||
|
||||
int updatenurseSubmitTime(TBasicExtend tBasicExtend);
|
||||
|
||||
int updateDoctorSubmitTime(TBasicExtend tBasicExtend);
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.docus.bgts.wzh.entity.TBasic;
|
||||
|
||||
public interface TBasicMapper extends BaseMapper<TBasic> {
|
||||
TBasic selectByjzh(String jzh);
|
||||
|
||||
TBasic selectByPatientId(String patientId);
|
||||
|
||||
int update(TBasic tbasic);
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.docus.bgts.wzh.entity.TBasic;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface TScanAssortMapper extends BaseMapper<TBasic> {
|
||||
int updateByPatientId(@Param("patientId") String PatientId, @Param("PrePatientId") String PrePatientId);
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package com.docus.bgts.wzh.service;
|
||||
|
||||
import com.docus.bgts.utils.FileUtils;
|
||||
import com.docus.bgts.wzh.entity.MrReportError;
|
||||
import com.docus.bgts.wzh.facade.IMrReportErrorService;
|
||||
import com.docus.bgts.wzh.mapper.MrReportErrorMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
public class MrReportErrorServiceImpl implements IMrReportErrorService {
|
||||
private static final Logger log = LoggerFactory.getLogger(MrReportErrorServiceImpl.class);
|
||||
@Autowired
|
||||
MrReportErrorMapper mrReportErrorMapper;
|
||||
@Override
|
||||
public void insert(String xml) {
|
||||
log.info("------发送错误:并记录日志------");
|
||||
MrReportError mrReportError = new MrReportError();
|
||||
mrReportError.setXml(xml);
|
||||
mrReportError.setCreateTime(new Date());
|
||||
Integer collectorid = Integer.valueOf(String.valueOf(FileUtils.getJsonByName("collectorid")));
|
||||
mrReportError.setReportType(collectorid);
|
||||
this.mrReportErrorMapper.save(mrReportError);
|
||||
log.info("--------日志记录完成------");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,112 @@
|
||||
<?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.bgts.wzh.mapper.AfCollectTaskMapper">
|
||||
|
||||
|
||||
<select id="listJZHByDate" resultType="string">
|
||||
select jzh
|
||||
from docus_medicalrecord.t_basic a
|
||||
where
|
||||
a.create_time >=#{date1}
|
||||
and a.create_time <=#{date2}
|
||||
and a.jzh is not null
|
||||
and a.is_archive=0
|
||||
and a.dis_dept in ('1211','1252')
|
||||
and jzh not in
|
||||
(select C3 from af_collect_task where sysflag=22 and state=3)
|
||||
order by create_time asc
|
||||
</select>
|
||||
<select id="selectDisDateIsNull" resultType="com.docus.bgts.wzh.entity.TBasic">
|
||||
select *
|
||||
from docus_medicalrecord.t_basic
|
||||
where inpatient_no=#{inPatientNo}
|
||||
and dis_date is null
|
||||
</select>
|
||||
<select id="selectDisDateIsNullJzh" resultType="string">
|
||||
select t.jzh
|
||||
from(
|
||||
select admiss_date,dis_date,jzh
|
||||
from docus_medicalrecord.t_basic
|
||||
where inpatient_no=#{inPatientNo} and dis_date is null and ph is null
|
||||
) t
|
||||
where date_sub(t.admiss_date, interval 6 hour) <= #{examApplyDate}
|
||||
</select>
|
||||
<select id="selectJzh" resultType="string">
|
||||
select t.jzh
|
||||
from(
|
||||
select admiss_date,dis_date,jzh,ph
|
||||
from docus_medicalrecord.t_basic
|
||||
where inpatient_no=#{inPatientNo}
|
||||
) t
|
||||
where date_sub(t.admiss_date, interval 6 hour) <= #{examApplyDate}
|
||||
and date_add(t.dis_date, interval 6 hour) >= #{examApplyDate}
|
||||
and t.ph is null
|
||||
</select>
|
||||
<select id="getpatientIdByJzh" resultType="string">
|
||||
select patient_id
|
||||
from docus_medicalrecord.t_basic
|
||||
where jzh=#{jzh}
|
||||
</select>
|
||||
|
||||
<select id="getAssortIdByAssortId" resultType="string">
|
||||
select assort_id from zd_assort where assort_id=#{assortId}
|
||||
</select>
|
||||
|
||||
<select id="getAssortIdByAssortName" resultType="string">
|
||||
select assort_id from zd_assort where assort_name=#{assortName}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertZdAssort">
|
||||
insert into zd_assort(assort_id,assort_name,effective) values(#{zdAssort.assortId},#{zdAssort.assortName},#{zdAssort.effective})
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<update id="cancelTsaByPatientIdAndSource">
|
||||
update t_scan_assort
|
||||
set is_del = 1
|
||||
where
|
||||
patient_id= #{patientId} and source= #{source}
|
||||
</update>
|
||||
|
||||
<insert id="insertDoctorState">
|
||||
insert into docus_medicalrecord.cqc_submit_state(patient_id,doctor_state,nurse_state) values(#{patientId},#{doctorState},#{nurseState})
|
||||
</insert>
|
||||
|
||||
<update id="updateDoctorState">
|
||||
update docus_medicalrecord.cqc_submit_state
|
||||
<set>
|
||||
<if test="doctorState!=null">
|
||||
doctor_state=#{doctorState},
|
||||
</if>
|
||||
|
||||
<if test="nurseState!=null">
|
||||
nurse_state=#{nurseState},
|
||||
</if>
|
||||
</set>
|
||||
where patient_id=#{patientId}
|
||||
</update>
|
||||
|
||||
<select id="selectByPatientId" resultType="com.docus.bgts.wzh.entity.CqcSubmitState">
|
||||
select * from docus_medicalrecord.cqc_submit_state
|
||||
where patient_id=#{patientId}
|
||||
</select>
|
||||
<select id="selectPatientByjzh" resultType="java.lang.String">
|
||||
select patient_id
|
||||
from docus_medicalrecord.t_basic_out
|
||||
where jzh=#{jzh}
|
||||
</select>
|
||||
<select id="selectNameByPatientId" resultType="java.lang.String">
|
||||
select creater_name from docus_medicalrecord.cqc_back_info_log where patient_id=#{patientId} and create_time in
|
||||
(select max(create_time) from docus_medicalrecord.cqc_back_info_log where patient_id=#{patientId})
|
||||
</select>
|
||||
<select id="getPatientIdBysealId" resultType="java.lang.String">
|
||||
select patient_id from docus_medicalrecord.t_seal where seal_id=#{sealId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,12 @@
|
||||
<?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.bgts.wzh.mapper.MrReportErrorMapper">
|
||||
|
||||
<insert id="save" parameterType="com.docus.bgts.wzh.entity.MrReportError">
|
||||
insert into docus_medicalrecord.mr_report_error(xml,report_type,create_time)
|
||||
values(#{mrReportError.xml},#{mrReportError.reportType},#{mrReportError.createTime})
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@ -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.bgts.wzh.mapper.TBasicExtendMapper">
|
||||
<update id="updatenurseSubmitTime">
|
||||
update docus_medicalrecord.t_basic_extend
|
||||
set nurse_submit_time=#{nurseSubmitTime}
|
||||
where patient_id=#{patientId}
|
||||
</update>
|
||||
<update id="updateDoctorSubmitTime">
|
||||
update docus_medicalrecord.t_basic_extend
|
||||
set doctor_submit_time=#{doctorSubmitTime}
|
||||
where patient_id=#{patientId}
|
||||
</update>
|
||||
<select id="selectByPatientId" resultType="com.docus.bgts.wzh.entity.TBasicExtend">
|
||||
select *
|
||||
from
|
||||
docus_medicalrecord.t_basic_extend
|
||||
where patient_id=#{patientId}
|
||||
|
||||
</select>
|
||||
<insert id="insert" parameterType="com.docus.bgts.wzh.entity.TBasicExtend">
|
||||
insert into docus_medicalrecord.t_basic_extend (patient_id,claim_policy_code,claim_policy_name,mio_settle_type_code,mio_settle_type_name,doctor_submit_time,nurse_submit_time,duty_nurse)
|
||||
values (#{patientId},#{claimPolicyCode},#{claimPolicyName},#{mioSettleTypeCode},#{mioSettleTypeName},#{doctorSubmitTime},#{nurseSubmitTime},#{dutyNurse})
|
||||
</insert>
|
||||
</mapper>
|
||||
@ -0,0 +1,76 @@
|
||||
<?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.bgts.wzh.mapper.TBasicMapper">
|
||||
<update id="updateDisDate">
|
||||
update docus_medicalrecord.t_basic
|
||||
<set>
|
||||
<if test="tBasic.admiss_times != null">
|
||||
IPAddress=#{pcmachine.ipaddress},
|
||||
</if>
|
||||
<if test="pcmachine.lastonline != null">
|
||||
LastOnline=#{pcmachine.lastonline},
|
||||
</if>
|
||||
<if test="pcmachine.pcstatus != null">
|
||||
PCStatus=#{pcmachine.pcstatus}
|
||||
</if>
|
||||
<if test="pcmachine.ipaddress != null">
|
||||
IPAddress=#{pcmachine.ipaddress},
|
||||
</if>
|
||||
<if test="pcmachine.lastonline != null">
|
||||
LastOnline=#{pcmachine.lastonline},
|
||||
</if>
|
||||
<if test="pcmachine.pcstatus != null">
|
||||
PCStatus=#{pcmachine.pcstatus}
|
||||
</if>
|
||||
<if test="pcmachine.ipaddress != null">
|
||||
IPAddress=#{pcmachine.ipaddress},
|
||||
</if>
|
||||
<if test="pcmachine.lastonline != null">
|
||||
LastOnline=#{pcmachine.lastonline},
|
||||
</if>
|
||||
<if test="pcmachine.pcstatus != null">
|
||||
PCStatus=#{pcmachine.pcstatus}
|
||||
</if>
|
||||
<if test="pcmachine.ipaddress != null">
|
||||
IPAddress=#{pcmachine.ipaddress},
|
||||
</if>
|
||||
<if test="pcmachine.lastonline != null">
|
||||
LastOnline=#{pcmachine.lastonline},
|
||||
</if>
|
||||
<if test="pcmachine.pcstatus != null">
|
||||
PCStatus=#{pcmachine.pcstatus}
|
||||
</if>
|
||||
<if test="pcmachine.ipaddress != null">
|
||||
IPAddress=#{pcmachine.ipaddress},
|
||||
</if>
|
||||
<if test="pcmachine.lastonline != null">
|
||||
LastOnline=#{pcmachine.lastonline},
|
||||
</if>
|
||||
<if test="pcmachine.pcstatus != null">
|
||||
PCStatus=#{pcmachine.pcstatus}
|
||||
</if>
|
||||
</set>
|
||||
where id=#{pcmachine.id}
|
||||
</update>
|
||||
|
||||
<update id="update" parameterType="com.docus.bgts.wzh.entity.TBasic">
|
||||
UPDATE docus_medicalrecord.t_basic
|
||||
<set>
|
||||
<if test="null != doctorState and '' != doctorState">doctor_state = #{doctorState},</if>
|
||||
<if test="null != nurseState and '' != nurseState">nurse_state = #{nurseState},</if>
|
||||
</set>
|
||||
WHERE patient_id = #{patientId}
|
||||
</update>
|
||||
<select id="selectByjzh" resultType="com.docus.bgts.wzh.entity.TBasic">
|
||||
SELECT *
|
||||
FROM docus_medicalrecord.t_basic
|
||||
WHERE jzh = #{jzh}
|
||||
</select>
|
||||
<select id="selectByPatientId" resultType="com.docus.bgts.wzh.entity.TBasic">
|
||||
SELECT *
|
||||
FROM docus_medicalrecord.t_basic
|
||||
WHERE patient_id = #{patientId}
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,10 @@
|
||||
<?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.bgts.wzh.mapper.TScanAssortMapper">
|
||||
<update id="updateByPatientId">
|
||||
update docus_archivefile.t_scan_assort set patient_id=#{patientId},assort_id='Wiw213woq412awqe42' where patient_id=#{PrePatientId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue