版本更新
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
package com.openhis.crosssystem.dto;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.openhis.crosssystem.enums.LisOutsideFlg;
|
||||
import com.openhis.crosssystem.enums.LisPatientSex;
|
||||
import com.openhis.crosssystem.enums.LisPatientType;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* LIS申请参数
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LisApplyDto {
|
||||
|
||||
/**
|
||||
* 必填 【申请单号】 业务上需要保证唯一
|
||||
*/
|
||||
private String applyNo;
|
||||
/**
|
||||
* 必填 【患者编号】
|
||||
*/
|
||||
private String patientNo;
|
||||
/**
|
||||
* 必填 【病人类型】 门诊01 住院02 手动登记03 体检04
|
||||
*/
|
||||
private LisPatientType patientType;
|
||||
/**
|
||||
* 必填 【病人姓名】
|
||||
*/
|
||||
private String patientName;
|
||||
/**
|
||||
* 必填 【病人性别】 未知01 男02 女03
|
||||
*/
|
||||
private LisPatientSex patientSex;
|
||||
/**
|
||||
* 非必填 【联系电话】
|
||||
*/
|
||||
private String patientMobile;
|
||||
/**
|
||||
* 必填 【申请日期】
|
||||
*/
|
||||
private Date applyDate;
|
||||
/**
|
||||
* 必填 【申请医生姓名】
|
||||
*/
|
||||
private String applyDoctor;
|
||||
/**
|
||||
* 必填 【申请科室】
|
||||
*/
|
||||
private String applyDept;
|
||||
/**
|
||||
* 必填 【年龄】
|
||||
*/
|
||||
private Integer age;
|
||||
/**
|
||||
* 必填 【执行科室编码】
|
||||
*/
|
||||
private String execDeptCode;
|
||||
/**
|
||||
* 必填 【执行科室名称】
|
||||
*/
|
||||
private String execDeptName;
|
||||
/**
|
||||
* 非必填 【身份证号码】
|
||||
*/
|
||||
private String idCard;
|
||||
/**
|
||||
* 非必填 【病区ID】
|
||||
*/
|
||||
private String wardId;
|
||||
/**
|
||||
* 必填 【病房号】
|
||||
*/
|
||||
private String roomNo;
|
||||
/**
|
||||
* 必填 【床位号】
|
||||
*/
|
||||
private String bedNo;
|
||||
/**
|
||||
* 非必填 【是否急诊】
|
||||
*/
|
||||
private String emergency;
|
||||
/**
|
||||
* 非必填 【临床诊断】
|
||||
*/
|
||||
private String diagnose;
|
||||
/**
|
||||
* 必填 【外检FLG】 非外检0 外检1
|
||||
*/
|
||||
private LisOutsideFlg outsideFlg;
|
||||
|
||||
/**
|
||||
* 必填【申请部门编码】
|
||||
*/
|
||||
private String applyDeptCode;
|
||||
/**
|
||||
* 必填【申请部门名称】
|
||||
*/
|
||||
private String applyDeptName;
|
||||
|
||||
/**
|
||||
* 必填【检查项目组】
|
||||
*/
|
||||
List<LisApplyGroupDto> groupList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.openhis.crosssystem.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* LIS申请单封装类
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LisApplyGroupDto {
|
||||
|
||||
/**
|
||||
* 必填 【检查项目编码】
|
||||
*/
|
||||
private String groupCode;
|
||||
/**
|
||||
* 必填 【检查项目名称】
|
||||
*/
|
||||
private String groupName;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.openhis.crosssystem.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* LIS申请单封装类
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LisGroupInfo {
|
||||
|
||||
/**
|
||||
* 必填 【检查项目编码】 多个用“+”连接
|
||||
*/
|
||||
private String groupCode;
|
||||
/**
|
||||
* 必填 【检查项目名称】多个用“+”连接
|
||||
*/
|
||||
private String groupName;
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.openhis.crosssystem.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* LIS申请单封装类
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class LisPatientInfo {
|
||||
|
||||
/**
|
||||
* 必填 【申请单号】 业务上需要保证唯一
|
||||
*/
|
||||
private String applyNo;
|
||||
/**
|
||||
* 必填 【患者编号】
|
||||
*/
|
||||
private String patientNo;
|
||||
/**
|
||||
* 必填 【病人类型】 门诊01 住院02 手动登记03 体检04
|
||||
*/
|
||||
private String patientType;
|
||||
/**
|
||||
* 必填 【病人姓名】
|
||||
*/
|
||||
private String patientName;
|
||||
/**
|
||||
* 必填 【病人性别】 未知01 男02 女03
|
||||
*/
|
||||
private String patientSex;
|
||||
/**
|
||||
* 非必填 【联系电话】
|
||||
*/
|
||||
private String patientMobile;
|
||||
/**
|
||||
* 必填 【申请日期】 格式:yyyy-MM-dd HH:mm:ss.S
|
||||
*/
|
||||
private String applyDate;
|
||||
/**
|
||||
* 必填 【申请医生姓名】
|
||||
*/
|
||||
private String applyDoctor;
|
||||
/**
|
||||
* 必填 【申请科室】
|
||||
*/
|
||||
private String applyDept;
|
||||
/**
|
||||
* 必填 【年龄】
|
||||
*/
|
||||
private Integer age;
|
||||
/**
|
||||
* 必填 【年龄单位】 岁01
|
||||
*/
|
||||
private String ageUnit;
|
||||
/**
|
||||
* 必填 【执行科室编码】
|
||||
*/
|
||||
private String execDeptCode;
|
||||
/**
|
||||
* 必填 【执行科室名称】
|
||||
*/
|
||||
private String execDeptName;
|
||||
/**
|
||||
* 非必填 【身份证号码】
|
||||
*/
|
||||
private String idCard;
|
||||
/**
|
||||
* 非必填 【病区ID】
|
||||
*/
|
||||
private String wardId;
|
||||
/**
|
||||
* 必填 【病房号】
|
||||
*/
|
||||
private String roomNo;
|
||||
/**
|
||||
* 必填 【床位号】
|
||||
*/
|
||||
private String bedNo;
|
||||
/**
|
||||
* 非必填 【是否急诊】
|
||||
*/
|
||||
private String emergency;
|
||||
/**
|
||||
* 非必填 【临床诊断】
|
||||
*/
|
||||
private String diagnose;
|
||||
/**
|
||||
* 必填 【外检FLG】 非外检0 外检1
|
||||
*/
|
||||
private Integer outsideFlg;
|
||||
|
||||
/**
|
||||
* 必填【申请部门编码】
|
||||
*/
|
||||
private String applyDeptCode;
|
||||
/**
|
||||
* 必填【申请部门名称】
|
||||
*/
|
||||
private String applyDeptName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.openhis.crosssystem.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.openhis.crosssystem.enums.PacsPatientSex;
|
||||
import com.openhis.crosssystem.enums.PacsPatientType;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* PACS申请参数
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PacsApplyDto {
|
||||
|
||||
/**
|
||||
* 必填 【申请单号】 业务上需要保证唯一
|
||||
*/
|
||||
private String applyNo;
|
||||
/**
|
||||
* 必填 【患者编号】
|
||||
*/
|
||||
private String patientNo;
|
||||
/**
|
||||
* 必填 【患者类型】 门诊01 住院02 手动登记03 体检04
|
||||
*/
|
||||
private PacsPatientType patientType;
|
||||
/**
|
||||
* 必填 【患者姓名】
|
||||
*/
|
||||
private String patientName;
|
||||
/**
|
||||
* 必填 【性别】 PACS中 男01 女02 未知03
|
||||
*/
|
||||
private PacsPatientSex patientSex;
|
||||
/**
|
||||
* 非必填 【联系电话】
|
||||
*/
|
||||
private String patientMobile;
|
||||
/**
|
||||
* 必填 【申请日期】 格式:yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
private Date applyDate;
|
||||
/**
|
||||
* 必填 【申请医生姓名】
|
||||
*/
|
||||
private String applyDoctorName;
|
||||
/**
|
||||
* 必填 【申请医生编码】
|
||||
*/
|
||||
private String applyDoctorCode;
|
||||
/**
|
||||
* 必填 【申请部门名称】
|
||||
*/
|
||||
private String applyDeptName;
|
||||
/**
|
||||
* 必填 【申请部门编码】
|
||||
*/
|
||||
private String applyDeptCode;
|
||||
/**
|
||||
* 必填 【年龄】
|
||||
*/
|
||||
private Integer age;
|
||||
/**
|
||||
* 必填 【执行科室编码】
|
||||
*/
|
||||
private String execDeptCode;
|
||||
/**
|
||||
* 必填 【执行科室名称】
|
||||
*/
|
||||
private String execDeptName;
|
||||
/**
|
||||
* 必填 【检查部位】
|
||||
*/
|
||||
private String examPart;
|
||||
/**
|
||||
* 非必填 【身份证号】
|
||||
*/
|
||||
private String idCard;
|
||||
/**
|
||||
* 非必填 【病区ID】
|
||||
*/
|
||||
private String wardId;
|
||||
/**
|
||||
* 非必填 【病房号】
|
||||
*/
|
||||
private String roomNo;
|
||||
/**
|
||||
* 非必填 【病床号】
|
||||
*/
|
||||
private String bedNo;
|
||||
/**
|
||||
* 非必填 【是否急诊】
|
||||
*/
|
||||
private String emergency;
|
||||
/**
|
||||
* 非必填 【临床诊断】
|
||||
*/
|
||||
private String diagnose;
|
||||
|
||||
/**
|
||||
* 必填 【检查项目编码】
|
||||
*/
|
||||
private String groupCode;
|
||||
|
||||
/**
|
||||
* 必填 【检查项目名称】
|
||||
*/
|
||||
private String groupName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.openhis.crosssystem.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* PACS申请单封装类
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PacsGroupInfo {
|
||||
|
||||
/**
|
||||
* 必填 【检查项目编码】
|
||||
*/
|
||||
private String groupCode;
|
||||
|
||||
/**
|
||||
* 必填 【检查项目名称】
|
||||
*/
|
||||
private String groupName;
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.openhis.crosssystem.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* PACS申请单封装类
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PacsPatientInfo {
|
||||
|
||||
/**
|
||||
* 必填 【申请单号】 业务上需要保证唯一
|
||||
*/
|
||||
private String applyNo;
|
||||
/**
|
||||
* 必填 【患者编号】
|
||||
*/
|
||||
private String patientNo;
|
||||
/**
|
||||
* 必填 【患者类型】 门诊01 住院02 手动登记03 体检04
|
||||
*/
|
||||
private String patientType;
|
||||
/**
|
||||
* 必填 【患者姓名】
|
||||
*/
|
||||
private String patientName;
|
||||
/**
|
||||
* 必填 【性别】 PACS中 男01 女02 未知03
|
||||
*/
|
||||
private String patientSex;
|
||||
/**
|
||||
* 非必填 【联系电话】
|
||||
*/
|
||||
private String patientMobile;
|
||||
/**
|
||||
* 必填 【申请日期】 格式:yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
private String applyDate;
|
||||
/**
|
||||
* 必填 【申请医生姓名】
|
||||
*/
|
||||
private String applyDoctorName;
|
||||
/**
|
||||
* 必填 【申请医生编码】
|
||||
*/
|
||||
private String applyDoctorCode;
|
||||
/**
|
||||
* 必填 【申请部门名称】
|
||||
*/
|
||||
private String applyDeptName;
|
||||
/**
|
||||
* 必填 【申请部门编码】
|
||||
*/
|
||||
private String applyDeptCode;
|
||||
/**
|
||||
* 必填 【年龄】
|
||||
*/
|
||||
private String age;
|
||||
/**
|
||||
* 必填 【年龄单位】 岁1
|
||||
*/
|
||||
private String ageUnit;
|
||||
/**
|
||||
* 必填 【执行科室编码】
|
||||
*/
|
||||
private String execDeptCode;
|
||||
/**
|
||||
* 必填 【执行科室名称】
|
||||
*/
|
||||
private String execDeptName;
|
||||
/**
|
||||
* 必填 【检查部位】
|
||||
*/
|
||||
private String examPart;
|
||||
/**
|
||||
* 非必填 【身份证号】
|
||||
*/
|
||||
private String idCard;
|
||||
/**
|
||||
* 非必填 【病区ID】
|
||||
*/
|
||||
private String wardId;
|
||||
/**
|
||||
* 非必填 【病房号】
|
||||
*/
|
||||
private String roomNo;
|
||||
/**
|
||||
* 非必填 【病床号】
|
||||
*/
|
||||
private String bedNo;
|
||||
/**
|
||||
* 非必填 【是否急诊】
|
||||
*/
|
||||
private String emergency;
|
||||
/**
|
||||
* 非必填 【临床诊断】
|
||||
*/
|
||||
private String diagnose;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.openhis.crosssystem.enums;
|
||||
|
||||
/**
|
||||
* LIS年龄单位
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
public enum LisAgeUnit {
|
||||
/**
|
||||
* 岁
|
||||
*/
|
||||
YEAR("01", "岁");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
LisAgeUnit(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static LisAgeUnit getByCode(String code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (LisAgeUnit val : values()) {
|
||||
if (val.getCode().equals(code)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.openhis.crosssystem.enums;
|
||||
|
||||
/**
|
||||
* LIS外检FLG
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
public enum LisOutsideFlg {
|
||||
/**
|
||||
* 非外检
|
||||
*/
|
||||
NO(0, "非外检"),
|
||||
/**
|
||||
* 外检
|
||||
*/
|
||||
YES(1, "外检");
|
||||
|
||||
private final Integer code;
|
||||
private final String name;
|
||||
|
||||
LisOutsideFlg(Integer code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static LisOutsideFlg getByCode(Integer code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (LisOutsideFlg val : values()) {
|
||||
if (val.getCode().equals(code)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.openhis.crosssystem.enums;
|
||||
|
||||
/**
|
||||
* LIS病人性别
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
public enum LisPatientSex {
|
||||
/**
|
||||
* 未知
|
||||
*/
|
||||
UNKNOWN("01", "未知"),
|
||||
/**
|
||||
* 男
|
||||
*/
|
||||
MALE("02", "男"),
|
||||
/**
|
||||
* 女
|
||||
*/
|
||||
FEMALE("03", "女");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
LisPatientSex(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static LisPatientSex getByCode(String code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (LisPatientSex val : values()) {
|
||||
if (val.getCode().equals(code)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.openhis.crosssystem.enums;
|
||||
|
||||
/**
|
||||
* LIS病人类型
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
public enum LisPatientType {
|
||||
/**
|
||||
* 门诊
|
||||
*/
|
||||
OUTPATIENT("01", "门诊"),
|
||||
/**
|
||||
* 住院
|
||||
*/
|
||||
INPATIENT("02", "住院"),
|
||||
/**
|
||||
* 手动登记
|
||||
*/
|
||||
MANUAL_REGISTRATION("03", "手动登记"),
|
||||
/**
|
||||
* 体检
|
||||
*/
|
||||
HEALTH_CHECKUP("04", "体检");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
LisPatientType(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static LisPatientType getByCode(String code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (LisPatientType val : values()) {
|
||||
if (val.getCode().equals(code)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.openhis.crosssystem.enums;
|
||||
|
||||
/**
|
||||
* PACS年龄单位
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
public enum PacsAgeUnit {
|
||||
/**
|
||||
* 岁
|
||||
*/
|
||||
YEAR("1", "岁");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
PacsAgeUnit(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static PacsAgeUnit getByCode(String code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (PacsAgeUnit val : values()) {
|
||||
if (val.getCode().equals(code)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.openhis.crosssystem.enums;
|
||||
|
||||
/**
|
||||
* PACS性别
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
public enum PacsPatientSex {
|
||||
/**
|
||||
* 男
|
||||
*/
|
||||
MALE("01", "男"),
|
||||
/**
|
||||
* 女
|
||||
*/
|
||||
FEMALE("02", "女"),
|
||||
/**
|
||||
* 未知
|
||||
*/
|
||||
UNKNOWN("03", "未知");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
PacsPatientSex(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static PacsPatientSex getByCode(String code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (PacsPatientSex val : values()) {
|
||||
if (val.getCode().equals(code)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.openhis.crosssystem.enums;
|
||||
|
||||
/**
|
||||
* PACS患者类型
|
||||
*
|
||||
* @author system
|
||||
*/
|
||||
public enum PacsPatientType {
|
||||
/**
|
||||
* 门诊
|
||||
*/
|
||||
OUTPATIENT("01", "门诊"),
|
||||
/**
|
||||
* 住院
|
||||
*/
|
||||
INPATIENT("02", "住院"),
|
||||
/**
|
||||
* 手动登记
|
||||
*/
|
||||
MANUAL_REGISTRATION("03", "手动登记"),
|
||||
/**
|
||||
* 体检
|
||||
*/
|
||||
HEALTH_CHECKUP("04", "体检");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
PacsPatientType(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static PacsPatientType getByCode(String code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (PacsPatientType val : values()) {
|
||||
if (val.getCode().equals(code)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,289 @@
|
||||
package com.openhis.crosssystem.utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.conn.ssl.NoopHostnameVerifier;
|
||||
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||
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.util.EntityUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.core.common.enums.TenantOptionDict;
|
||||
import com.core.common.exception.ServiceException;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.web.util.TenantOptionUtil;
|
||||
import com.openhis.crosssystem.dto.*;
|
||||
import com.openhis.crosssystem.enums.LisAgeUnit;
|
||||
import com.openhis.crosssystem.enums.PacsAgeUnit;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 跨系统发送申请工具类
|
||||
*
|
||||
* @author GuoRui
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CrossSystemSendApplyUtil {
|
||||
|
||||
/**
|
||||
* 发送LIS申请
|
||||
*
|
||||
* @param lisApplyDto LIS申请参数
|
||||
*/
|
||||
public void sendApplyToLis(LisApplyDto lisApplyDto) {
|
||||
// 读取配置参数
|
||||
String apiUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.LIS_API_URL);
|
||||
String appId = TenantOptionUtil.getOptionContent(TenantOptionDict.LIS_APP_ID);
|
||||
String appSecret = TenantOptionUtil.getOptionContent(TenantOptionDict.LIS_APP_SECRET);
|
||||
if (StringUtils.isEmpty(apiUrl) || StringUtils.isEmpty(appId) || StringUtils.isEmpty(appSecret)) {
|
||||
throw new ServiceException("请在租户管理页面配置LIS相关接口参数");
|
||||
}
|
||||
// 作成申请参数
|
||||
LisPatientInfo lisPatientInfo = new LisPatientInfo()
|
||||
// 必填 【申请单号】 业务上需要保证唯一
|
||||
.setApplyNo(lisApplyDto.getApplyNo())
|
||||
// 必填 【患者编号】
|
||||
.setPatientNo(lisApplyDto.getPatientNo())
|
||||
// 必填 【病人类型】 门诊01 住院02 手动登记03 体检04
|
||||
.setPatientType(lisApplyDto.getPatientType() == null ? null : lisApplyDto.getPatientType().getCode())
|
||||
// 必填 【病人姓名】
|
||||
.setPatientName(lisApplyDto.getPatientName())
|
||||
// 必填 【病人性别】 未知01 男02 女03
|
||||
.setPatientSex(lisApplyDto.getPatientSex() == null ? null : lisApplyDto.getPatientSex().getCode())
|
||||
// 非必填 【联系电话】
|
||||
.setPatientMobile(lisApplyDto.getPatientMobile())
|
||||
// 必填 【申请日期】 格式:yyyy-MM-dd HH:mm:ss.S
|
||||
.setApplyDate(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss.S", lisApplyDto.getApplyDate()))
|
||||
// 必填 【申请医生姓名】
|
||||
.setApplyDoctor(lisApplyDto.getApplyDoctor())
|
||||
// 必填 【申请科室】
|
||||
.setApplyDept(lisApplyDto.getApplyDept())
|
||||
// 必填 【年龄】
|
||||
.setAge(lisApplyDto.getAge())
|
||||
// 必填 【年龄单位】 岁01
|
||||
.setAgeUnit(LisAgeUnit.YEAR.getCode())
|
||||
// 必填 【执行科室编码】
|
||||
.setExecDeptCode(lisApplyDto.getExecDeptCode())
|
||||
// 必填 【执行科室名称】
|
||||
.setExecDeptName(lisApplyDto.getExecDeptName())
|
||||
// 非必填 【身份证号码】
|
||||
.setIdCard(lisApplyDto.getIdCard())
|
||||
// 非必填 【病区ID】
|
||||
.setWardId(lisApplyDto.getWardId())
|
||||
// 必填 【病房号】
|
||||
.setRoomNo(lisApplyDto.getRoomNo())
|
||||
// 必填 【床位号】
|
||||
.setBedNo(lisApplyDto.getBedNo())
|
||||
// 非必填 【是否急诊】
|
||||
.setEmergency(lisApplyDto.getEmergency())
|
||||
// 非必填 【临床诊断】
|
||||
.setDiagnose(lisApplyDto.getDiagnose())
|
||||
// 必填 【外检FLG】 非外检0 外检1
|
||||
.setOutsideFlg(lisApplyDto.getOutsideFlg() == null ? null : lisApplyDto.getOutsideFlg().getCode())
|
||||
// 必填【申请部门编码】
|
||||
.setApplyDeptCode(lisApplyDto.getApplyDeptCode())
|
||||
// 必填【申请部门名称】
|
||||
.setApplyDeptName(lisApplyDto.getApplyDeptName());
|
||||
LisGroupInfo lisGroupInfo = new LisGroupInfo()
|
||||
// 必填 【检查项目编码】 多个用“+”连接
|
||||
.setGroupCode(lisApplyDto.getGroupList().stream().map(LisApplyGroupDto::getGroupCode)
|
||||
.collect(Collectors.joining("+")))
|
||||
// 必填 【检查项目名称】多个用“+”连接
|
||||
.setGroupName(lisApplyDto.getGroupList().stream().map(LisApplyGroupDto::getGroupName)
|
||||
.collect(Collectors.joining("+")));
|
||||
// 设置超时时间
|
||||
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(5000).setConnectionRequestTimeout(3000)
|
||||
.setSocketTimeout(30000).build();
|
||||
// 创建无视SSL验证的HttpClient
|
||||
CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig)
|
||||
.setSSLSocketFactory(createIgnoreSslSocketFactory()).build();
|
||||
CloseableHttpResponse response = null;
|
||||
// 发起HTTP请求
|
||||
try {
|
||||
HttpPost httpPost = new HttpPost(apiUrl);
|
||||
httpPost.setHeader("App-Id", appId);
|
||||
httpPost.setHeader("App-Secret", appSecret);
|
||||
Map<String, Object> requestUrlParam = new HashMap<>();
|
||||
requestUrlParam.put("patientInfo", lisPatientInfo);
|
||||
requestUrlParam.put("groupInfo", lisGroupInfo);
|
||||
String s = JSON.toJSONString(requestUrlParam);
|
||||
StringEntity stringEntity = new StringEntity(s, ContentType.APPLICATION_JSON);
|
||||
httpPost.setEntity(stringEntity);
|
||||
response = httpClient.execute(httpPost);
|
||||
JSONObject object = JSON.parseObject(EntityUtils.toString(response.getEntity(), "utf-8"));
|
||||
// 获取结果CODE
|
||||
String code = String.valueOf(object.getInnerMap().get("code"));
|
||||
if (!"100000".equals(code)) {
|
||||
throw new ServiceException("LIS申请返回失败信息:" + object);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new ServiceException("LIS申请发生未知错误:" + e.getMessage());
|
||||
} finally {
|
||||
if (response != null) {
|
||||
try {
|
||||
response.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送PACS申请
|
||||
*
|
||||
* @param pacsApplyDto PACS申请参数
|
||||
*/
|
||||
public void sendApplyToPacs(PacsApplyDto pacsApplyDto) {
|
||||
String apiUrl = TenantOptionUtil.getOptionContent(TenantOptionDict.PACS_API_URL);
|
||||
String appId = TenantOptionUtil.getOptionContent(TenantOptionDict.PACS_APP_ID);
|
||||
String appSecret = TenantOptionUtil.getOptionContent(TenantOptionDict.PACS_APP_SECRET);
|
||||
if (StringUtils.isEmpty(apiUrl) || StringUtils.isEmpty(appId) || StringUtils.isEmpty(appSecret)) {
|
||||
throw new ServiceException("请在租户管理页面配置PACS相关接口参数");
|
||||
}
|
||||
// 作成申请参数
|
||||
PacsPatientInfo pacsPatientInfo = new PacsPatientInfo()
|
||||
// 必填 【申请单号】 业务上需要保证唯一
|
||||
.setApplyNo(pacsApplyDto.getApplyNo())
|
||||
// 必填 【患者编号】
|
||||
.setPatientNo(pacsApplyDto.getPatientNo())
|
||||
// 必填 【患者类型】 门诊01 住院02 手动登记03 体检04
|
||||
.setPatientType(pacsApplyDto.getPatientType() == null ? null : pacsApplyDto.getPatientType().getCode())
|
||||
// 必填 【患者姓名】
|
||||
.setPatientName(pacsApplyDto.getPatientName())
|
||||
// 必填 【性别】 PACS中 男01 女02 未知03
|
||||
.setPatientSex(pacsApplyDto.getPatientSex() == null ? null : pacsApplyDto.getPatientSex().getCode())
|
||||
// 非必填 【联系电话】
|
||||
.setPatientMobile(pacsApplyDto.getPatientMobile())
|
||||
// 必填 【申请日期】 格式:yyyy-MM-dd HH:mm:ss
|
||||
.setApplyDate(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", pacsApplyDto.getApplyDate()))
|
||||
// 必填 【申请医生姓名】
|
||||
.setApplyDoctorName(pacsApplyDto.getApplyDoctorName())
|
||||
// 必填 【申请医生编码】
|
||||
.setApplyDoctorCode(pacsApplyDto.getApplyDoctorCode())
|
||||
// 必填 【申请部门名称】
|
||||
.setApplyDeptName(pacsApplyDto.getApplyDeptName())
|
||||
// 必填 【申请部门编码】
|
||||
.setApplyDeptCode(pacsApplyDto.getApplyDeptCode())
|
||||
// 必填 【年龄】
|
||||
.setAge(pacsApplyDto.getAge() == null ? "" : pacsApplyDto.getAge().toString())
|
||||
// 必填 【年龄单位】 岁1
|
||||
.setAgeUnit(PacsAgeUnit.YEAR.getCode())
|
||||
// 必填 【执行科室编码】
|
||||
.setExecDeptCode(pacsApplyDto.getExecDeptCode())
|
||||
// 必填 【执行科室名称】
|
||||
.setExecDeptName(pacsApplyDto.getExecDeptName())
|
||||
// 必填 【检查部位】
|
||||
.setExamPart(pacsApplyDto.getExamPart())
|
||||
// 非必填 【身份证号】
|
||||
.setIdCard(pacsApplyDto.getIdCard())
|
||||
// 非必填 【病区ID】
|
||||
.setWardId(pacsApplyDto.getWardId())
|
||||
// 非必填 【病房号】
|
||||
.setRoomNo(pacsApplyDto.getRoomNo())
|
||||
// 非必填 【病床号】
|
||||
.setBedNo(pacsApplyDto.getBedNo())
|
||||
// 非必填 【是否急诊】
|
||||
.setEmergency(pacsApplyDto.getEmergency())
|
||||
// 非必填 【临床诊断】
|
||||
.setDiagnose(pacsApplyDto.getDiagnose());
|
||||
PacsGroupInfo pacsGroupInfo = new PacsGroupInfo()
|
||||
// 必填 【检查项目编码】
|
||||
.setGroupCode(pacsApplyDto.getGroupCode())
|
||||
// 必填 【检查项目名称】
|
||||
.setGroupName(pacsApplyDto.getGroupName());
|
||||
// 设置超时时间
|
||||
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(5000).setConnectionRequestTimeout(3000)
|
||||
.setSocketTimeout(30000).build();
|
||||
// 创建无视SSL验证的HttpClient
|
||||
CloseableHttpClient httpClient = HttpClients.custom().setDefaultRequestConfig(requestConfig)
|
||||
.setSSLSocketFactory(createIgnoreSslSocketFactory()).build();
|
||||
CloseableHttpResponse response = null;
|
||||
// 发起HTTP请求
|
||||
try {
|
||||
HttpPost httpPost = new HttpPost(apiUrl);
|
||||
httpPost.setHeader("App-Id", appId);
|
||||
httpPost.setHeader("App-Secret", appSecret);
|
||||
Map<String, Object> requestUrlParam = new HashMap<>();
|
||||
requestUrlParam.put("patientInfo", pacsPatientInfo);
|
||||
requestUrlParam.put("groupInfo", pacsGroupInfo);
|
||||
String s = JSON.toJSONString(requestUrlParam);
|
||||
StringEntity stringEntity = new StringEntity(s, ContentType.APPLICATION_JSON);
|
||||
httpPost.setEntity(stringEntity);
|
||||
response = httpClient.execute(httpPost);
|
||||
JSONObject object = JSON.parseObject(EntityUtils.toString(response.getEntity(), "utf-8"));
|
||||
// 获取结果CODE
|
||||
String code = String.valueOf(object.getInnerMap().get("code"));
|
||||
if (!"100000".equals(code)) {
|
||||
throw new ServiceException("PACS申请返回失败信息:" + object);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new ServiceException("PACS申请发生未知错误:" + e.getMessage());
|
||||
} finally {
|
||||
if (response != null) {
|
||||
try {
|
||||
response.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建无视SSL验证的SSLSocketFactory
|
||||
*/
|
||||
private static SSLConnectionSocketFactory createIgnoreSslSocketFactory() {
|
||||
try {
|
||||
// 创建信任所有证书的TrustManager
|
||||
X509TrustManager trustAllCert = new X509TrustManager() {
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] chain, String authType) {}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] chain, String authType) {}
|
||||
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new X509Certificate[0];
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化SSLContext
|
||||
SSLContext sslContext = SSLContext.getInstance("SSL");
|
||||
sslContext.init(null, new TrustManager[] {trustAllCert}, new SecureRandom());
|
||||
|
||||
// 创建不验证主机名的SocketFactory
|
||||
return new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE // 关键:禁用主机名验证
|
||||
);
|
||||
} catch (NoSuchAlgorithmException | KeyManagementException e) {
|
||||
throw new RuntimeException("SSL配置失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user