master
commit
532cfec2dd
@ -0,0 +1,4 @@
|
||||
/.idea/
|
||||
/target/
|
||||
/out/
|
||||
*.iml
|
@ -0,0 +1,121 @@
|
||||
<?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.1.9.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.ann</groupId>
|
||||
<artifactId>demo</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
<name>demo</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<skipTests>true</skipTests>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- CXF webservice -->
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
|
||||
<version>3.2.5</version>
|
||||
</dependency>
|
||||
<!-- CXF webservice -->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 导入Mysql数据库链接jar包 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.30</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.4</version>
|
||||
</dependency>
|
||||
|
||||
<!--解析xpath-->
|
||||
<dependency>
|
||||
<groupId>jaxen</groupId>
|
||||
<artifactId>jaxen</artifactId>
|
||||
<version>1.1-beta-11</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!--sqlserver驱动 -->
|
||||
<dependency>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>sqljdbc4</artifactId>
|
||||
<version>4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 获取拼音首拼 -->
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
<version>2.5.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!--引入quartz定时框架-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-quartz</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.axis</groupId>
|
||||
<artifactId>axis</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>LISInterface</finalName>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,13 @@
|
||||
package com.ann.demo;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class DemoApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DemoApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.ann.demo;
|
||||
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
|
||||
public class ServletInitializer extends SpringBootServletInitializer {
|
||||
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
return application.sources(DemoApplication.class);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.ann.demo.controller;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: LeiJiaXin
|
||||
* @Date: 2019/8/1 9:57
|
||||
*/
|
||||
public class InterfaceForm {
|
||||
private String url;
|
||||
private String content;
|
||||
private String parameter;
|
||||
private String interfaceName;
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getParameter() {
|
||||
return parameter;
|
||||
}
|
||||
|
||||
public void setParameter(String parameter) {
|
||||
this.parameter = parameter;
|
||||
}
|
||||
|
||||
public String getInterfaceName() {
|
||||
return interfaceName;
|
||||
}
|
||||
|
||||
public void setInterfaceName(String interfaceName) {
|
||||
this.interfaceName = interfaceName;
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ann.demo.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.ann.demo.entity.constant.AliasName;
|
||||
import com.ann.demo.entity.constant.InterfaceName;
|
||||
import com.ann.demo.entity.filing.MessageSubordinate;
|
||||
import com.ann.demo.entity.filing.dto.MessageDto;
|
||||
import com.ann.demo.entity.filing.dto.PatientMainDto;
|
||||
import com.ann.demo.service.AnalysisService;
|
||||
import com.ann.demo.utils.XMLUtils;
|
||||
import org.apache.cxf.endpoint.Client;
|
||||
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @Author: LeiJiaXin
|
||||
* @Date: 2019/7/11 18:47
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/")
|
||||
public class TestController {
|
||||
|
||||
@Autowired
|
||||
AnalysisService analysisService;
|
||||
|
||||
@RequestMapping("/demo")
|
||||
public String aa() {
|
||||
return "demo";
|
||||
}
|
||||
|
||||
/*@ResponseBody*/
|
||||
@RequestMapping("/haha")
|
||||
public String cc(InterfaceForm interfaceForm) {
|
||||
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
|
||||
Client client = dcf.createClient(interfaceForm.getUrl());
|
||||
Object[] objects = new Object[0];
|
||||
try {
|
||||
// invoke("方法名",参数1,参数2,参数3....);
|
||||
if (Objects.equals(interfaceForm.getInterfaceName(), "ReceiveDict") ||
|
||||
Objects.equals(interfaceForm.getInterfaceName(), "InpSummary") ||
|
||||
Objects.equals(interfaceForm.getInterfaceName(), "handNumbnessReport") ||
|
||||
Objects.equals(interfaceForm.getInterfaceName(), InterfaceName.ICU_REPORT) ||
|
||||
Objects.equals(interfaceForm.getInterfaceName(), InterfaceName.BLOODAPPLY_REPORT) ||
|
||||
Objects.equals(interfaceForm.getInterfaceName(), InterfaceName.DOCTOR_DATA) ||
|
||||
Objects.equals(interfaceForm.getInterfaceName(), InterfaceName.NURSE_DATA)) {
|
||||
objects = client.invoke(interfaceForm.getInterfaceName(), interfaceForm.getContent());
|
||||
} else {
|
||||
objects = client.invoke(interfaceForm.getInterfaceName(), interfaceForm.getParameter(), interfaceForm.getContent());
|
||||
}
|
||||
|
||||
System.out.println(objects[0]);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "redirect:/demo";
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ann.demo.controller;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||
|
||||
/**
|
||||
* @Author: LeiJiaXin
|
||||
* @Date: 2019/8/1 9:30
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
public class UsingStaticController extends WebMvcConfigurationSupport {
|
||||
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
|
||||
}
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
package com.ann.demo.entity.constant;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description 类型
|
||||
* @Date 2019/6/12
|
||||
* @Created by ljx
|
||||
*/
|
||||
public class AliasName {
|
||||
|
||||
// public static final String USER = "用户字典";
|
||||
//
|
||||
// public static final String DEPARTMENT = "科室字典";
|
||||
//
|
||||
// // 超声报告
|
||||
// public static final String ULTRASONIC_REPORT = "57";
|
||||
//
|
||||
// // 病理检查报告单
|
||||
// public static final String PATHOLOGY_REPORT = "52";
|
||||
//
|
||||
// // 放射诊断报告单 54
|
||||
// public static final String RADIATION_REPORT = "54";
|
||||
//
|
||||
// // 心电图报告单 59
|
||||
// public static final String EKG_REPORT = "59";
|
||||
//
|
||||
// // 入院记录
|
||||
// public static final String ADMISSION_RECORD = "9";
|
||||
//
|
||||
// // 出院记录
|
||||
// public static final String DISCHARGE_RECORD = "113";
|
||||
//
|
||||
// // 转科记录
|
||||
// public static final String TRANSFER_RECORD = "114";
|
||||
//
|
||||
// // 取消入院
|
||||
// public static final String CANCELLATION_DISCHARGE = "115";
|
||||
//
|
||||
// // 手麻
|
||||
// public static final String HANDNUMBNESS_REPORT = "117";
|
||||
//
|
||||
// // ICU报告
|
||||
// public static final String ICU_REPORT = "121";
|
||||
//
|
||||
// // 其他类型 目前来说 是手麻系统的其他三个
|
||||
// public static final String OTHER = "18";
|
||||
//
|
||||
// // 检查申请单
|
||||
// public static final String PARAMETER_EXAMAPPLY = "119";
|
||||
//
|
||||
// // 输血单
|
||||
// public static final String BLOODAPPLY_REPORT = "120";
|
||||
//
|
||||
// // PET/CT报告单
|
||||
// public static final String PETCT_REPORT = "60";
|
||||
|
||||
// 检验申请单
|
||||
public static final String PARAMETER_INSPECTIONAPPLY = "118";
|
||||
|
||||
|
||||
// 检验申请单
|
||||
public static final String PARAMETER_VERIFICATIONINSPECTIONAPPLY = "130";
|
||||
|
||||
|
||||
// 检验报告
|
||||
public static final String INSPECTION_REPORT = "10";
|
||||
//
|
||||
// // 扫描文件
|
||||
// public static final String SCANNING_FILE = "30";
|
||||
//
|
||||
// // 护理、医生
|
||||
// public static final Map<String, String> DOCTOR_MAP;
|
||||
// public static final Map<String, String> NURSE_MAP;
|
||||
//
|
||||
// // 病案首页
|
||||
// public static final String MEDICAL_RECORD_HOMEPAGE = "3";
|
||||
//
|
||||
//
|
||||
// static {
|
||||
// DOCTOR_MAP = new HashMap<String, String>();
|
||||
// DOCTOR_MAP.put("入院记录", "9");
|
||||
// DOCTOR_MAP.put("病程记录", "11");
|
||||
// DOCTOR_MAP.put("术前文书", "12");
|
||||
// DOCTOR_MAP.put("手术资料", "13");
|
||||
// DOCTOR_MAP.put("讨论记录", "14");
|
||||
// DOCTOR_MAP.put("会诊记录", "15");
|
||||
// DOCTOR_MAP.put("出院记录", "113");
|
||||
// DOCTOR_MAP.put("死亡记录", "17");
|
||||
// DOCTOR_MAP.put("VTE文书", "23");
|
||||
// DOCTOR_MAP.put("其他记录", "18");
|
||||
// DOCTOR_MAP.put("医护共用", "19");
|
||||
// DOCTOR_MAP.put("知情同意", "20");
|
||||
// DOCTOR_MAP.put("疾病危重", "21");
|
||||
// DOCTOR_MAP.put("VTE记录", "22");
|
||||
// DOCTOR_MAP.put("病案首页", "3");
|
||||
// DOCTOR_MAP.put("病历文书", "");
|
||||
//
|
||||
// NURSE_MAP = new HashMap<String, String>();
|
||||
// NURSE_MAP.put("首次护理记录", "7");
|
||||
// NURSE_MAP.put("护理文书", "6");
|
||||
// NURSE_MAP.put("专科单护理", "24");
|
||||
// NURSE_MAP.put("知情文件", "8");
|
||||
// NURSE_MAP.put("体温单", "5");
|
||||
// NURSE_MAP.put("护理记录", "2");
|
||||
// NURSE_MAP.put("评估单", "4");
|
||||
// NURSE_MAP.put("病历护理文书", "");
|
||||
// }
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,125 @@
|
||||
package com.ann.demo.entity.constant;
|
||||
|
||||
/**
|
||||
* @Description 接口名称
|
||||
* @Date 2019/7/10 9:46
|
||||
* @Created by ljx
|
||||
*/
|
||||
public class InterfaceName {
|
||||
|
||||
/**
|
||||
* 用户、科室接口 ReceiveDict
|
||||
*/
|
||||
public static final String RECEIVE_DICT = "his系统";
|
||||
/**
|
||||
* V3接口
|
||||
*/
|
||||
public static final String HIP_MESSAGE_SERVER = "HIPMessageServer";
|
||||
|
||||
/**
|
||||
* 检查报告参数
|
||||
*/
|
||||
public static final String PARAMETER_REPORT = "ExamReportBackRequest";
|
||||
|
||||
/**
|
||||
* 超声
|
||||
*/
|
||||
public static final String ULTRASOUND_REPORT = "超声系统";
|
||||
/**
|
||||
* 心电图
|
||||
*/
|
||||
public static final String EKG_REPORT = "心电图系统";
|
||||
/**
|
||||
* 病理
|
||||
*/
|
||||
public static final String PATHOLOGY_REPORT = "病理系统";
|
||||
/**
|
||||
* 放射
|
||||
*/
|
||||
public static final String RADIATION_REPORT = "PACS系统";
|
||||
|
||||
/**
|
||||
* petct
|
||||
*/
|
||||
public static final String PET_REPORT = "核医学系统";
|
||||
/**
|
||||
* 入院参数
|
||||
*/
|
||||
public static final String PARAMETER_ADMISSION = "InPatientAddRequest";
|
||||
/**
|
||||
* 出院参数
|
||||
*/
|
||||
public static final String PARAMETER_DISCHARGE = "PatientOutRequest";
|
||||
|
||||
/**
|
||||
* 转科参数
|
||||
*/
|
||||
public static final String PARAMETER_TRANSFER = "InpatientTransferRequest";
|
||||
|
||||
/**
|
||||
* 取消入院
|
||||
*/
|
||||
public static final String PARAMETER_CANCELLATION_DISCHARGE = "CalPatientRequest";
|
||||
|
||||
|
||||
/**
|
||||
* 检查申请单
|
||||
*/
|
||||
public static final String PARAMETER_EXAMAPPLY = "ExamApplyRequest";
|
||||
|
||||
|
||||
/**
|
||||
* 病案首页
|
||||
*/
|
||||
public static final String INP_SUMMARY = "InpSummary";
|
||||
|
||||
/**
|
||||
* 手麻报告
|
||||
*/
|
||||
public static final String HANDNUMBNESS_REPORT = "手麻系统";
|
||||
|
||||
/**
|
||||
* 重症ICU报告
|
||||
*/
|
||||
public static final String ICU_REPORT = "重症监护归档";
|
||||
|
||||
/**
|
||||
* 输血单
|
||||
*/
|
||||
public static final String BLOODAPPLY_REPORT = "输血系统";
|
||||
|
||||
/**
|
||||
* 医生资料 病案首页 病历文书
|
||||
*/
|
||||
public static final String DOCTOR_DATA = "DoctorData";
|
||||
|
||||
/**
|
||||
* 护士资料 评估单 体温单 护理单2
|
||||
*/
|
||||
public static final String NURSE_DATA = "NurseData";
|
||||
|
||||
/**
|
||||
* lis系统
|
||||
*/
|
||||
public static final String INSPECTION_REPORT = "LIS系统";
|
||||
public static final String INSPECTION_REPORT_NAME = "LisSendReportBack";
|
||||
|
||||
/**
|
||||
* 扫描文件
|
||||
* ScanningFile
|
||||
*/
|
||||
public static final String SCANNING_FILE = "扫描系统";
|
||||
|
||||
/**
|
||||
* 2019-12-23
|
||||
* 检验申请单
|
||||
*/
|
||||
public static final String PARAMETER_INSPECTIONAPPLY = "InspectionApplyRequest";
|
||||
|
||||
/**
|
||||
* 2020-2-28
|
||||
* 检体核收
|
||||
*/
|
||||
public static final String PARAMETER_VERIFICATIONINSPECTIONAPPLY = "VerificationInspectionApplyRequest";
|
||||
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
package com.ann.demo.entity.constant;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WebserviceId {
|
||||
|
||||
/**
|
||||
* V3接口
|
||||
*/
|
||||
public static final String HIP_MESSAGE_SERVER = "HIPMessageServer";
|
||||
|
||||
/**
|
||||
* 检查报告参数
|
||||
*/
|
||||
public static final String PARAMETER_REPORT = "1";
|
||||
|
||||
/**
|
||||
* 检查申请单
|
||||
*/
|
||||
public static final String PARAMETER_EXAMAPPLY = "2";
|
||||
|
||||
/**
|
||||
* 2019-10-21
|
||||
* 检查申请单是否开立
|
||||
*/
|
||||
public static final String PARAMETER_EXAMAPPLYSTATECHANGE = "3";
|
||||
|
||||
/**
|
||||
* 2020-3-3
|
||||
* 检查申请单 是否核收
|
||||
*/
|
||||
public static final String PARAMETER_VERIFICATIONEXAMAPPLY = "4";
|
||||
|
||||
/**
|
||||
* 入院参数
|
||||
*/
|
||||
public static final String PARAMETER_ADMISSION = "5";
|
||||
/**
|
||||
* 出院参数
|
||||
*/
|
||||
public static final String PARAMETER_DISCHARGE = "6";
|
||||
|
||||
/**
|
||||
* 转科参数
|
||||
*/
|
||||
public static final String PARAMETER_TRANSFER = "7";
|
||||
|
||||
/**
|
||||
* 取消入院
|
||||
*/
|
||||
public static final String PARAMETER_CANCELLATION_DISCHARGE = "8";
|
||||
|
||||
/**
|
||||
* 患者更新
|
||||
*/
|
||||
public static final String PARAMETER_PATIENT_UPDATE = "9";
|
||||
|
||||
/**
|
||||
* lis系统
|
||||
*/
|
||||
public static final String INSPECTION_REPORT_NAME = "10";
|
||||
|
||||
/**
|
||||
* 2019-12-23
|
||||
* 检验申请单
|
||||
*/
|
||||
public static final String PARAMETER_INSPECTIONAPPLY = "11";
|
||||
|
||||
/**
|
||||
* 2020-2-28
|
||||
* 检体核收
|
||||
*/
|
||||
public static final String PARAMETER_VERIFICATIONINSPECTIONAPPLY = "12";
|
||||
|
||||
/**
|
||||
* 医生资料 病案首页 病历文书
|
||||
*/
|
||||
public static final String DOCTOR_DATA = "13";
|
||||
|
||||
/**
|
||||
* 护士资料 评估单 体温单 护理单2
|
||||
*/
|
||||
public static final String NURSE_DATA = "14";
|
||||
|
||||
/**
|
||||
* 病案首页
|
||||
*/
|
||||
public static final String INP_SUMMARY = "15";
|
||||
|
||||
/**
|
||||
* 手麻报告
|
||||
*/
|
||||
public static final String HANDNUMBNESS_REPORT = "16";
|
||||
|
||||
/**
|
||||
* 重症ICU报告
|
||||
*/
|
||||
public static final String ICU_REPORT = "17";
|
||||
|
||||
/**
|
||||
* 输血单
|
||||
*/
|
||||
public static final String BLOODAPPLY_REPORT = "18";
|
||||
|
||||
/**
|
||||
* 用户、科室接口 ReceiveDict
|
||||
*/
|
||||
public static final String RECEIVE_DICT = "19";
|
||||
|
||||
/**
|
||||
* 20200609主管医生
|
||||
*/
|
||||
public static final String BED_MANAGER = "20";
|
||||
|
||||
/**
|
||||
* 20200609死亡信息
|
||||
*/
|
||||
public static final String DIE_MEDICAL_ADVICE = "21";
|
||||
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package com.ann.demo.entity.filing;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
/**
|
||||
* @Description 消息从属版本
|
||||
* @Date 2019/7/9 16:33
|
||||
* @Created by ljx
|
||||
*/
|
||||
@Table
|
||||
@Entity
|
||||
public class MessageSubordinate {
|
||||
|
||||
/**
|
||||
* 消息从属Id
|
||||
*/
|
||||
@Id
|
||||
@GenericGenerator(name = "system-uuid", strategy = "uuid2")
|
||||
@GeneratedValue(generator = "system-uuid")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 消息Id
|
||||
*/
|
||||
private String messageId;
|
||||
|
||||
/**
|
||||
* 患者清单的关键信息
|
||||
*/
|
||||
private String patientMain;
|
||||
|
||||
/**
|
||||
* 消息Json
|
||||
*/
|
||||
@Lob
|
||||
private String contentJson;
|
||||
|
||||
/**
|
||||
* 2019-8-16
|
||||
* 循环次数
|
||||
*/
|
||||
private Integer runs = 0;
|
||||
|
||||
/**
|
||||
* 是否解析 0 未解析 1 解析 2 错误
|
||||
*/
|
||||
private Integer status = 0;
|
||||
|
||||
private String remark;
|
||||
|
||||
public MessageSubordinate(String messageId, String patientMain, String contentJson) {
|
||||
this.messageId = messageId;
|
||||
this.patientMain = patientMain;
|
||||
this.contentJson = contentJson;
|
||||
}
|
||||
|
||||
public MessageSubordinate() {
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getMessageId() {
|
||||
return messageId;
|
||||
}
|
||||
|
||||
public void setMessageId(String messageId) {
|
||||
this.messageId = messageId;
|
||||
}
|
||||
|
||||
public String getPatientMain() {
|
||||
return patientMain;
|
||||
}
|
||||
|
||||
public void setPatientMain(String patientMain) {
|
||||
this.patientMain = patientMain;
|
||||
}
|
||||
|
||||
public String getContentJson() {
|
||||
return contentJson;
|
||||
}
|
||||
|
||||
public void setContentJson(String contentJson) {
|
||||
this.contentJson = contentJson;
|
||||
}
|
||||
|
||||
public Integer getRuns() {
|
||||
return runs;
|
||||
}
|
||||
|
||||
public void setRuns(Integer runs) {
|
||||
this.runs = runs;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package com.ann.demo.entity.filing.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description 患者清单的关键信息
|
||||
* @Date 2019/7/9 16:36
|
||||
* @Created by ljx
|
||||
*/
|
||||
public class PatientMainDto {
|
||||
|
||||
/**
|
||||
* 住院号
|
||||
*/
|
||||
private String inpNo;
|
||||
|
||||
/**
|
||||
* 就诊次数
|
||||
*/
|
||||
private String visitId;
|
||||
|
||||
/**
|
||||
* 拓展字段1
|
||||
*/
|
||||
private String extendedField1;
|
||||
|
||||
/**
|
||||
* 拓展字段2
|
||||
*/
|
||||
private String extendedField2;
|
||||
|
||||
/**
|
||||
* 拓展字段3
|
||||
*/
|
||||
private String extendedField3;
|
||||
|
||||
public PatientMainDto(String inpNo, String visitId) {
|
||||
this.inpNo = inpNo;
|
||||
this.visitId = visitId;
|
||||
}
|
||||
|
||||
public String getInpNo() {
|
||||
return inpNo;
|
||||
}
|
||||
|
||||
public void setInpNo(String inpNo) {
|
||||
this.inpNo = inpNo;
|
||||
}
|
||||
|
||||
public String getVisitId() {
|
||||
return visitId;
|
||||
}
|
||||
|
||||
public void setVisitId(String visitId) {
|
||||
this.visitId = visitId;
|
||||
}
|
||||
|
||||
public String getExtendedField1() {
|
||||
return extendedField1;
|
||||
}
|
||||
|
||||
public void setExtendedField1(String extendedField1) {
|
||||
this.extendedField1 = extendedField1;
|
||||
}
|
||||
|
||||
public String getExtendedField2() {
|
||||
return extendedField2;
|
||||
}
|
||||
|
||||
public void setExtendedField2(String extendedField2) {
|
||||
this.extendedField2 = extendedField2;
|
||||
}
|
||||
|
||||
public String getExtendedField3() {
|
||||
return extendedField3;
|
||||
}
|
||||
|
||||
public void setExtendedField3(String extendedField3) {
|
||||
this.extendedField3 = extendedField3;
|
||||
}
|
||||
}
|
@ -0,0 +1,242 @@
|
||||
package com.ann.demo.entity.interfaceEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description 消息表
|
||||
* @Date 2019/6/17 10:27
|
||||
* @Created by ljx
|
||||
*/
|
||||
|
||||
@Table
|
||||
@Entity
|
||||
public class MessageLog {
|
||||
|
||||
@Id
|
||||
@GenericGenerator(name = "system-uuid", strategy = "uuid2")
|
||||
@GeneratedValue(generator = "system-uuid")
|
||||
private String id;
|
||||
|
||||
@Lob
|
||||
/**
|
||||
* 输入内容
|
||||
* */
|
||||
private String inputContent;
|
||||
|
||||
/**
|
||||
* 输出内容
|
||||
*/
|
||||
@Lob
|
||||
private String outContent;
|
||||
|
||||
/**
|
||||
* 类型 与 字典表匹配
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 消息结果 0 未成功 1是成功
|
||||
*/
|
||||
private Integer result;
|
||||
|
||||
/**
|
||||
* 返回json
|
||||
*/
|
||||
@Lob
|
||||
private String outJson;
|
||||
|
||||
/**
|
||||
* 接口名称
|
||||
*/
|
||||
private String interfaceName;
|
||||
|
||||
/**
|
||||
* xml创建时间
|
||||
*/
|
||||
private Date xmlCreateTime;
|
||||
|
||||
/**
|
||||
* 执行时间
|
||||
*/
|
||||
private Long executionTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* xml执行时间
|
||||
*/
|
||||
private Long xmlExecutionTime;
|
||||
|
||||
|
||||
/*
|
||||
* 2020-3-20 新增masterId
|
||||
* */
|
||||
private String masterId;
|
||||
|
||||
/*
|
||||
* 2020-3-20 新增webserviceInfo
|
||||
* */
|
||||
private String webserviceInfo;
|
||||
|
||||
|
||||
// ---------------------------时间怎么变成了毫秒数
|
||||
public MessageLog(String inputContent, String interfaceName, Date createTime,String webserviceInfo) {
|
||||
this.inputContent = inputContent;
|
||||
this.interfaceName = interfaceName;
|
||||
this.createTime = createTime;
|
||||
this.webserviceInfo = webserviceInfo;
|
||||
}
|
||||
|
||||
public MessageLog() {
|
||||
|
||||
}
|
||||
|
||||
public void setValue(String masterId,String outContent, Integer result, String outJson, Date xmlCreateTime, Long executionTime, Date endTime, String type,String remark) {
|
||||
this.masterId = masterId;
|
||||
this.outContent = outContent;
|
||||
this.result = result;
|
||||
this.outJson = outJson;
|
||||
this.xmlCreateTime = xmlCreateTime;
|
||||
this.executionTime = executionTime;
|
||||
this.endTime = endTime;
|
||||
this.type = type;
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getInputContent() {
|
||||
return inputContent;
|
||||
}
|
||||
|
||||
public void setInputContent(String inputContent) {
|
||||
this.inputContent = inputContent;
|
||||
}
|
||||
|
||||
public String getOutContent() {
|
||||
return outContent;
|
||||
}
|
||||
|
||||
public void setOutContent(String outContent) {
|
||||
this.outContent = outContent;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Integer getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(Integer result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getOutJson() {
|
||||
return outJson;
|
||||
}
|
||||
|
||||
public void setOutJson(String outJson) {
|
||||
this.outJson = outJson;
|
||||
}
|
||||
|
||||
public String getInterfaceName() {
|
||||
return interfaceName;
|
||||
}
|
||||
|
||||
public void setInterfaceName(String interfaceName) {
|
||||
this.interfaceName = interfaceName;
|
||||
}
|
||||
|
||||
public Date getXmlCreateTime() {
|
||||
return xmlCreateTime;
|
||||
}
|
||||
|
||||
public void setXmlCreateTime(Date xmlCreateTime) {
|
||||
this.xmlCreateTime = xmlCreateTime;
|
||||
}
|
||||
|
||||
public Long getExecutionTime() {
|
||||
return executionTime;
|
||||
}
|
||||
|
||||
public void setExecutionTime(Long executionTime) {
|
||||
this.executionTime = executionTime;
|
||||
}
|
||||
|
||||
public Date getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Date endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Long getXmlExecutionTime() {
|
||||
return xmlExecutionTime;
|
||||
}
|
||||
|
||||
public void setXmlExecutionTime(Long xmlExecutionTime) {
|
||||
this.xmlExecutionTime = xmlExecutionTime;
|
||||
}
|
||||
|
||||
public String getMasterId() {
|
||||
return masterId;
|
||||
}
|
||||
|
||||
public void setMasterId(String masterId) {
|
||||
this.masterId = masterId;
|
||||
}
|
||||
|
||||
public String getWebserviceInfo() {
|
||||
return webserviceInfo;
|
||||
}
|
||||
|
||||
public void setWebserviceInfo(String webserviceInfo) {
|
||||
this.webserviceInfo = webserviceInfo;
|
||||
}
|
||||
}
|
@ -0,0 +1,192 @@
|
||||
package com.ann.demo.entity.interfaceEntity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description 超声报告
|
||||
* @Date 2019/6/24 21:58
|
||||
* @Created by ljx
|
||||
*/
|
||||
|
||||
public class UltrasonicReport {
|
||||
|
||||
/*
|
||||
* 文档流水号
|
||||
* */
|
||||
private String id;
|
||||
|
||||
/*
|
||||
* 住院号标识号
|
||||
* */
|
||||
private String inpNo;
|
||||
|
||||
/*
|
||||
* 检查报告单号
|
||||
* */
|
||||
private String checkReportId;
|
||||
|
||||
/**
|
||||
* 电子申请单号
|
||||
*/
|
||||
private String applyId;
|
||||
|
||||
/**
|
||||
* 就诊次数
|
||||
*/
|
||||
private String visitId;
|
||||
|
||||
/**
|
||||
* 患者姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
|
||||
/*检查报告医师(文档创作者)*/
|
||||
|
||||
/**
|
||||
* 检查报告日期
|
||||
*/
|
||||
private String authorReportTime;
|
||||
|
||||
|
||||
/**
|
||||
* 医师标识
|
||||
*/
|
||||
private String assignedAuthorId;
|
||||
|
||||
/**
|
||||
* 医师姓名
|
||||
*/
|
||||
private String assignedPersonName;
|
||||
|
||||
|
||||
/* 审核医师签名 */
|
||||
|
||||
/**
|
||||
* 审核医师Id
|
||||
*/
|
||||
private String examineId;
|
||||
|
||||
/**
|
||||
* 审核医师姓名
|
||||
*/
|
||||
private String examineAssignedPersonName;
|
||||
|
||||
/**
|
||||
* 检查报告地址
|
||||
*/
|
||||
private String reportAddress;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UltrasonicReport{" +
|
||||
"id='" + id + '\'' +
|
||||
", inpNo='" + inpNo + '\'' +
|
||||
", checkReportId='" + checkReportId + '\'' +
|
||||
", applyId='" + applyId + '\'' +
|
||||
", visitId='" + visitId + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", authorReportTime='" + authorReportTime + '\'' +
|
||||
", assignedAuthorId='" + assignedAuthorId + '\'' +
|
||||
", assignedPersonName='" + assignedPersonName + '\'' +
|
||||
", examineId='" + examineId + '\'' +
|
||||
", examineAssignedPersonName='" + examineAssignedPersonName + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getInpNo() {
|
||||
return inpNo;
|
||||
}
|
||||
|
||||
public void setInpNo(String inpNo) {
|
||||
this.inpNo = inpNo;
|
||||
}
|
||||
|
||||
public String getCheckReportId() {
|
||||
return checkReportId;
|
||||
}
|
||||
|
||||
public void setCheckReportId(String checkReportId) {
|
||||
this.checkReportId = checkReportId;
|
||||
}
|
||||
|
||||
public String getApplyId() {
|
||||
return applyId;
|
||||
}
|
||||
|
||||
public void setApplyId(String applyId) {
|
||||
this.applyId = applyId;
|
||||
}
|
||||
|
||||
public String getVisitId() {
|
||||
return visitId;
|
||||
}
|
||||
|
||||
public void setVisitId(String visitId) {
|
||||
this.visitId = visitId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getAuthorReportTime() {
|
||||
return authorReportTime;
|
||||
}
|
||||
|
||||
public void setAuthorReportTime(String authorReportTime) {
|
||||
this.authorReportTime = authorReportTime;
|
||||
}
|
||||
|
||||
public String getAssignedAuthorId() {
|
||||
return assignedAuthorId;
|
||||
}
|
||||
|
||||
public void setAssignedAuthorId(String assignedAuthorId) {
|
||||
this.assignedAuthorId = assignedAuthorId;
|
||||
}
|
||||
|
||||
public String getAssignedPersonName() {
|
||||
return assignedPersonName;
|
||||
}
|
||||
|
||||
public void setAssignedPersonName(String assignedPersonName) {
|
||||
this.assignedPersonName = assignedPersonName;
|
||||
}
|
||||
|
||||
public String getExamineId() {
|
||||
return examineId;
|
||||
}
|
||||
|
||||
public void setExamineId(String examineId) {
|
||||
this.examineId = examineId;
|
||||
}
|
||||
|
||||
public String getExamineAssignedPersonName() {
|
||||
return examineAssignedPersonName;
|
||||
}
|
||||
|
||||
public void setExamineAssignedPersonName(String examineAssignedPersonName) {
|
||||
this.examineAssignedPersonName = examineAssignedPersonName;
|
||||
}
|
||||
|
||||
public String getReportAddress() {
|
||||
return reportAddress;
|
||||
}
|
||||
|
||||
public void setReportAddress(String reportAddress) {
|
||||
this.reportAddress = reportAddress;
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.ann.demo.entity.interfaceEntity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
public class WebServiceInfo {
|
||||
|
||||
private String interfaceName;
|
||||
|
||||
private String[] param;
|
||||
|
||||
private String url;
|
||||
|
||||
|
||||
public WebServiceInfo() {
|
||||
}
|
||||
|
||||
public WebServiceInfo(String interfaceName, String[] param, String url) {
|
||||
this.interfaceName = interfaceName;
|
||||
this.param = param;
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getInterfaceName() {
|
||||
return interfaceName;
|
||||
}
|
||||
|
||||
public void setInterfaceName(String interfaceName) {
|
||||
this.interfaceName = interfaceName;
|
||||
}
|
||||
|
||||
public String[] getParam() {
|
||||
return param;
|
||||
}
|
||||
|
||||
public void setParam(String[] param) {
|
||||
this.param = param;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.ann.demo.interfaces;
|
||||
|
||||
import javax.jws.WebMethod;
|
||||
import javax.jws.WebParam;
|
||||
import javax.jws.WebService;
|
||||
|
||||
@WebService
|
||||
public interface HomepageDictionary {
|
||||
|
||||
@WebMethod
|
||||
String HIPMessageServer(@WebParam(name = "action") String action, @WebParam(name = "message") String message);
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.ann.demo.interfaces.config;
|
||||
|
||||
import com.ann.demo.interfaces.HomepageDictionary;
|
||||
import com.ann.demo.interfaces.impl.HomepageDictionaryImpl;
|
||||
import com.ann.demo.service.WebServiceDemo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.cxf.Bus;
|
||||
import org.apache.cxf.bus.spring.SpringBus;
|
||||
import org.apache.cxf.jaxws.EndpointImpl;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @Author: LeiJiaXin
|
||||
* @Date: 2019/6/11 17:13
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class WebServiceConfig {
|
||||
|
||||
@Bean(name = Bus.DEFAULT_BUS_ID)
|
||||
public SpringBus springBus() {
|
||||
return new SpringBus();
|
||||
}
|
||||
@Autowired
|
||||
private WebServiceDemo webServiceDemo;
|
||||
@Autowired
|
||||
private Bus bus;
|
||||
@Value("${server.port}")
|
||||
private String port;
|
||||
private static final String path = "/api";
|
||||
//把实现类交给spring管理
|
||||
@Bean
|
||||
public HomepageDictionary homepageDictionary() {
|
||||
return new HomepageDictionaryImpl();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Endpoint endpoint() {
|
||||
System.out.println("-----------------------LIS已发布-------------------------");
|
||||
EndpointImpl endpoint = new EndpointImpl(springBus(), homepageDictionary());
|
||||
endpoint.publish("HomepageDictionary");
|
||||
return endpoint;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Endpoint userServiceEndpoint() {
|
||||
EndpointImpl userEndpoint = new EndpointImpl(bus, webServiceDemo);
|
||||
userEndpoint.publish(path);
|
||||
System.out.println("在线的wsdl:http://localhost:"+port+"/services"+path+"?wsdl");
|
||||
log.info("在线的wsdl:http://localhost:"+port+"/services{}?wsdl",path);
|
||||
return userEndpoint;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.ann.demo.interfaces.impl;
|
||||
|
||||
import com.ann.demo.entity.constant.InterfaceName;
|
||||
import com.ann.demo.entity.constant.WebserviceId;
|
||||
import com.ann.demo.entity.interfaceEntity.*;
|
||||
import com.ann.demo.interfaces.HomepageDictionary;
|
||||
import com.ann.demo.service.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.jws.WebService;
|
||||
|
||||
/**
|
||||
* @Author: LeiJiaXin
|
||||
* @Date: 2019/6/11 17:01
|
||||
*/
|
||||
|
||||
@WebService(serviceName = "HomepageDictionary", // 与接口中指定的name一致
|
||||
targetNamespace = "http://interfaces.demo.ann.com/", // 与接口中的命名空间一致,一般是接口的包名倒
|
||||
endpointInterface = "com.ann.demo.interfaces.HomepageDictionary"// 接口地址
|
||||
)
|
||||
public class HomepageDictionaryImpl implements HomepageDictionary {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(HomepageDictionaryImpl.class);
|
||||
|
||||
@Autowired
|
||||
private AnalysisService analysisService;
|
||||
|
||||
@Override
|
||||
public String HIPMessageServer(String action, String message) {
|
||||
String result = "";
|
||||
try{
|
||||
if (action != null && message != null && !(message.equals("") && action.equals(""))) {
|
||||
switch (action) {
|
||||
case InterfaceName.INSPECTION_REPORT_NAME:
|
||||
// 检验报告
|
||||
result = analysisService.getHIPMessageServerResult(message, UltrasonicReport.class, InterfaceName.INSPECTION_REPORT, WebserviceId.INSPECTION_REPORT_NAME);
|
||||
break;
|
||||
case InterfaceName.PARAMETER_INSPECTIONAPPLY:
|
||||
// 检验申请单
|
||||
result = analysisService.getHIPMessageServerResult(message, ExamApply.class, InterfaceName.PARAMETER_INSPECTIONAPPLY, WebserviceId.PARAMETER_INSPECTIONAPPLY);
|
||||
break;
|
||||
case InterfaceName.PARAMETER_VERIFICATIONINSPECTIONAPPLY:
|
||||
// 检体核收
|
||||
result = analysisService.getHIPMessageServerResult(message, ExamApply.class, InterfaceName.PARAMETER_VERIFICATIONINSPECTIONAPPLY, WebserviceId.PARAMETER_VERIFICATIONINSPECTIONAPPLY);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.error("当前参数:{},报错信息:{}",action,e.getMessage());
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.ann.demo.repository;
|
||||
|
||||
import com.ann.demo.entity.filing.ArchiveDetail;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Author: LeiJiaXin
|
||||
* @Date: 2019/7/12 9:10
|
||||
*/
|
||||
@Repository
|
||||
public interface ArchiveDetailRepository extends JpaRepository<ArchiveDetail, String> {
|
||||
|
||||
// // or Source = 'DoctorData' or AssortID = '117' or AssortID = '10' or AssortID = '60' or AssortID = '57' or AssortID = '52' or AssortID = '54' or AssortID = '59'
|
||||
// @Query("select o from ArchiveDetail o ")
|
||||
// public List<ArchiveDetail> findAllHaha();
|
||||
|
||||
@Query("select count (o) from ArchiveDetail o where o.masterID = ?1 and o.assortID = ?2 and o.source=?3 and (o.applyId = ?4 and o.applyId is not null) and o.flag = 0 and FileContext = ?5")
|
||||
Integer countByMasterIDAndAssortIDAndSourceAndApplyId(String masterId, String AssortID, String source, String applyId,String FileContext);
|
||||
|
||||
@Query("select count (o) from ArchiveDetail o where o.masterID = ?1 and o.assortID = ?2 and o.source=?3 and (o.checkReportId = ?4 and o.checkReportId is not null) and o.flag = 0")
|
||||
Integer countByMasterIDAndAssortIDAndSourceAndCheckReportId(String masterId, String AssortID, String source, String CheckReportId);
|
||||
|
||||
|
||||
public ArchiveDetail findByMasterIDAndAssortIDAndSourceAndApplyIdAndFlagAndFileContext(String masterId, String AssortID, String source, String applyId, String flag,String FileContext);
|
||||
|
||||
public ArchiveDetail findByMasterIDAndAssortIDAndSourceAndCheckReportIdAndFlag(String masterId, String AssortID, String source, String checkReportId, String flag);
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.ann.demo.repository;
|
||||
|
||||
import com.ann.demo.entity.interfaceEntity.ExamApply;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Author: LeiJiaXin
|
||||
* @Date: 2019/8/22 16:22
|
||||
*/
|
||||
@Repository
|
||||
public interface ExamApplyRepository extends JpaRepository<ExamApply, String> {
|
||||
|
||||
@Transactional
|
||||
@Modifying(clearAutomatically = true)
|
||||
@Query(value = "update Exam_Apply set is_Valid = 1 where apply_Id = ?1 and is_Valid = 0 ",nativeQuery = true)
|
||||
public int updateExamApplyIsValidById(String applyId);
|
||||
|
||||
@Query("select count(o) from ExamApply o where o.applyId = ?1 and o.isValid = 0")
|
||||
public Integer countExamApply(String applyId);
|
||||
|
||||
public ExamApply findByApplyIdAndIsValidAndIsOpenHisAndIsOpenOther(String applyId,Integer flag,String isOpenHis,String isOpenOther);
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.ann.demo.repository;
|
||||
|
||||
import com.ann.demo.entity.interfaceEntity.MessageLog;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Date 2019/6/17 11:34
|
||||
* @Created by ljx
|
||||
*/
|
||||
@Repository
|
||||
public interface MessageRepository extends JpaRepository<MessageLog, Integer> {
|
||||
|
||||
public Integer countByInputContentAndInterfaceName(String inputContent, String interfaceName);
|
||||
|
||||
// 2019-12-26 15:58:36.107 2019-12-11 10:29:36.107
|
||||
@Query("select o from MessageLog o where o.createTime > '2019-12-11 10:29:36.107' and o.endTime is null ")
|
||||
public List<MessageLog> findAllHaha();
|
||||
|
||||
@Query(nativeQuery = true,value = " select id from archive_master where (inp_No = ?1 ) and (visit_id = ?2 ) and archiveState <> '作废' and is_valid = 0")
|
||||
public String getArchiveMasterId(String inpNo,String visitId);
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.ann.demo.repository;
|
||||
|
||||
import com.ann.demo.entity.filing.MessageSubordinate;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Date 2019/7/9 16:44
|
||||
* @Created by ljx
|
||||
*/
|
||||
@Repository
|
||||
public interface MessageSubordinateRepository extends JpaRepository<MessageSubordinate, String> {
|
||||
|
||||
public Integer countByPatientMainAndContentJson(String patientMain, String contentJson);
|
||||
}
|
@ -0,0 +1,196 @@
|
||||
package com.ann.demo.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.ann.demo.entity.constant.AliasName;
|
||||
import com.ann.demo.entity.constant.InterfaceName;
|
||||
import com.ann.demo.entity.filing.MessageSubordinate;
|
||||
import com.ann.demo.entity.filing.dto.MessageDto;
|
||||
import com.ann.demo.entity.filing.dto.PatientMainDto;
|
||||
import com.ann.demo.entity.filing.ArchiveDetail;
|
||||
import com.ann.demo.entity.interfaceEntity.ExamApply;
|
||||
import com.ann.demo.entity.interfaceEntity.MessageLog;
|
||||
import com.ann.demo.utils.FileUtils;
|
||||
import com.ann.demo.utils.PdfUtils;
|
||||
import com.ann.demo.utils.XMLUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 解析逻辑
|
||||
*
|
||||
* @Author: LeiJiaXin
|
||||
* @Date: 2019/8/20 16:29
|
||||
*/
|
||||
@Component
|
||||
public class AnalysisService {
|
||||
|
||||
static final Logger logger = LoggerFactory.getLogger(AnalysisService.class);
|
||||
|
||||
@Autowired
|
||||
MessageService messageService;
|
||||
|
||||
@Autowired
|
||||
MessageSubordinateService messageSubordinateService;
|
||||
|
||||
@Autowired
|
||||
ExamApplyService examApplyService;
|
||||
|
||||
@Autowired
|
||||
ArchiveDetailService archiveDetailService;
|
||||
|
||||
/**
|
||||
* 2019-7-8
|
||||
* @Param xmlStr 需要解析的字符串
|
||||
* @Param tClass 被解析字符串的实体类
|
||||
* @Param parameter 如果是报告 携带参数
|
||||
* 返回返回参数xml
|
||||
*/
|
||||
public String getHIPMessageServerResult(String message, Class tClass, String parameter,String webserviceId) throws Exception{
|
||||
String outContent = "失败", typeCodeValue = "AE";
|
||||
ArchiveDetail archiveDetail = null;
|
||||
try {
|
||||
long startTime = System.currentTimeMillis();
|
||||
long endTime = 0;
|
||||
String textContent = "成功啦~", type = "", patientMainStr = "", textContentTemp = null, archiveMasterId = null;
|
||||
Date xmlCreateTime = null;
|
||||
Integer result = 2;
|
||||
MessageLog messageLog = new MessageLog(message, InterfaceName.HIP_MESSAGE_SERVER, new Date(), webserviceId);
|
||||
messageService.save(messageLog);
|
||||
MessageDto messageDto = XMLUtils.xpathToBean(message, tClass, parameter);
|
||||
if (messageDto != null) {
|
||||
archiveMasterId = messageService.getArchiveMasterId(messageDto.getInpNo(), messageDto.getVisitId());
|
||||
if (archiveMasterId != null) {
|
||||
if (Objects.equals(messageDto.getEntity(), ExamApply.class.getName())) { // 申请单
|
||||
ExamApply examApply = JSON.parseObject(messageDto.getObject().toString(), ExamApply.class);
|
||||
textContentTemp = changeApply(examApply, parameter);
|
||||
}
|
||||
//检验外送报告 单独处理
|
||||
if((!ObjectUtils.isEmpty(messageDto.getDeliveryFlag()) )&&
|
||||
Objects.equals(messageDto.getDeliveryFlag(),"广州金域")){
|
||||
// 直接下载并生成文件到detail
|
||||
//System.out.println(messageDto.getReportAddress());
|
||||
UUID uuid = UUID.randomUUID();
|
||||
File pdfFile = FileUtils.createFile("pdfs", messageDto.getInpNo(), messageDto.getVisitId(), uuid.toString(), null);
|
||||
if(PdfUtils.base64StringToPDF(messageDto.getReportAddress(),pdfFile)){
|
||||
// 查询库中是否存在 如果存在就更新
|
||||
archiveDetail = archiveDetailService.isExit(archiveMasterId, messageDto.getType(), messageDto.getSource(), messageDto.getApplyId(),messageDto.getCheckReportId());
|
||||
if (archiveDetail == null) {
|
||||
archiveDetail = new ArchiveDetail(uuid.toString(),archiveMasterId, new Date(), messageDto.getType(), messageDto.getSource(), messageDto.getApplyId(),
|
||||
messageDto.getDetailType(),messageDto.getCheckReportId());
|
||||
archiveDetail.setPdfPath(pdfFile.getAbsolutePath());
|
||||
archiveDetailService.save(archiveDetail);
|
||||
}else{
|
||||
archiveDetail.setPdfPath(pdfFile.getAbsolutePath());
|
||||
archiveDetailService.save(archiveDetail);
|
||||
}
|
||||
}else{
|
||||
textContentTemp = "加密字节流转换pdf失败";
|
||||
}
|
||||
// 替换消息的pdf节点
|
||||
String tempMessage = XMLUtils.replaceXpath(message, pdfFile.getAbsolutePath());
|
||||
if(!ObjectUtils.isEmpty(tempMessage)){
|
||||
//System.out.println(tempMessage);
|
||||
message = tempMessage;
|
||||
messageLog.setInputContent(message);
|
||||
outContent = XMLUtils.generateV3XmlStr("AA", "成功啦~");
|
||||
endTime = System.currentTimeMillis();
|
||||
messageLog.setValue(archiveMasterId, outContent, 1, messageDto == null ? "" : JSON.toJSONString(messageDto), messageDto.getXmlCreateTime(), (endTime - startTime), new Date(), messageDto.getType(), textContent);
|
||||
messageService.save(messageLog);
|
||||
return outContent;
|
||||
}else{
|
||||
textContentTemp = "替换消息的pdf节点出错";
|
||||
}
|
||||
}
|
||||
if (textContentTemp != null) {
|
||||
textContent = textContentTemp;
|
||||
} else {
|
||||
// 构建消息从属表
|
||||
patientMainStr = JSON.toJSONString(new PatientMainDto(messageDto.getInpNo(), messageDto.getVisitId()), SerializerFeature.WriteMapNullValue);
|
||||
xmlCreateTime = messageDto.getXmlCreateTime();
|
||||
type = messageDto.getType();
|
||||
typeCodeValue = "AA";
|
||||
result = 1;
|
||||
}
|
||||
} else {
|
||||
textContent = "没有入院信息";
|
||||
}
|
||||
} else {
|
||||
textContent = "传过来的消息无法解析";
|
||||
}
|
||||
outContent = XMLUtils.generateV3XmlStr(typeCodeValue, textContent);
|
||||
if (outContent != null) {
|
||||
endTime = System.currentTimeMillis();
|
||||
messageLog.setValue(archiveMasterId, outContent, result, messageDto == null ? "" : JSON.toJSONString(messageDto), xmlCreateTime, (endTime - startTime), new Date(), type, textContent);
|
||||
messageService.save(messageLog);
|
||||
if (Objects.equals(typeCodeValue, "AA") && Objects.equals(type, AliasName.INSPECTION_REPORT)) {
|
||||
messageSubordinateService.save(new MessageSubordinate(messageLog.getId(), patientMainStr, JSON.toJSONString(messageLog)));
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
// 报错删掉患者报告详情信息
|
||||
if (archiveDetail != null) {
|
||||
if (archiveDetail.getId() != null) {
|
||||
archiveDetailService.delete(archiveDetail.getId());
|
||||
}
|
||||
}
|
||||
// 生成一个临时文件
|
||||
logger.error("消息出错,请检查消息内容,错误详情:{},消息所在位置:{}",e.getMessage(),FileUtils.createFile(InterfaceName.HIP_MESSAGE_SERVER,parameter,message));
|
||||
return outContent;
|
||||
}
|
||||
return outContent;
|
||||
}
|
||||
|
||||
|
||||
private String changeApply(ExamApply examApply,String interfaceName) throws Exception{
|
||||
String textContent = null;
|
||||
ExamApply examApplyTemp = examApplyService.findExamApply(examApply.getApplyId());
|
||||
//1 先判断检验申请单是否存在 存在做以下操作
|
||||
if(examApplyTemp != null){
|
||||
if (Objects.equals(examApply.getResult(), "delete")) {
|
||||
// 1.2 判断是否是删除
|
||||
if (!examApplyService.updateExamApplyIsValid(examApplyTemp.getApplyId())) {
|
||||
textContent = "申请单删除失败了";
|
||||
}
|
||||
}else if(Objects.equals(interfaceName,InterfaceName.PARAMETER_INSPECTIONAPPLY)){
|
||||
// 1.3 如果是检验申请单状态变更设置IsOpenHIS
|
||||
if (Objects.equals(examApply.getIsOpenHis(), "F")) {
|
||||
examApplyTemp.setIsValid(1);
|
||||
examApplyTemp.setIsOpenHis("F");
|
||||
examApplyService.save(examApplyTemp);
|
||||
}
|
||||
}else if(Objects.equals(interfaceName,InterfaceName.PARAMETER_VERIFICATIONINSPECTIONAPPLY)){
|
||||
// 1.4 如果是检验申请单检体验收设置IsOpenLIS
|
||||
if (Objects.equals(examApply.getIsOpenOther(), "F")) {
|
||||
examApplyTemp.setIsValid(1);
|
||||
examApplyTemp.setIsOpenOther("F");
|
||||
examApplyService.save(examApplyTemp);
|
||||
}
|
||||
}else {
|
||||
// 1.5 如果存在,又不做任何操作,返回已存在
|
||||
textContent = "该申请单已存在";
|
||||
}
|
||||
}else{
|
||||
// 2 如果不存在,那就判断是否是新增,否则该申请单不存在
|
||||
if (Objects.equals(examApply.getResult(), "new") && Objects.equals(interfaceName,InterfaceName.PARAMETER_INSPECTIONAPPLY)) {
|
||||
if (examApply.getReportType() != null) {
|
||||
examApply.setReportType(AliasName.INSPECTION_REPORT);
|
||||
}
|
||||
examApplyService.save(examApply);
|
||||
} else {
|
||||
textContent = "该申请单不存在";
|
||||
}
|
||||
}
|
||||
return textContent;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ann.demo.service;
|
||||
|
||||
|
||||
import com.ann.demo.entity.filing.ArchiveDetail;
|
||||
|
||||
/**
|
||||
* @Author: LeiJiaXin
|
||||
* @Date: 2019/7/12 9:12
|
||||
*/
|
||||
public interface ArchiveDetailService {
|
||||
|
||||
public void save(ArchiveDetail archiveDetail) throws Exception;
|
||||
|
||||
public void delete(String id) throws Exception;
|
||||
|
||||
public ArchiveDetail isExit(String id, String type, String source, String applyId,String checkReportId) throws Exception;
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.ann.demo.service;
|
||||
|
||||
/**
|
||||
* @author ljx
|
||||
* @description: TODO
|
||||
* @date 2021/5/26 15:09
|
||||
*/
|
||||
public class Demo {
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.ann.demo.service;
|
||||
|
||||
import com.ann.demo.entity.interfaceEntity.ExamApply;
|
||||
|
||||
/**
|
||||
* @Author: LeiJiaXin
|
||||
* @Date: 2019/8/22 16:20
|
||||
*/
|
||||
public interface ExamApplyService {
|
||||
|
||||
public void save(ExamApply examApply);
|
||||
|
||||
/* public boolean updateExamApplyIsValidById(String id);*/
|
||||
|
||||
//public String findId(String applyId,String inpNo,String visitId,String patientId);
|
||||
|
||||
public ExamApply findExamApply(String applyId);
|
||||
|
||||
Integer countExamApply(String applyId);
|
||||
|
||||
boolean updateExamApplyIsValid(String applyId) throws Exception;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.ann.demo.service;
|
||||
|
||||
|
||||
import com.ann.demo.entity.interfaceEntity.MessageLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Date 2019/7/9 10:24
|
||||
* @Created by ljx
|
||||
*/
|
||||
|
||||
public interface MessageService {
|
||||
|
||||
public void save(MessageLog log);
|
||||
|
||||
public Integer countByInputContentAndInterfaceName(String xmlStr, String hipMessageServer);
|
||||
|
||||
// 2019-10-11 查询所有9月15解析成功的数据
|
||||
List<MessageLog> findAllMessage();
|
||||
|
||||
//2020-3-20 获取患者信息id
|
||||
String getArchiveMasterId(String inpNo,String visitId);
|
||||
|
||||
// String getArchiveMasterId(String inpNo,String visitId,String patientId);
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.ann.demo.service;
|
||||
|
||||
import com.ann.demo.entity.filing.MessageSubordinate;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Date 2019/7/9 16:43
|
||||
* @Created by ljx
|
||||
*/
|
||||
|
||||
public interface MessageSubordinateService {
|
||||
|
||||
public void save(MessageSubordinate messageSubordinate);
|
||||
|
||||
public boolean countByPatientMainAndContentJson(String patientMainStr, String contentJson);
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.ann.demo.service.impl;
|
||||
|
||||
import com.ann.demo.entity.filing.ArchiveDetail;
|
||||
import com.ann.demo.repository.ArchiveDetailRepository;
|
||||
import com.ann.demo.service.ArchiveDetailService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: LeiJiaXin
|
||||
* @Date: 2019/7/12 9:12
|
||||
*/
|
||||
@Service
|
||||
public class ArchiveDetailServiceImpl implements ArchiveDetailService {
|
||||
|
||||
@Autowired
|
||||
ArchiveDetailRepository archiveDetailRepository;
|
||||
|
||||
|
||||
@Override
|
||||
public void save(ArchiveDetail archiveDetail) throws Exception{
|
||||
archiveDetailRepository.save(archiveDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String id) throws Exception{
|
||||
archiveDetailRepository.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ArchiveDetail isExit(String id, String type, String source, String applyId,String checkReportId) throws Exception {
|
||||
if (archiveDetailRepository.countByMasterIDAndAssortIDAndSourceAndApplyId(id, type, source, applyId,checkReportId) > 0)
|
||||
return archiveDetailRepository.findByMasterIDAndAssortIDAndSourceAndApplyIdAndFlagAndFileContext(id, type, source, applyId,"0",checkReportId);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.ann.demo.service.impl;
|
||||
|
||||
import com.ann.demo.entity.interfaceEntity.ExamApply;
|
||||
import com.ann.demo.repository.ExamApplyRepository;
|
||||
import com.ann.demo.service.ExamApplyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author: LeiJiaXin
|
||||
* @Date: 2019/8/22 16:20
|
||||
*/
|
||||
@Service
|
||||
public class ExamApplyServiceImpl implements ExamApplyService {
|
||||
|
||||
@Autowired
|
||||
ExamApplyRepository examApplyRepository;
|
||||
|
||||
@Override
|
||||
public void save(ExamApply examApply) {
|
||||
examApplyRepository.save(examApply);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExamApply findExamApply(String applyId) {
|
||||
return examApplyRepository.findByApplyIdAndIsValidAndIsOpenHisAndIsOpenOther(applyId,0,"E","E");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer countExamApply(String applyId) {
|
||||
return examApplyRepository.countExamApply(applyId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateExamApplyIsValid(String applyId) throws Exception{
|
||||
if (examApplyRepository.updateExamApplyIsValidById(applyId) > 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.ann.demo.service.impl;
|
||||
|
||||
import com.ann.demo.entity.interfaceEntity.MessageLog;
|
||||
import com.ann.demo.repository.MessageRepository;
|
||||
import com.ann.demo.service.MessageService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Date 2019/7/9 10:24
|
||||
* @Created by ljx
|
||||
*/
|
||||
@Service
|
||||
public class MessageServiceImpl implements MessageService {
|
||||
|
||||
static final Logger logger = LoggerFactory.getLogger(MessageServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
MessageRepository messageRepository;
|
||||
|
||||
@Override
|
||||
public void save(MessageLog log) {
|
||||
//打日志信息
|
||||
try {
|
||||
messageRepository.save(log);
|
||||
//-------------------------打出来的日志 需改善
|
||||
} catch (Exception e) {
|
||||
logger.error("出错咯!保存消息内容错误信息:" + e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer countByInputContentAndInterfaceName(String xmlStr, String hipMessageServer) {
|
||||
return messageRepository.countByInputContentAndInterfaceName(xmlStr, hipMessageServer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MessageLog> findAllMessage() {
|
||||
List<MessageLog> allHaha = messageRepository.findAllHaha();
|
||||
System.out.println(allHaha.size());
|
||||
return allHaha;
|
||||
}
|
||||
|
||||
|
||||
public String getArchiveMasterId(String inpNo,String visitId) {
|
||||
return messageRepository.getArchiveMasterId(inpNo, visitId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.ann.demo.service.impl;
|
||||
|
||||
|
||||
import com.ann.demo.interfaces.HomepageDictionary;
|
||||
import com.ann.demo.service.WebServiceDemo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class WebServiceDemoImpl implements WebServiceDemo {
|
||||
@Autowired
|
||||
private HomepageDictionary homepageDictionary;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(WebServiceDemoImpl.class);
|
||||
|
||||
@Override
|
||||
public String receivePdfFile(byte[] fileByte) {
|
||||
if(null == fileByte || fileByte.length == 0){
|
||||
return "参数不能为空";
|
||||
}else {
|
||||
try {
|
||||
String decode= "";
|
||||
//fileByte = FileUtils.getBytesByFile("F:\\inputStr.txt");
|
||||
decode = new String(fileByte, "UTF-8");
|
||||
//decode = Base64Utils.jdkBase64Decode(decode);
|
||||
logger.info(decode);
|
||||
String result = homepageDictionary.HIPMessageServer("LisSendReportBack", decode);
|
||||
logger.info(result);
|
||||
return result;
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error(e.getMessage());
|
||||
return e.getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*@Override
|
||||
public String receivePdfFile(byte[] fileByte) {
|
||||
//定义返回值
|
||||
int resultCode = 0;
|
||||
String resultContent = "成功";
|
||||
if(null != fileByte && fileByte.length != 0){
|
||||
String outPath = "D:\\zwh";
|
||||
String s = UUID.randomUUID().toString();
|
||||
String fileName = "fileDemo_"+s+".pdf";
|
||||
try {
|
||||
FileUtil.getFileByBytes(fileByte,outPath,fileName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
resultCode = 500;
|
||||
resultContent = e.getMessage();
|
||||
}
|
||||
}else {
|
||||
resultCode = 500;
|
||||
resultContent = "参数不能为空";
|
||||
}
|
||||
return "<Response>\n" +
|
||||
" <Header>\n" +
|
||||
" <SourceSystem></SourceSystem>\n" +
|
||||
" <MessageID></MessageID>\n" +
|
||||
" </Header>\n" +
|
||||
" <Body>\n" +
|
||||
" <ResultCode>"+resultCode+"</ResultCode>\n" +
|
||||
" <ResultContent>"+resultContent+"</ResultContent>\n" +
|
||||
" </Body>\n" +
|
||||
"</Response>";
|
||||
}*/
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
package com.ann.demo.utils;
|
||||
|
||||
import org.apache.axis.encoding.Base64;
|
||||
|
||||
public class Base64Utils {
|
||||
public static String jdkBase64Decode(String src) {
|
||||
try {
|
||||
src = src.replaceAll("\r\n","");
|
||||
byte[] decode = Base64.decode(src);
|
||||
return new String(decode);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.ann.demo.utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.ParseException;
|
||||
import java.text.ParsePosition;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Date 2019/6/24 10:51
|
||||
* @Created by ljx
|
||||
*/
|
||||
public class DateUtils {
|
||||
|
||||
|
||||
// 生成指定格式的时间
|
||||
public static String getDate() {
|
||||
//日期转换为字符串
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
||||
return now.format(format);
|
||||
}
|
||||
|
||||
public static int getAge(Date birthDay) throws Exception {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
if (cal.before(birthDay)) { //出生日期晚于当前时间,无法计算
|
||||
throw new IllegalArgumentException(
|
||||
"The birthDay is before Now.It's unbelievable!");
|
||||
}
|
||||
int yearNow = cal.get(Calendar.YEAR); //当前年份
|
||||
int monthNow = cal.get(Calendar.MONTH); //当前月份
|
||||
int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); //当前日期
|
||||
cal.setTime(birthDay);
|
||||
int yearBirth = cal.get(Calendar.YEAR);
|
||||
int monthBirth = cal.get(Calendar.MONTH);
|
||||
int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
|
||||
int age = yearNow - yearBirth; //计算整岁数
|
||||
if (monthNow <= monthBirth) {
|
||||
if (monthNow == monthBirth) {
|
||||
if (dayOfMonthNow < dayOfMonthBirth) age--;//当前日期在生日之前,年龄减一
|
||||
} else {
|
||||
age--;//当前月份在生日之前,年龄减一
|
||||
|
||||
}
|
||||
}
|
||||
return age;
|
||||
}
|
||||
|
||||
public static Date parse(String strDate) throws ParseException {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("2019/6/29 0:00:00");
|
||||
return sdf.parse(strDate);
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
/* //LocalDate date1 = LocalDate.now();
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy/MM/dd hh:mm:ss");
|
||||
String date = "2019/06/29 00:00:00";
|
||||
LocalDate date1 = LocalDate.parse(date,dateTimeFormatter);
|
||||
|
||||
LocalDate date2 = LocalDate.of(date1.getYear(), date1.getMonth(), date1.getDayOfMonth());
|
||||
int age = date2.until(date1).getDays();
|
||||
System.out.println("You're " + age + " years old.");*/
|
||||
File file = new File("C:/Users/ljx/Desktop/pdf/外3");
|
||||
File[] files = file.listFiles();
|
||||
|
||||
for (File file1 : files) {
|
||||
System.out.println(file1.getName());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将短时间格式字符串转换为时间 yyyy-MM-dd
|
||||
*
|
||||
* @param strDate
|
||||
* @return
|
||||
*/
|
||||
public static Date strToDate(String strDate) {
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
ParsePosition pos = new ParsePosition(0);
|
||||
Date strtodate = formatter.parse(strDate, pos);
|
||||
return strtodate;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,144 @@
|
||||
package com.ann.demo.utils;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.io.*;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @Author: LeiJiaXin
|
||||
* @Date: 2019/7/24 16:42
|
||||
*/
|
||||
@Component
|
||||
public class FileUtils {
|
||||
|
||||
static final Logger logger = LoggerFactory.getLogger(FileUtils.class);
|
||||
|
||||
// 错误文件地址
|
||||
public static String errorPath;
|
||||
@Value("${file.errorPath}")
|
||||
public void setErrorPath(String errorPath) {
|
||||
FileUtils.errorPath = errorPath;
|
||||
}
|
||||
public static String getErrorPath() {
|
||||
return errorPath;
|
||||
}
|
||||
|
||||
// pdf地址
|
||||
public static String pdfPath;
|
||||
@Value("${file.pdfPath}")
|
||||
public void setPdfPath(String pdfPath) {
|
||||
FileUtils.pdfPath = pdfPath;
|
||||
}
|
||||
public static String getPdfPath() {
|
||||
return pdfPath;
|
||||
}
|
||||
|
||||
//将文件转换成Byte数组
|
||||
public static byte[] getBytesByFile(String pathStr) {
|
||||
File file = new File(pathStr);
|
||||
try {
|
||||
FileInputStream fis = new FileInputStream(file);
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(1000);
|
||||
byte[] b = new byte[1000];
|
||||
int n;
|
||||
while ((n = fis.read(b)) != -1) {
|
||||
bos.write(b, 0, n);
|
||||
}
|
||||
fis.close();
|
||||
byte[] data = bos.toByteArray();
|
||||
bos.close();
|
||||
return data;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String createFile(String interfaceName, String param,String message) throws IOException {
|
||||
File localFile = null;
|
||||
OutputStreamWriter write = null;
|
||||
BufferedWriter writer = null;
|
||||
try {
|
||||
//生成文件地址
|
||||
LocalDate date = LocalDate.now();
|
||||
String fileDirName = null;
|
||||
fileDirName = errorPath+"/" + date.getYear() + "/" + date.getMonthValue() + "/" + interfaceName;
|
||||
// 如果参数不为空时,再增加一级目录
|
||||
if(!ObjectUtils.isEmpty(param)){
|
||||
fileDirName += "_" + param;
|
||||
}
|
||||
//判断是否有该文件夹 否则创建
|
||||
File fileDir = new File(fileDirName);
|
||||
if (!fileDir.exists()) {
|
||||
fileDir.mkdirs();
|
||||
}
|
||||
String fileName = fileDir + "/" + UUID.randomUUID() + ".txt";
|
||||
localFile = new File(fileName);
|
||||
if (!localFile.exists()) {
|
||||
localFile.createNewFile();
|
||||
}
|
||||
write = new OutputStreamWriter(new FileOutputStream(localFile));
|
||||
writer = new BufferedWriter(write);
|
||||
writer.write(message);
|
||||
writer.flush();
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
}finally {
|
||||
if(!ObjectUtils.isEmpty(write)){
|
||||
write.close();
|
||||
}
|
||||
if(!ObjectUtils.isEmpty(writer)){
|
||||
writer.close();
|
||||
}
|
||||
}
|
||||
return localFile.getAbsolutePath();
|
||||
}
|
||||
|
||||
public static File createFile(String fileType, String inpNo, String visitId, String detailId, String tempPath) throws IOException {
|
||||
File localFile = null;
|
||||
try {
|
||||
//生成图片地址
|
||||
LocalDate date = LocalDate.now();
|
||||
String fileDirName = pdfPath + "/" + date.getYear() + "/" + date.getMonthValue() + "/" + inpNo + "_" + visitId;
|
||||
|
||||
//判断是否有该文件夹 否则创建
|
||||
File fileDir = new File(fileDirName);
|
||||
if (!fileDir.exists()) {
|
||||
fileDir.mkdirs();
|
||||
}
|
||||
|
||||
String fileName = null;
|
||||
if (Objects.equals(fileType, "images")) {
|
||||
fileName = fileDir + "/" + tempPath + detailId + ".jpg";
|
||||
} else if (Objects.equals(fileType, "pdfs")) {
|
||||
fileName = fileDir + "/" + detailId + ".pdf";
|
||||
}
|
||||
|
||||
localFile = new File(fileName);
|
||||
if (!localFile.exists()) {
|
||||
localFile.createNewFile();
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
}
|
||||
return localFile;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws ClassNotFoundException {
|
||||
String address = "ftp://10.6.0.155/2019-10-21/000581031700_1_000581031700_0_1_JHR06.00.02_34_2_0.pdf";
|
||||
String a = address.substring(0, address.indexOf(".pdf"));
|
||||
String emrPath = a.substring(a.lastIndexOf("_") + 1, a.length());
|
||||
|
||||
System.out.println(emrPath);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,317 @@
|
||||
package com.ann.demo.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.ann.demo.entity.constant.AliasName;
|
||||
import com.ann.demo.entity.constant.InterfaceName;
|
||||
import com.ann.demo.entity.filing.dto.MessageDto;
|
||||
import com.ann.demo.entity.interfaceEntity.*;
|
||||
import org.apache.axis.utils.StringUtils;
|
||||
import org.dom4j.*;
|
||||
import org.dom4j.io.SAXReader;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.helpers.XMLFilterImpl;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.beans.IntrospectionException;
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.text.ParsePosition;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Date 2019/6/17 15:14
|
||||
* @Created by ljx
|
||||
*/
|
||||
@Component
|
||||
public class XMLUtils {
|
||||
|
||||
static final Logger logger = LoggerFactory.getLogger(XMLUtils.class);
|
||||
|
||||
private static final String DEFAULT_ENCODING = "UTF-8";
|
||||
|
||||
private static final Map<String, String> map;
|
||||
|
||||
static {
|
||||
map = new HashMap<String, String>();
|
||||
map.put("ns", "urn:hl7-org:v3");
|
||||
}
|
||||
|
||||
public static String path;
|
||||
@Value("${file.path}")
|
||||
private String pathTemp;
|
||||
|
||||
// 检验报告
|
||||
public static String inspectionReportPath;
|
||||
@Value("${file.inspectionReportPath}")
|
||||
private String inspectionReportPathTemp;
|
||||
|
||||
// 检验申请单
|
||||
public static String inspectionApplyPath;
|
||||
@Value("${file.inspectionApplyPath}")
|
||||
private String inspectionApplyPathTemp;
|
||||
|
||||
// 检验申请单确立
|
||||
public static String verificationInspectionApplyPath;
|
||||
@Value("${file.verificationInspectionApplyPath}")
|
||||
private String verificationInspectionApplyPathTemp;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
path = pathTemp;
|
||||
inspectionReportPath = inspectionReportPathTemp;
|
||||
inspectionApplyPath = inspectionApplyPathTemp;
|
||||
verificationInspectionApplyPath = verificationInspectionApplyPathTemp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改V3xml内容
|
||||
*/
|
||||
public static String generateV3XmlStr(String typeCodeValue, String textContent) throws Exception{
|
||||
try {
|
||||
SAXReader reader = new SAXReader();
|
||||
Document document = reader.read(path);
|
||||
Element root = document.getRootElement();
|
||||
|
||||
Element creationTime = root.element("creationTime");
|
||||
Attribute value = creationTime.attribute("value");
|
||||
value.setValue(DateUtils.getDate());
|
||||
|
||||
Element acknowledgement = root.element("acknowledgement");
|
||||
Attribute typeCode = acknowledgement.attribute("typeCode");
|
||||
typeCode.setValue(typeCodeValue);
|
||||
|
||||
Element acknowledgementDetail = acknowledgement.element("acknowledgementDetail");
|
||||
Element text = acknowledgementDetail.element("text");
|
||||
text.setText(textContent);
|
||||
return document.getRootElement().asXML();
|
||||
}catch (Exception e){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------向外抛出异常
|
||||
public static MessageDto xpathToBean(String xmlStr, Class tClass, String source) {
|
||||
MessageDto messageDto = null;
|
||||
Document doc = null;
|
||||
Object obj = null;
|
||||
try {
|
||||
xmlStr = xmlStr.replaceAll("&", "&");
|
||||
SAXReader saxReader = new SAXReader();
|
||||
saxReader.setXMLFilter(new XMLFilterImpl() {
|
||||
@Override
|
||||
public void characters(char[] ch, int start, int length) throws SAXException {
|
||||
String text = new String(ch, start, length);
|
||||
if (length == 1) {
|
||||
if ((int) ch[0] == 160) {
|
||||
char[] escape = " ".toCharArray();
|
||||
super.characters(escape, 0, escape.length);
|
||||
return;
|
||||
}
|
||||
}
|
||||
super.characters(ch, start, length);
|
||||
}
|
||||
});
|
||||
doc = saxReader.read(new ByteArrayInputStream(xmlStr.getBytes("UTF-8")), "UTF-8");
|
||||
if (tClass != null) {
|
||||
messageDto = getInstance(source);
|
||||
obj = tClass.newInstance();
|
||||
} else {
|
||||
// 是检查报告的接口
|
||||
String str = "/ns:ClinicalDocument/ns:component/ns:structuredBody/ns:component/ns:section/ns:entry/ns:observation/ns:code[@displayName='检查报告科室']/../ns:value/text()";
|
||||
//-----------------------存在一个错误 如果str找不到 就会向外抛出异常org.apache.cxf.interceptor.Fault: org/jaxen/JaxenException
|
||||
XPath x = doc.createXPath(str);
|
||||
x.setNamespaceURIs(map);
|
||||
|
||||
Node node = x.selectSingleNode(doc);
|
||||
if (node != null) {
|
||||
messageDto = getInstance(node.getText());
|
||||
if (messageDto != null) {
|
||||
obj = messageDto.getObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (obj != null && messageDto != null) {
|
||||
if (messageDto.getPropertiesPath() != null) {
|
||||
// 加载配置文件
|
||||
InputStream inputStream = new BufferedInputStream(new FileInputStream(new File(messageDto.getPropertiesPath())));
|
||||
Properties properties = new Properties();
|
||||
//加载格式化后的流
|
||||
properties.load(new InputStreamReader(inputStream, DEFAULT_ENCODING));
|
||||
|
||||
Enumeration<?> enumeration = properties.propertyNames();
|
||||
while (enumeration.hasMoreElements()) {
|
||||
String key = (String) enumeration.nextElement();
|
||||
String xpath = properties.getProperty(key);
|
||||
XPath x = doc.createXPath(xpath);
|
||||
x.setNamespaceURIs(map);
|
||||
// 根据properties的value获取xml的value
|
||||
String value = "";
|
||||
Node node = x.selectSingleNode(doc);
|
||||
if (node != null) {
|
||||
value = node.getText();
|
||||
}
|
||||
// 判断属性是否存在
|
||||
String objField = existsField(obj.getClass(), key);
|
||||
if (objField != null) {
|
||||
PropertyDescriptor descriptor = new PropertyDescriptor(key, obj.getClass());
|
||||
if (("class java.util.Date").equals(objField)) {
|
||||
if (value != null && value.length() > 0) {
|
||||
// 20200526 将时间格式定义成局部变量
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
Date parse = simpleDateFormat.parse(value, new ParsePosition(0));
|
||||
descriptor.getWriteMethod().invoke(obj, parse);
|
||||
}
|
||||
} else {
|
||||
descriptor.getWriteMethod().invoke(obj, value);
|
||||
}
|
||||
}
|
||||
String messageField = existsField(messageDto.getClass(), key);
|
||||
if (messageField != null) {
|
||||
PropertyDescriptor propertyDescriptor = new PropertyDescriptor(key, messageDto.getClass());
|
||||
// 给messageDto赋值
|
||||
if (("class java.util.Date").equals(messageField)) {
|
||||
if (value != null && value.length() > 0) {
|
||||
// 20200526 将时间格式定义成局部变量
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
propertyDescriptor.getWriteMethod().invoke(messageDto, simpleDateFormat.parse(value, new ParsePosition(0)));
|
||||
}
|
||||
} else {
|
||||
propertyDescriptor.getWriteMethod().invoke(messageDto, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 将对象转成json
|
||||
messageDto.setObject(JSON.toJSONString(obj));
|
||||
Map<String, String> map1 = new HashMap<>();
|
||||
//重置pdf的base64为reportAddress节点的text
|
||||
if(xmlStr.contains("广州金域") && StringUtils.isEmpty(messageDto.getReportAddress())){
|
||||
parseXml2Map(xmlStr, map1);
|
||||
String reportAddress = map1.get("component.structuredBody.component.section.pdf");
|
||||
messageDto.setReportAddress(reportAddress);
|
||||
}
|
||||
return messageDto;
|
||||
}
|
||||
}
|
||||
} catch (DocumentException e) {
|
||||
logger.error("出错咯!错误信息:" + e);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
logger.error("出错咯!错误信息:" + e);
|
||||
} catch (FileNotFoundException e) {
|
||||
logger.error("出错咯!错误信息:" + e);
|
||||
} catch (IOException e) {
|
||||
logger.error("出错咯!错误信息:" + e);
|
||||
} catch (IllegalAccessException e) {
|
||||
logger.error("出错咯!错误信息:" + e);
|
||||
} catch (IntrospectionException e) {
|
||||
logger.error("出错咯!错误信息:" + e);
|
||||
} catch (InvocationTargetException e) {
|
||||
logger.error("出错咯!错误信息:" + e);
|
||||
} catch (InstantiationException e) {
|
||||
logger.error("出错咯!错误信息:" + e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Map<String, String> parseXml2Map(String xml, Map<String, String> map) {
|
||||
try {
|
||||
SAXReader reader = new SAXReader();
|
||||
Document doc = reader.read(new StringReader(xml));
|
||||
Element root = doc.getRootElement();
|
||||
String path = "";
|
||||
if (map.containsKey(root.getName().trim())) {
|
||||
path = map.get(root.getName().trim());
|
||||
map.remove(root.getName().trim());
|
||||
}
|
||||
for (Iterator i = root.elementIterator(); i.hasNext();) {
|
||||
Element element = (Element) i.next();
|
||||
if (element.isTextOnly()) {
|
||||
if (path.length() > 0) {
|
||||
map.put(path + element.getName().trim(), element.getTextTrim());
|
||||
} else {
|
||||
map.put(element.getName().trim(), element.getTextTrim());
|
||||
}
|
||||
} else {
|
||||
map.put(element.getName().trim(), path+ element.getName().trim() + ".");
|
||||
parseXml2Map(element.asXML(), map);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return map;
|
||||
}
|
||||
public static String replaceXpath(String xmlStr, String replaceContent) throws Exception{
|
||||
Document doc = null;
|
||||
try {
|
||||
xmlStr = xmlStr.replaceAll("&", "&");
|
||||
SAXReader saxReader = new SAXReader();
|
||||
saxReader.setXMLFilter(new XMLFilterImpl() {
|
||||
@Override
|
||||
public void characters(char[] ch, int start, int length) throws SAXException {
|
||||
String text = new String(ch, start, length);
|
||||
if (length == 1) {
|
||||
if ((int) ch[0] == 160) {
|
||||
char[] escape = " ".toCharArray();
|
||||
super.characters(escape, 0, escape.length);
|
||||
return;
|
||||
}
|
||||
}
|
||||
super.characters(ch, start, length);
|
||||
}
|
||||
});
|
||||
doc = saxReader.read(new ByteArrayInputStream(xmlStr.getBytes("UTF-8")), "UTF-8");
|
||||
|
||||
XPath x = doc.createXPath("/ns:ClinicalDocument/ns:component/ns:structuredBody/ns:component[3]/ns:section/ns:pdf/@value");
|
||||
x.setNamespaceURIs(map);
|
||||
Node node = x.selectSingleNode(doc);
|
||||
if (node != null) {
|
||||
node.setText(replaceContent);
|
||||
System.out.println(node.getText());
|
||||
}
|
||||
}catch (Exception e){
|
||||
return null;
|
||||
}
|
||||
return doc.asXML();
|
||||
}
|
||||
|
||||
public static MessageDto getInstance(String source) {
|
||||
MessageDto messageDto = null;
|
||||
// 根据source判断是哪个实体类
|
||||
switch (source) {
|
||||
case InterfaceName.INSPECTION_REPORT: // 检验报告
|
||||
messageDto = new MessageDto(UltrasonicReport.class.getName(), new UltrasonicReport(), AliasName.INSPECTION_REPORT, inspectionReportPath, source);
|
||||
break;
|
||||
case InterfaceName.PARAMETER_INSPECTIONAPPLY: // 检验报告申请单
|
||||
messageDto = new MessageDto(ExamApply.class.getName(), new ExamApply(), AliasName.PARAMETER_INSPECTIONAPPLY, inspectionApplyPath, source);
|
||||
break;
|
||||
case InterfaceName.PARAMETER_VERIFICATIONINSPECTIONAPPLY: // 检验报告申请单 核收检体
|
||||
messageDto = new MessageDto(ExamApply.class.getName(), new ExamApply(), AliasName.PARAMETER_VERIFICATIONINSPECTIONAPPLY, verificationInspectionApplyPath, source);
|
||||
break;
|
||||
|
||||
// case InterfaceName.PARAMETER_VERIFICATIONINSPECTIONAPPLY: // 检验申请单 确立
|
||||
// messageDto = new MessageDto(ExamApply.class.getName(), new ExamApply(), AliasName.PARAMETER_INSPECTIONAPPLY, inspectionApplyPath, source);
|
||||
// break;
|
||||
}
|
||||
return messageDto;
|
||||
}
|
||||
|
||||
public static String existsField(Class clz, String fieldName) {
|
||||
try {
|
||||
Field declaredField = clz.getDeclaredField(fieldName);
|
||||
if (declaredField != null) {
|
||||
return declaredField.getGenericType().toString();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
# url: jdbc:mysql://localhost:3306/test
|
||||
# # url: jdbc:mysql://10.6.1.127:3306/test
|
||||
# username: root
|
||||
# password: 123456
|
||||
# driver-class-name: com.mysql.jdbc.Driver
|
||||
# jpa:
|
||||
# database: mysql
|
||||
# hibernate:
|
||||
# ddl-auto: update
|
||||
# show-sql: true
|
||||
# database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
#url: jdbc:sqlserver://10.6.1.127:1433;DatabaseName=DB_PrivilegeManagement_GYFY
|
||||
url: jdbc:sqlserver://localhost:1433;DatabaseName=zj_record_new
|
||||
username: sa
|
||||
password: docus702
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
jpa:
|
||||
database: sql_server
|
||||
show-sql: false
|
||||
hibernate:
|
||||
dialect: org.hibernate.dialect.SQLServer2008Dialect
|
||||
hikari:
|
||||
#是否为只读数据库
|
||||
read-only: false
|
||||
# 等待连接池分配链接的最大时长
|
||||
connection-timeout: 60000
|
||||
# 一个链接idle状态最大时长
|
||||
idle-timeout: 60000
|
||||
validation-timeout: 3000
|
||||
# 一个链接最长的生命时长,超时没有被使用则被释放掉 简易比数据库超时时长少 30s
|
||||
max-lifetime: 70000
|
||||
login-timeout: 5
|
||||
# 连接池允许的最大连接数
|
||||
maximum-pool-size: 60
|
||||
# 连接池维护的最小空闲连接数
|
||||
minimum-idle: 10
|
||||
|
||||
thymeleaf:
|
||||
prefix: classpath:/templates/
|
||||
suffix: .html
|
||||
encoding: utf-8
|
||||
mode: HTML5
|
||||
cache: false
|
||||
|
||||
#logging:
|
||||
# level:
|
||||
# org.springframework.security: debug #- info
|
||||
# org.springframework.web: error
|
||||
# org.hibernate.SQL: debug
|
||||
# org.hibernate.engine.QueryParameters: debug
|
||||
# org.hibernate.engine.query.HQLQueryPlan: debug
|
||||
# org.hibernate.type.descriptor.sql.BasicBinder: trace
|
||||
file:
|
||||
path: D:\\1\MCCI_IN000002UV01.xml
|
||||
inspectionReportPath: D:\\1\inspectionReport.properties
|
||||
inspectionApplyPath: D:\\1\inspectionApply.properties
|
||||
verificationInspectionApplyPath: D:\\1\verificationInspectionApplyPath.properties
|
||||
errorPath: D:/logs/errorMessage/
|
||||
# 真正部署的时候 这个要改成Z盘
|
||||
pdfPath: D:/project_js
|
||||
server:
|
||||
port: 8080
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link rel="stylesheet" href="/static/bootstrap/bootstrap.min.css">
|
||||
<script src="/static/bootstrap/jquery.min.js"></script>
|
||||
<script src="/static/bootstrap/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<br>
|
||||
<form class="form-horizontal" role="form" action="/haha" method="post">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-1 col-sm-6">
|
||||
<label for="url">URL</label>
|
||||
<select class="form-control" id="url" name="url">
|
||||
<option value="http://localhost:8080/services/HomepageDictionary?wsdl">本地</option>
|
||||
<option value="http://10.6.1.128:8888/AcquisitionServer/services/HomepageDictionary?wsdl">服务端</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-1 col-sm-6">
|
||||
<label for="interfaceName">接口名称</label>
|
||||
<select class="form-control" id="interfaceName" name="interfaceName">
|
||||
<option value="HIPMessageServer">HIPMessageServer</option>
|
||||
<option value="ReceiveDict">ReceiveDict</option>
|
||||
<option value="InpSummary">InpSummary</option>
|
||||
<option value="handNumbnessReport">handNumbnessReport</option>
|
||||
<option value="ICUReport">ICUReport</option>
|
||||
<option value="BloodTransfusionUrl">BloodTransfusionUrl</option>
|
||||
<option value="NurseData">NurseData</option>
|
||||
<option value="DoctorData">DoctorData</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-1 col-sm-6">
|
||||
<label for="parameter">参数</label>
|
||||
<select class="form-control" id="parameter" name="parameter">
|
||||
<option value="ExamReportBackRequest">检查报告</option>
|
||||
<option value="InPatientAddRequest">入院记录</option>
|
||||
<option value="PatientOutRequest">出院记录</option>
|
||||
<option value="CalPatientRequest">取消记录</option>
|
||||
<option value="InpatientTransferRequest">转科记录</option>
|
||||
<option value="ExamApplyRequest">检查申请单</option>
|
||||
<option value="LisSendReportBack">检验报告</option>
|
||||
<option value="InspectionApplyRequest">检验申请单</option>
|
||||
<option value="VerificationInspectionApplyRequest">检验申请单核体验收</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-1 col-sm-8">
|
||||
<label for="content">内容</label>
|
||||
<textarea class="form-control" rows="14" id="content" name="content"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-1 col-sm-6">
|
||||
<input type="submit" class="btn btn-primary" value="确定"/>
|
||||
<input type="reset" class="btn btn-default" value="清空"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,16 @@
|
||||
package com.ann.demo;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class DemoApplicationTests {
|
||||
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue