feat: 佛山三院,添加lis报告webservice采集,配置文件有修改

master
wyb 1 year ago
parent 6944a924e0
commit 8fa2ecfd81

@ -184,6 +184,20 @@
<version>11.2.0.4.0</version> <version>11.2.0.4.0</version>
</dependency> </dependency>
<!-- webservice cxf-->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>3.3.4</version>
</dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<resources> <resources>

@ -14,6 +14,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.Properties;
/** /**
@ -25,6 +26,11 @@ import java.util.Date;
@EnableFeignClients(basePackages = {"com.docus"}) @EnableFeignClients(basePackages = {"com.docus"})
public class AppRunBootstrap { public class AppRunBootstrap {
public static void main(String[] args) { public static void main(String[] args) {
Properties props = System.getProperties();
props.setProperty("org.apache.cxf.stax.allowInsecureParser", "1");
props.setProperty("UseSunHttpHandler", "true");
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
SpringApplication.run(AppRunBootstrap.class, args); SpringApplication.run(AppRunBootstrap.class, args);
} }

@ -0,0 +1,22 @@
package com.docus.server.archive.config;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
* @author YongBin Wen
* @date 2024/3/29 14:00
*/
@Component
@Data
public class DocusServerUrlConfig {
@Value("${docus.url.viewcollect-server}")
private String viewCollectServerUrl;
@Value("${docus.url.downploadlatform-server}")
private String downloadPlatformServerUrl;
@Value("${docus.url.taskdistribute-server}")
private String taskDistributeServerUrl;
}

@ -0,0 +1,105 @@
package com.docus.server.archive.job;
import com.docus.core.util.Func;
import com.docus.infrastructure.web.api.CommonResult;
import com.docus.infrastructure.web.api.ResultCode;
import com.docus.server.archive.rpc.DownPlatformService;
import com.docus.server.archive.rpc.TaskDistributeService;
import com.docus.server.archive.rpc.dto.ReportDownDto;
import com.docus.server.archive.rpc.dto.ReportDownTwoDto;
import com.docus.server.archive.rpc.dto.ReportHospitalTwoDto;
import com.docus.server.archive.rpc.dto.ReportPatientTwoDto;
import com.docus.server.fsy.api.LisReportService;
import com.docus.server.fsy.api.dto.LisPatientListRequest;
import com.docus.server.fsy.api.dto.LisPatientListResponse;
import com.docus.server.fsy.api.dto.LisPatientReportRequest;
import com.docus.server.fsy.api.dto.LisPatientReportResponse;
import com.docus.server.fsy.converter.LisReportConverter;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
/**
* @author YongBin Wen
* @date 2024/3/27 16:23
*/
@Component
@Slf4j
public class LisPatientReportCollectJob {
@Value("${fsy.lis.assortid}")
private String lisAssortId;
@Value("${fsy.lis.sysflag}")
private String lisCollectorId;
@Resource
private LisReportService lisReportService;
@Resource
private DownPlatformService downPlatformService;
@Resource
private TaskDistributeService taskDistributeService;
/**
* Lisjob
*
* @date 2024/3/27 16:27
* @author YongBin Wen
*/
@XxlJob("FoShanSyLisPatientReportCollectJob")
public void foShanSyLisPatientReportCollectJob() {
log.info("====================> 佛山三院Lis检验报告采集任务开始 ===================");
try {
while (true) {
CommonResult<ReportDownTwoDto> taskResult = taskDistributeService.getNoViewTaskByCollectorId(lisCollectorId);
if (Objects.isNull(taskResult) || taskResult.getCode().equals(ResultCode.FAILED.getCode())) {
break;
}
// 获取采集任务
ReportDownTwoDto reportDownTwoDto = taskResult.getData();
Long taskId = reportDownTwoDto.getTasks().get(0).getTaskId();
log.info("佛山三院Lis检验报告采集任务,成功获取采集任务,任务id{}", taskId);
ReportPatientTwoDto patientTwoDto = reportDownTwoDto.getPatient();
ReportHospitalTwoDto hospitalTwoDto = reportDownTwoDto.getHospitals().get(0);
String admissDate = hospitalTwoDto.getAdmissDate();
String disDate = hospitalTwoDto.getDisDate();
if (Func.isBlank(admissDate) || Func.isBlank(disDate)) {
log.info("佛山三院Lis检验报告采集任务,采集任务id{} 入院时间或者出院时间为空,不进行采集!", taskId);
continue;
}
// 获取患者的lis检验报告列表
LisPatientListRequest lisPatientListRequest = new LisPatientListRequest();
lisPatientListRequest.setPidInNo(patientTwoDto.getInpatientNo());
lisPatientListRequest.setPidAddmissTimes(hospitalTwoDto.getAdmissTimes());
lisPatientListRequest.setStartDate(admissDate);
lisPatientListRequest.setEndDate(disDate);
LisPatientListResponse patientListResponse = lisReportService.getPatientList(lisPatientListRequest);
List<LisPatientListResponse.Patient> patientList = patientListResponse.getPatientList();
if (Func.isEmpty(patientList)) {
log.info("佛山三院Lis检验报告采集任务,采集任务id{} 未查询到List患者文件数据", taskId);
continue;
}
// 文件列表查询每个文件,进行上报下载服务
for (LisPatientListResponse.Patient patient : patientList) {
LisPatientReportRequest lisPatientReportRequest = new LisPatientReportRequest();
lisPatientReportRequest.setRepId(patient.getRepId());
lisPatientReportRequest.setCustomReportSuffix("");
LisPatientReportResponse lisReportServicePatientReport = lisReportService.getPatientReport(lisPatientReportRequest);
ReportDownDto reportDownDto = LisReportConverter.convertDownloadPlatform(reportDownTwoDto, patient, lisReportServicePatientReport);
reportDownDto.setCollectorid(lisCollectorId);
reportDownDto.setAssortid(lisAssortId);
downPlatformService.report(reportDownDto);
}
}
} catch (Exception ex) {
log.error("====================> 佛山三院Lis检验报告采集任务出现异常_" + ex.getMessage(), ex);
}
log.info("====================> 佛山三院Lis检验报告采集任务结束 ===================");
}
}

@ -0,0 +1,22 @@
package com.docus.server.archive.rpc;
import com.docus.infrastructure.web.api.CommonResult;
import com.docus.server.archive.rpc.dto.ReportDownDto;
/**
*
*
* @author jiashi
*/
public interface DownPlatformService {
/**
*
*
* @param reportDownDto
* @return
*/
CommonResult report(ReportDownDto reportDownDto);
}

@ -0,0 +1,24 @@
package com.docus.server.archive.rpc;
import com.docus.infrastructure.web.api.CommonResult;
import com.docus.server.archive.rpc.dto.ReportDownTwoDto;
/**
*
*
* @author wyb
*/
public interface TaskDistributeService {
/**
* -
*
* @param collectorId
* @return
*/
CommonResult<ReportDownTwoDto> getNoViewTaskByCollectorId(String collectorId);
CommonResult<String> cancel(Long taskId);
}

@ -0,0 +1,37 @@
package com.docus.server.archive.rpc.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*
* @author WYBDEV
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
@ApiModel(value = "患者信息")
public class PatientInfoDTO {
@ApiModelProperty(value = "病案主键")
private String patientId;
@ApiModelProperty(value = "住院号")
private String inpatientNo;
@ApiModelProperty(value = "住院次数")
private Integer admissTimes;
@ApiModelProperty(value = "入院日期 yyyy-MM-dd HH:mm:ss")
private String admissDate;
@ApiModelProperty(value = "入院科室名称")
private String admissDeptName;
@ApiModelProperty(value = "出院日期 yyyy-MM-dd HH:mm:ss")
private String disDate;
@ApiModelProperty(value = "出院科室名称")
private String disDeptName;
@ApiModelProperty(value = "记账号")
private String jzh;
@ApiModelProperty(value = "姓名")
private String name;
@ApiModelProperty(value = "住院id")
private String admissId;
}

@ -0,0 +1,30 @@
package com.docus.server.archive.rpc.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class ReportDownDto {
@ApiModelProperty(value = "采集器id")
private String collectorid;
@ApiModelProperty(value = "采集器ip")
private String ip;
@ApiModelProperty(value = "分类id")
private String assortid;
@ApiModelProperty(value = "患者信息")
private ReportDownPatientDto patient;
@ApiModelProperty(value = "文件信息")
private List<ReportDownScanFileDto> scanfiles;
@ApiModelProperty(value = "扫描用户代码")
private String scanusercode;
@ApiModelProperty(value = "扫描用户名称")
private String scanusername;
}

@ -0,0 +1,19 @@
package com.docus.server.archive.rpc.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ReportDownPatientDto {
@ApiModelProperty(value = "记帐号")
private String jzh;
@ApiModelProperty(value = "住院次数,记帐号重复则加这个参数无则Null")
private Integer admisstimes;
@ApiModelProperty(value = "病案主键如有传则使用无则使用jzh")
private String patientid;
@ApiModelProperty(value = "病案号")
private String inpatientno;
@ApiModelProperty(value = "物理存储位置,有则传")
private String storagelocation;
}

@ -0,0 +1,32 @@
package com.docus.server.archive.rpc.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ReportDownScanFileDto {
@ApiModelProperty(value = "任务id(如无效任务id则不更新任务表数据)")
private Long taskid;
@ApiModelProperty(value = "文件标题")
private String filetitle;
@ApiModelProperty(value = "采集类型(文件来源 1:采集器2扫描生产软件)")
private int filesource;
@ApiModelProperty(value = "下载类型(1:服务器本地2ftp服务器3共享文件夹)")
private int filestoragetype;
@ApiModelProperty(value = "文件类型(1:url,2:base64,3:url base64,4:共享文件5本地文件base64)")
private int filetype=1;
@ApiModelProperty(value = "下载地址")
private String downurl;
// @ApiModelProperty(value = "档案信息")
// private String recordid;
@ApiModelProperty(value = "采集流水号")
private String serialnum;
@ApiModelProperty(value = "排序日期")
private String sortdate;
@ApiModelProperty(value = "是否作废 0否 不作废1是 作废")
private int cancel=0;
}

@ -0,0 +1,29 @@
package com.docus.server.archive.rpc.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class ReportDownTwoDto {
@ApiModelProperty(value = "档案编号")
private String patientId;
@ApiModelProperty(value = "记账号")
private String jzh;
@ApiModelProperty(value = "档案类型")
private String recordType;
@ApiModelProperty(value = "档案时间")
private String createTime;
@ApiModelProperty(value = "患者信息")
private ReportPatientTwoDto patient =new ReportPatientTwoDto();
@ApiModelProperty(value = "住院信息")
private List<ReportHospitalTwoDto> hospitals = new ArrayList<>();
@ApiModelProperty(value = "任务信息")
private List<ReportTaskTwoDto> tasks = new ArrayList<>();
@ApiModelProperty(value = "母亲基础信息")
private PatientInfoDTO parent;
}

@ -0,0 +1,97 @@
package com.docus.server.archive.rpc.dto;
import lombok.Data;
/**
*
*/
@Data
public class ReportDto {
/**
*
*/
private String inpatientNo;
/**
* /
*/
private String jzh;
/**
*
*/
private Integer admisstimes;
/**
*
*/
private String sysFlag;
/**
*
*/
private String downUrl;
/**
*
*/
private String fileTitle;
/**
* /id
*/
private String serialnum;
/**
* id
*/
private String assortId;
/**
* ( 1:2)
*/
private String fileSource;
/**
* 1:2ftp3
*/
private String filestoragetype;
/**
* id ,
*/
private Long taskId;
/**
*
*/
private String patientId;
/**
* 1:url2:base643:url base644:5base64
*/
private Integer downtype = 1;
/**
* id12+
*
*/
private String visitSn;
/**
* id
*/
private String patientSn;
/**
*
*/
private String reportSn;
/**
*
*/
private boolean mergeFileTitle;
public ReportDto() {
}
}

@ -0,0 +1,27 @@
package com.docus.server.archive.rpc.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
public class ReportHospitalTwoDto {
@ApiModelProperty(value = "患者id")
private String patientId;
@ApiModelProperty(value = "住院次数")
private Integer admissTimes;
@ApiModelProperty(value = "住院日期")
private String admissDate;
@ApiModelProperty(value = "出院日期")
private String disDate;
@ApiModelProperty(value = "出院科室名称")
private String disDeptName;
@ApiModelProperty(value = "出院科室名称")
private String admissDeptName;
@ApiModelProperty(value = "卡号")
private String admissId;
}

@ -0,0 +1,18 @@
package com.docus.server.archive.rpc.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
public class ReportPatientTwoDto {
@ApiModelProperty(value = "住院号/就诊号")
private String inpatientNo;
@ApiModelProperty(value = "患者姓名")
private String name;
@ApiModelProperty(value = "id号")
private String patientId;
}

@ -0,0 +1,19 @@
package com.docus.server.archive.rpc.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*/
@Data
public class ReportTaskTwoDto {
@ApiModelProperty(value = "采集器标识")
private String collectorId;
@ApiModelProperty(value = "任务id")
private Long taskId;
@ApiModelProperty(value = "患者id")
private String patientId;
}

@ -0,0 +1,49 @@
package com.docus.server.archive.rpc.impl;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.docus.core.util.Func;
import com.docus.infrastructure.web.api.CommonResult;
import com.docus.server.archive.config.DocusServerUrlConfig;
import com.docus.server.archive.rpc.DownPlatformService;
import com.docus.server.archive.rpc.dto.ReportDownDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
*
*
* @author jiashi
*/
@Component
@Slf4j
public class DownPlatformServiceImpl implements DownPlatformService {
@Resource
private DocusServerUrlConfig serverUrlConfig;
@Override
public CommonResult report(ReportDownDto reportDownDto) {
String downUrl = serverUrlConfig.getDownloadPlatformServerUrl() + "api/downplatform/report";
String requestId = Func.randomUUID();
String requestParam = Func.toJson(reportDownDto);
log.info("[{}]调用下载服务,地址:{} ,参数:{}", requestId, downUrl, requestParam);
String respBody = post(downUrl, requestParam);
log.info("[{}]调用下载服务成功,响应参数:{}", requestId, respBody);
return Func.readJson(respBody, CommonResult.class);
}
public String post(String url, String body) {
HttpRequest post = HttpUtil.createPost(url);
post.setConnectionTimeout(5 * 1000);
post.setReadTimeout(60 * 1000);
post.header("Content-Type", "application/json; charset=utf-8");
post.body(body);
HttpResponse response = post.execute();
return response.body();
}
}

@ -0,0 +1,48 @@
package com.docus.server.archive.rpc.impl;
import cn.hutool.http.HttpUtil;
import com.docus.core.util.Func;
import com.docus.infrastructure.web.api.CommonResult;
import com.docus.server.archive.config.DocusServerUrlConfig;
import com.docus.server.archive.rpc.TaskDistributeService;
import com.docus.server.archive.rpc.dto.ReportDownTwoDto;
import com.fasterxml.jackson.core.type.TypeReference;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
/**
*
*
* @author wyb
*/
@Component
@Slf4j
public class TaskDistributeServiceImpl implements TaskDistributeService {
@Resource
private DocusServerUrlConfig serverUrlConfig;
@Override
public CommonResult<ReportDownTwoDto> getNoViewTaskByCollectorId(String collectorId) {
String getTaskUrl = serverUrlConfig.getTaskDistributeServerUrl() + "api/noviewtask/GetTask?collectid=" + collectorId;
String result = HttpUtil.get(getTaskUrl);
return Func.readJson(result, new TypeReference<CommonResult<ReportDownTwoDto>>() {
});
}
@Override
public CommonResult<String> cancel(Long taskId) {
String taskCancelUrl = serverUrlConfig.getTaskDistributeServerUrl() + "api/collector/task/cancel";
Map<String, Object> param = new HashMap<>(1);
param.put("taskId", taskId);
log.info("任务作废 地址{},参数:{}", taskCancelUrl, param);
String resp = HttpUtil.post(taskCancelUrl, Func.toJson(param));
log.info("任务作废结果:{}", resp);
return Func.readJson(resp, new TypeReference<CommonResult<String>>() {
});
}
}

@ -0,0 +1,29 @@
package com.docus.server.archive.rpc.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @BelongsProject: docus_medicalrecord_starter
* @BelongsPackage: com.docus.services.clinicqualitycontrol.dto
* @Author: jiashi
* @CreateTime: 2023-08-21 09:07
* @Description: TODO
* @Version: 1.0
*/
@Data
@ApiModel("自动质控请求参数")
public class CqcAuditRequest {
@ApiModelProperty(value = "病案主键")
private String patientId;
@ApiModelProperty(value = "类型 1护士质控2护士质控员质控")
private String type;
@ApiModelProperty(value = "操作人工号")
private String userName;
@ApiModelProperty(value = "操作人姓名")
private String name;
}

@ -0,0 +1,27 @@
package com.docus.server.archive.rpc.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*
* @author WYBDEV
*/
@Data
@ApiModel("顺德人医血液报告单查询结果")
public class SdRyBloodReportVO {
@ApiModelProperty("文件id")
private String fileId;
@ApiModelProperty("住院号")
private String inpatientNo;
@ApiModelProperty("住院次数")
private Integer admissions;
@ApiModelProperty("保存文件名")
private String fileName;
@ApiModelProperty("文件描述标题")
private String fileDesc;
@ApiModelProperty("文件下载地址")
private String fileUrl;
}

@ -0,0 +1,69 @@
package com.docus.server.archive.utils;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.xml.namespace.QName;
import java.util.Arrays;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* 使JaxWsDynamicClientFactory webservice
*
* @author wyb
*/
public class JaxWsDynamicClientUtil {
private static final JaxWsDynamicClientFactory CLIENT_FACTORY = JaxWsDynamicClientFactory.newInstance();
private static final Map<String, Client> CLIENT_MAP = new ConcurrentHashMap<>();
private static final Logger logger = LoggerFactory.getLogger(JaxWsDynamicClientUtil.class);
public static String send(String wsdlUrl, String namespaceUri, String operationName, Object[] params) {
logger.info("wsdlUrl" + wsdlUrl + " ,namespaceUri: " + namespaceUri + " operationName" + operationName + "param:" + Arrays.toString(params));
try {
Client client = getClient(wsdlUrl);
Object[] result;
if (namespaceUri == null || namespaceUri.isEmpty()) {
result = client.invoke(operationName, params);
} else {
QName qName = new QName(namespaceUri, operationName);
result = client.invoke(qName, params);
}
logger.error("wsdlUrl" + wsdlUrl + ",namespaceUri: " + namespaceUri + " operationName" + operationName + "param:" + Arrays.toString(params) + " 调用成功_"+result);
if (result == null || result[0] == null) {
return null;
}
return String.valueOf(result[0]);
} catch (Exception ex) {
logger.error("wsdlUrl" + wsdlUrl + ",namespaceUri: " + namespaceUri + " operationName" + operationName + "param:" + Arrays.toString(params) + " 调用失败了_"+ex.getMessage(), ex);
return null;
}
}
public static Client getClient(String wsdlUrl) {
if (CLIENT_MAP.get(wsdlUrl) == null) {
synchronized (JaxWsDynamicClientUtil.class) {
if (CLIENT_MAP.get(wsdlUrl) == null) {
Client client = CLIENT_FACTORY.createClient(wsdlUrl);
setClientParam(client);
CLIENT_MAP.put(wsdlUrl, client);
}
}
}
return CLIENT_MAP.get(wsdlUrl);
}
private static void setClientParam(Client client) {
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(30 * 1000);
httpClientPolicy.setAllowChunking(false);
httpClientPolicy.setReceiveTimeout(30 * 1000);
HTTPConduit clientConduit = (HTTPConduit) client.getConduit();
clientConduit.setClient(httpClientPolicy);
}
}

@ -0,0 +1,857 @@
/*
* Copyright (c) 2018-2028, DreamLu All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: DreamLu (596392912@qq.com)
*/
package com.docus.server.archive.utils;
import com.docus.core.util.Exceptions;
import com.docus.core.util.IoUtil;
import org.springframework.lang.Nullable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.util.HashMap;
import java.util.Map;
/**
* xpathxml
*
* <pre>
*
* http://www.w3school.com.cn/xpath/index.asp
* </pre>
*
* @author L.cm
*/
public class XmlUtil {
private final XPath path;
private final Document doc;
private XmlUtil(InputSource inputSource) throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory dbf = getDocumentBuilderFactory();
DocumentBuilder db = dbf.newDocumentBuilder();
doc = db.parse(inputSource);
path = getXPathFactory().newXPath();
}
/**
*
*
* @param inputSource inputSource
* @return XmlUtil
*/
private static XmlUtil create(InputSource inputSource) {
try {
return new XmlUtil(inputSource);
} catch (ParserConfigurationException | SAXException | IOException e) {
throw Exceptions.unchecked(e);
}
}
/**
*
*
* @param inputStream inputStream
* @return XmlUtil
*/
public static XmlUtil of(InputStream inputStream) {
InputSource inputSource = new InputSource(inputStream);
return create(inputSource);
}
/**
*
*
* @param xmlStr xmlStr
* @return XmlUtil
*/
public static XmlUtil of(String xmlStr) {
StringReader sr = new StringReader(xmlStr.trim());
InputSource inputSource = new InputSource(sr);
XmlUtil xmlUtil = create(inputSource);
IoUtil.closeQuietly(sr);
return xmlUtil;
}
/**
*
*
* @param expression
* @param item
* @param returnType
* @return Object
*/
private Object evalXPath(String expression, @Nullable Object item, QName returnType) {
item = null == item ? doc : item;
try {
return path.evaluate(expression, item, returnType);
} catch (XPathExpressionException e) {
throw Exceptions.unchecked(e);
}
}
/**
* String
*
* @param expression
* @return {String}
*/
public String getString(String expression) {
return (String) evalXPath(expression, null, XPathConstants.STRING);
}
/**
* Boolean
*
* @param expression
* @return {String}
*/
public Boolean getBoolean(String expression) {
return (Boolean) evalXPath(expression, null, XPathConstants.BOOLEAN);
}
/**
* Number
*
* @param expression
* @return {Number}
*/
public Number getNumber(String expression) {
return (Number) evalXPath(expression, null, XPathConstants.NUMBER);
}
/**
*
*
* @param expression
* @return {Node}
*/
public Node getNode(String expression) {
return (Node) evalXPath(expression, null, XPathConstants.NODE);
}
/**
*
*
* @param expression
* @return NodeList
*/
public NodeList getNodeList(String expression) {
return (NodeList) evalXPath(expression, null, XPathConstants.NODESET);
}
/**
* String
*
* @param node
* @param expression node
* @return {String}
*/
public String getString(Object node, String expression) {
return (String) evalXPath(expression, node, XPathConstants.STRING);
}
/**
*
*
* @param node
* @param expression node
* @return {String}
*/
public Boolean getBoolean(Object node, String expression) {
return (Boolean) evalXPath(expression, node, XPathConstants.BOOLEAN);
}
/**
*
*
* @param node
* @param expression node
* @return {Number}
*/
public Number getNumber(Object node, String expression) {
return (Number) evalXPath(expression, node, XPathConstants.NUMBER);
}
/**
*
*
* @param node
* @param expression
* @return {Node}
*/
public Node getNode(Object node, String expression) {
return (Node) evalXPath(expression, node, XPathConstants.NODE);
}
/**
*
*
* @param node
* @param expression node
* @return NodeList
*/
public NodeList getNodeList(Object node, String expression) {
return (NodeList) evalXPath(expression, node, XPathConstants.NODESET);
}
/**
*
*
* @return map
*/
public Map<String, String> toMap() {
Element root = doc.getDocumentElement();
Map<String, String> params = new HashMap<>(16);
// 将节点封装成map形式
NodeList list = root.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
Node node = list.item(i);
if (node instanceof Element) {
params.put(node.getNodeName(), node.getTextContent());
}
}
return params;
}
private static volatile boolean preventedXXE = false;
private static DocumentBuilderFactory getDocumentBuilderFactory() throws ParserConfigurationException {
DocumentBuilderFactory dbf = XmlHelperHolder.documentBuilderFactory;
if (!preventedXXE) {
synchronized (XmlUtil.class) {
if (!preventedXXE) {
preventXXE(dbf);
}
}
}
return dbf;
}
/**
* preventXXE
*
* @param dbf
* @throws ParserConfigurationException
*/
private static void preventXXE(DocumentBuilderFactory dbf) throws ParserConfigurationException {
// This is the PRIMARY defense. If DTDs (doctypes) are disallowed, almost all XML entity attacks are prevented
// Xerces 2 only - http://xerces.apache.org/xerces2-j/features.html#disallow-doctype-decl
dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
// If you can't completely disable DTDs, then at least do the following:
// Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-general-entities
// Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-general-entities
// JDK7+ - http://xml.org/sax/features/external-general-entities
dbf.setFeature("http://xml.org/sax/features/external-general-entities", false);
// Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-parameter-entities
// Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-parameter-entities
// JDK7+ - http://xml.org/sax/features/external-parameter-entities
dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
// Disable external DTDs as well
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
// and these as well, per Timothy Morgan's 2014 paper: "XML Schema, DTD, and Entity Attacks"
dbf.setXIncludeAware(false);
dbf.setExpandEntityReferences(false);
preventedXXE = true;
}
private static XPathFactory getXPathFactory() {
return XmlHelperHolder.xPathFactory;
}
/**
*
*/
private static class XmlHelperHolder {
private static DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
private static XPathFactory xPathFactory = XPathFactory.newInstance();
}
private static String str;
static {
str="<PRPA_HIP0032 xmlns=\"urn:hl7-org:v3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ITSVersion=\"XML_1.0\" xsi:schemaLocation=\"urn:hl7-org:v3\"> \n" +
" <!--id-消息流水号--> \n" +
" <id extension=\"0f7e4a58-7ce3-436d-8d1b-aee3734e390b\"/> \n" +
" <!--creationTime-消息创建时间--> \n" +
" <creationTime value=\"20230217112826\"/> \n" +
" <!--interactionId-消息的服务标识--> \n" +
" <interactionId root=\"2.16.840.1.113883.1.6\" extension=\"PRPA_IN400003UV\"/> \n" +
" <!--processingCode-处理代码。标识此消息是否是产品、训练、调试系统的一部分。D调试P产\n" +
"品T训练--> \n" +
" <processingCode code=\"P\"/> \n" +
" <!--\n" +
"processingModeCode-处理模型代码。定义此消息是一个文档处理还是一个初始装载的一部分。A\n" +
"存档I初始装载R从存档中恢复T当前处理间隔传递。\n" +
"--> \n" +
" <processingModeCode/> \n" +
" <!--\n" +
"acceptAckCode-接收确认类型 AL总是确认NE从不确认ER仅在错误/或拒绝时确认SU 仅在成功完成时确认。\n" +
"--> \n" +
" <acceptAckCode code=\"AL\"/> \n" +
" <receiver typeCode=\"RCV\"> \n" +
" <device classCode=\"DEV\" determinerCode=\"INSTANCE\"> \n" +
" <id> \n" +
" <item extension=\"Orion-001\"/> \n" +
" </id> \n" +
" </device> \n" +
" </receiver> \n" +
" <sender typeCode=\"SND\"> \n" +
" <device classCode=\"DEV\" determinerCode=\"INSTANCE\"> \n" +
" <id> \n" +
" <item extension=\"InpatienTransfer-001\"/> \n" +
" </id> \n" +
" </device> \n" +
" </sender> \n" +
" <controlActProcess classCode=\"INFO\" moodCode=\"PRP\"> \n" +
" <code code=\"DischargeInfoAdd\"> \n" +
" <displayName value=\"出院登记信息新增\"/> \n" +
" </code> \n" +
" <subject typeCode=\"SUBJ\"> \n" +
" <encounterEvent classCode=\"ENC\" moodCode=\"EVN\"> \n" +
" <id> \n" +
" <!--住院号标识 --> \n" +
" <item root=\"2.16.156.10011.1.12\" extension=\"10082654\"/> \n" +
" </id> \n" +
" <!--住院流水号--> \n" +
" <item root=\"1.2.156.10011.1.2.1.6\" extension=\"213080\"/> \n" +
" <!--就诊事件类别代码--> \n" +
" <code code=\"3\" codeSystem=\"2.16.156.10011.2.3.1.271\" codeSystemName=\"患者类型代码表\"> \n" +
" <displayName value=\"住院\"/> \n" +
" </code> \n" +
" <statusCode/> \n" +
" <!--入\\出院日期时间--> \n" +
" <effectiveTime> \n" +
" <low value=\"20230214100923\"/> \n" +
" <high value=\"20230217160046\"/> \n" +
" </effectiveTime> \n" +
" <!--住院天数--> \n" +
" <lengthOfStayQuantity unit=\"天\" value=\"3\"/> \n" +
" <!--住院次数--> \n" +
" <lengthOfStayQuantity unit=\"次\" value=\"1\"/> \n" +
" <!--患者--> \n" +
" <subject typeCode=\"SBJ\"> \n" +
" <patient classCode=\"PAT\"> \n" +
" <!-- 域ID --> \n" +
" <id root=\"1.2.156.112635.1.2.1.2\" extension=\"03\"/> \n" +
" <id> \n" +
" <!--PatientID--> \n" +
" <item extension=\"z002082795000\"/> \n" +
" </id> \n" +
" <!--患者基本信息--> \n" +
" <patientPerson> \n" +
" <!--患者身份证号--> \n" +
" <id> \n" +
" <item root=\"2.16.156.10011.1.3\" extension=\"450881200609066029\"/> \n" +
" </id> \n" +
" <administrativeGenderCode code=\"2\" codeSystem=\"1.2.156.112635.1.1.3\" codeSystemName=\"生理性别代码表GB/T 2261.1\" displayName=\"女性\"/> \n" +
" <!--年龄(岁)/(月)--> \n" +
" <age unit=\"岁\" value=\"16岁\"/> \n" +
" <!--姓名--> \n" +
" <name xsi:type=\"DSET_EN\"> \n" +
" <item> \n" +
" <part value=\"谢雨欣\"/> \n" +
" </item> \n" +
" </name> \n" +
" </patientPerson> \n" +
" </patient> \n" +
" </subject> \n" +
" <!--登记人--> \n" +
" <discharger typeCode=\"DIS\"> \n" +
" <time>20230217112653</time> \n" +
" <assignedPerson classCode=\"ASSIGNED\"> \n" +
" <!--登记人职工号--> \n" +
" <id> \n" +
" <item root=\"2.16.156.10011.1.4\" extension=\"A-166\"/> \n" +
" </id> \n" +
" <assignedPerson classCode=\"PSN\" determinerCode=\"INSTANCE\"> \n" +
" <!--登记人姓名 --> \n" +
" <name xsi:type=\"DSET_EN\"> \n" +
" <item> \n" +
" <part value=\"潘丽华\"/> \n" +
" </item> \n" +
" </name> \n" +
" </assignedPerson> \n" +
" </assignedPerson> \n" +
" </discharger> \n" +
" <!-- 主任医师签名 --> \n" +
" <authenticator displayName=\"主任医师\"> \n" +
" <!--记录时间--> \n" +
" <time value=\"\"/> \n" +
" <signatureCode/> \n" +
" <assignedEntity> \n" +
" <id root=\"1.2.156.112635.1.1.2\" extension=\"1-173\"/> \n" +
" <code displayName=\"主任医师\"/> \n" +
" <assignedPerson classCode=\"PSN\" determinerCode=\"INSTANCE\"> \n" +
" <name>陈勇明</name> \n" +
" </assignedPerson> \n" +
" </assignedEntity> \n" +
" </authenticator> \n" +
" <!-- 主治医师签名 --> \n" +
" <authenticator displayName=\"主治医师\"> \n" +
" <time value=\"\"/> \n" +
" <signatureCode/> \n" +
" <assignedEntity> \n" +
" <id root=\"1.2.156.112635.1.1.2\" extension=\"1-691\"/> \n" +
" <code displayName=\"主治医师\"/> \n" +
" <assignedPerson classCode=\"PSN\" determinerCode=\"INSTANCE\"> \n" +
" <name>张存良</name> \n" +
" </assignedPerson> \n" +
" </assignedEntity> \n" +
" </authenticator> \n" +
" <!-- 住院医师签名 --> \n" +
" <authenticator displayName=\"住院医师\"> \n" +
" <time value=\"\"/> \n" +
" <signatureCode/> \n" +
" <assignedEntity> \n" +
" <id root=\"1.2.156.112635.1.1.2\" extension=\"1-691\"/> \n" +
" <code displayName=\"住院医师\"/> \n" +
" <assignedPerson classCode=\"PSN\" determinerCode=\"INSTANCE\"> \n" +
" <name>张存良</name> \n" +
" </assignedPerson> \n" +
" </assignedEntity> \n" +
" </authenticator> \n" +
" <!-- 出院病床号、病房、病区、科室和医院的关联 --> \n" +
" <componentOf> \n" +
" <encompassingEncounter> \n" +
" <effectiveTime/> \n" +
" <location> \n" +
" <healthCareFacility> \n" +
" <serviceProviderOrganization> \n" +
" <asOrganizationPartOf classCode=\"PART\"> \n" +
" <!-- DE01.00.026.00 病床号 --> \n" +
" <wholeOrganization classCode=\"ORG\" determinerCode=\"INSTANCE\"> \n" +
" <id root=\"1.2.156.112635.1.2.1.8\" extension=\"59\"/> \n" +
" <name>59</name> \n" +
" <!-- DE01.00.019.00 病房号 --> \n" +
" <asOrganizationPartOf classCode=\"PART\"> \n" +
" <wholeOrganization classCode=\"ORG\" determinerCode=\"INSTANCE\"> \n" +
" <id root=\"1.2.156.112635.1.2.1.28\" extension=\"001\"/> \n" +
" <name>205室</name> \n" +
" <!-- DE08.10.026.00 科室名称 --> \n" +
" <asOrganizationPartOf classCode=\"PART\"> \n" +
" <wholeOrganization classCode=\"ORG\" determinerCode=\"INSTANCE\"> \n" +
" <id root=\"1.2.156.112635.1.1.1\" extension=\"11\"/> \n" +
" <name>耳鼻咽喉头颈外科</name> \n" +
" <!-- DE08.10.054.00 病区名称 --> \n" +
" <asOrganizationPartOf classCode=\"PART\"> \n" +
" <wholeOrganization classCode=\"ORG\" determinerCode=\"INSTANCE\"> \n" +
" <id root=\"1.2.156.112635.1.1.33\" extension=\"B021601\"/> \n" +
" <name>2号楼16楼西区</name> \n" +
" <!--XXX医院 --> \n" +
" <asOrganizationPartOf classCode=\"PART\"> \n" +
" <wholeOrganization classCode=\"ORG\" determinerCode=\"INSTANCE\"> \n" +
" <id root=\"1.2.156.112635\" extension=\"4560886379\"/> \n" +
" <name>南方医科大学顺德医院</name> \n" +
" </wholeOrganization> \n" +
" </asOrganizationPartOf> \n" +
" </wholeOrganization> \n" +
" </asOrganizationPartOf> \n" +
" </wholeOrganization> \n" +
" </asOrganizationPartOf> \n" +
" </wholeOrganization> \n" +
" </asOrganizationPartOf> \n" +
" </wholeOrganization> \n" +
" </asOrganizationPartOf> \n" +
" </serviceProviderOrganization> \n" +
" </healthCareFacility> \n" +
" </location> \n" +
" </encompassingEncounter> \n" +
" </componentOf> \n" +
" <!-- 入院诊断章节 --> \n" +
" <component displayName=\"入院诊断\"> \n" +
" <section> \n" +
" <code code=\"11450-4\" displayName=\"PROBLEM LIST\" codeSystem=\"2.16.840.1.113883.6.1\" codeSystemName=\"LOINC\"/> \n" +
" <text/> \n" +
" <!--入院诊断-西医条目--> \n" +
" <entry displayName=\"入院诊断-西医条目\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE05.01.025.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"入院诊断-西医诊断名称\"/> \n" +
" <!--入院诊断日期--> \n" +
" <effectiveTime value=\"20230214100923\"/> \n" +
" <value xsi:type=\"ST\">突发特发性听觉丧失</value> \n" +
" <entryRelationship typeCode=\"COMP\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <!--入院诊断-西医诊断编码-代码--> \n" +
" <code code=\"DE05.01.024.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"入院诊断-西医诊断编码\"/> \n" +
" <value xsi:type=\"CD\" code=\"\" displayName=\"\" codeSystem=\"2.16.156.10011.2.3.3.11\" codeSystemName=\"ICD-10\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" </observation> \n" +
" </entry> \n" +
" <!--入院诊断-中医条目--> \n" +
" <entry displayName=\"入院诊断-中医条目\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE05.10.172.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"入院诊断-中医病名名称\"/> \n" +
" <!--入院诊断日期--> \n" +
" <effectiveTime value=\"20230214100923\"/> \n" +
" <value xsi:type=\"ST\">无</value> \n" +
" <entryRelationship typeCode=\"COMP\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <!--入院诊断-中医诊断编码-代码--> \n" +
" <code code=\"\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"入院诊断-中医病名代码\"/> \n" +
" <value xsi:type=\"CD\" code=\"\" displayName=\"\" codeSystem=\"2.16.156.10011.2.3.3.14\" codeSystemName=\"中医病证分类与代码表( GB/T 15657)\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <entryRelationship typeCode=\"COMP\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <!--入院诊断-中医证候编码-名称--> \n" +
" <code code=\"\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"入院诊断-中医证候名称\"/> \n" +
" <value xsi:type=\"ST\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <entryRelationship typeCode=\"COMP\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <!--入院诊断-中医证候编码-代码--> \n" +
" <code code=\"DE05.10.130.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"入院诊断-中医证候代码\"/> \n" +
" <value xsi:type=\"CD\" code=\"\" displayName=\"\" codeSystem=\"2.16.156.10011.2.3.3.14\" codeSystemName=\"中医病证分类与代码表( GB/T 15657)\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <!--入院诊断顺位--> \n" +
" <entryRelationship typeCode=\"COMP\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE05.01.080.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"入院诊断顺位\"/> \n" +
" <value xsi:type=\"INT\" value=\"1\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" </observation> \n" +
" </entry> \n" +
" <entry displayName=\"阳性辅助检查\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE04.50.128.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"阳性辅助检查结果\"/> \n" +
" <value xsi:type=\"ST\"/> \n" +
" </observation> \n" +
" </entry> \n" +
" <entry displayName=\"中医“四诊”观察\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE02.10.028.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"中医“四诊”观察结果\"/> \n" +
" <value xsi:type=\"ST\"/> \n" +
" </observation> \n" +
" </entry> \n" +
" <entry displayName=\"治则治法\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE06.00.300.00\" displayName=\"治则治法\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\"/> \n" +
" <value xsi:type=\"ST\"/> \n" +
" </observation> \n" +
" </entry> \n" +
" </section> \n" +
" </component> \n" +
" <!-- 主要健康问题章节 --> \n" +
" <component displayName=\"主要健康问题\"> \n" +
" <section> \n" +
" <code code=\"11450-4\" displayName=\"Problem list\" codeSystem=\"2.16.840.1.113883.6.1\" codeSystemName=\"LOINC\"/> \n" +
" <text/> \n" +
" <entry> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE05.10.148.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"入院情况\"/> \n" +
" <value xsi:type=\"ST\">常规</value> \n" +
" </observation> \n" +
" </entry> \n" +
" </section> \n" +
" </component> \n" +
" <!-- 住院过程章节 --> \n" +
" <component displayName=\"住院过程\"> \n" +
" <section> \n" +
" <code code=\"8648-8\" displayName=\"Hospital Course\" codeSystem=\"2.16.840.1.113883.6.1\" codeSystemName=\"LOINC\"/> \n" +
" <text/> \n" +
" <entry> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE06.00.296.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"诊疗过程描述\"/> \n" +
" <value xsi:type=\"ST\"/> \n" +
" </observation> \n" +
" </entry> \n" +
" </section> \n" +
" </component> \n" +
" <!-- 医嘱(用药)章节 --> \n" +
" <component displayName=\"医嘱(用药)\"> \n" +
" <section> \n" +
" <code code=\"46209-3\" codeSystem=\"2.16.840.1.113883.6.1\" displayName=\"Provider Orders\" codeSystemName=\"LOINC\"/> \n" +
" <text/> \n" +
" <entry displayName=\"中药用药方法煎煮方法\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE08.50.047.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"中药用药方法煎煮方法\"/> \n" +
" <value xsi:type=\"ST\"/> \n" +
" </observation> \n" +
" </entry> \n" +
" <entry displayName=\"中药用药方法\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE06.00.136.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"中药用药方法\"/> \n" +
" <value xsi:type=\"ST\"/> \n" +
" </observation> \n" +
" </entry> \n" +
" </section> \n" +
" </component> \n" +
" <!-- 出院诊断章节 --> \n" +
" <component displayName=\"出院诊断\"> \n" +
" <section> \n" +
" <code code=\"11535-2\" displayName=\"Discharge Diagnosis\" codeSystem=\"2.16.840.1.113883.6.1\" codeSystemName=\"LOINC\"/> \n" +
" <text/> \n" +
" <entry displayName=\"出院情况\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE06.00.193.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"出院情况\"/> \n" +
" <value xsi:type=\"ST\">治愈</value> \n" +
" </observation> \n" +
" </entry> \n" +
" <entry displayName=\"出院日期时间\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE06.00.017.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"出院日期时间\"/> \n" +
" <value xsi:type=\"TS\" value=\"20230217160046\"/> \n" +
" </observation> \n" +
" </entry> \n" +
" <!--出院诊断-西医条目--> \n" +
" <entry displayName=\"出院诊断-西医条目\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE05.01.025.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"西医诊断名称\"/> \n" +
" <!--出院诊断日期--> \n" +
" <effectiveTime value=\"20230217160046\"/> \n" +
" <!-- 诊断医师信息 --> \n" +
" <performer typeCode=\"PRF \"> \n" +
" <assignedEntity> \n" +
" <!-- 诊断医生编码 --> \n" +
" <id root=\"1.2.156.112635.1.1.2\" extension=\"1-691\"/> \n" +
" <assignedPerson determinerCode=\"INSTANCE\" classCode=\"PSN\"> \n" +
" <!-- 诊断医生名称 --> \n" +
" <name>张存良</name> \n" +
" </assignedPerson> \n" +
" <representedOrganization classCode=\"ORG\" determinerCode=\"INSTANCE\"> \n" +
" <!-- 诊断科室编码 --> \n" +
" <id root=\"1.2.156.112635.1.1.1\" extension=\"11\"/> \n" +
" <!-- 诊断科室名称 --> \n" +
" <name>耳鼻咽喉头颈外科</name> \n" +
" </representedOrganization> \n" +
" </assignedEntity> \n" +
" </performer> \n" +
" <!--诊断类别 --> \n" +
" <code code=\"H91.200\" codeSystem=\"1.2.156.112635.1.1.29\"> \n" +
" <displayName value=\"出院诊断\">突发特发性听觉丧失</displayName> \n" +
" </code> \n" +
" <!-- 诊断依据 --> \n" +
" <entryRelationship displayName=\"诊断依据\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE05.01.070.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录 \" displayName=\"诊断依据代码\"/> \n" +
" <value xsi:type=\"ST\" code=\"XXX\">文本</value> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <entryRelationship displayName=\"是否主要诊断\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code displayName=\"是否主要诊断\"/> \n" +
" <value xsi:type=\"BL\" value=\"false\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <entryRelationship displayName=\"是否待查\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code displayName=\"是否待查\"/> \n" +
" <value xsi:type=\"BL\" value=\"false\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <entryRelationship displayName=\"是否传染病\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code displayName=\"是否传染病\"/> \n" +
" <value xsi:type=\"BL\" value=\"false\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <!-- 诊断标识号 --> \n" +
" <diagnosisNum value=\"诊断标识号\"/> \n" +
" <value xsi:type=\"ST\"/> \n" +
" <entryRelationship typeCode=\"COMP\" displayName=\"出院诊断-西医诊断\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <!--出院诊断-西医诊断编码-代码--> \n" +
" <code code=\"DE05.01.024.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"出院诊断-西医诊断编码\"/> \n" +
" <value xsi:type=\"CD\" code=\"\" displayName=\"\" codeSystem=\"2.16.156.10011.2.3.3.11\" codeSystemName=\"ICD-10\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <entryRelationship displayName=\"其他西医诊断\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE05.01.024.00\" displayName=\"其他西医诊断编码\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\"> \n" +
" <qualifier> \n" +
" <name displayName=\"其他西医诊断编码\"/> \n" +
" </qualifier> \n" +
" </code> \n" +
" <value xsi:type=\"CD\" code=\"\" displayName=\"\" codeSystem=\"2.16.156.10011.2.3.3.11\" codeSystemName=\"ICD-10\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <!--出院诊断顺位--> \n" +
" <entryRelationship typeCode=\"COMP\" displayName=\"出院诊断顺位\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE05.01.080.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"出院诊断顺位\"/> \n" +
" <value xsi:type=\"INT\" value=\"01\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <!--其他医学处置--> \n" +
" <entryRelationship typeCode=\"COMP\" displayName=\"其他医学处置\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE06.00.251.00\" displayName=\"其他医学处置\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\"/> \n" +
" <value xsi:type=\"ST\">无</value> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" </observation> \n" +
" </entry> \n" +
" <!--出院诊断-中医条目--> \n" +
" <entry displayName=\"出院诊断-中医条目\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE05.10.172.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"出院诊断-中医病名代码\"/> \n" +
" <!--出院诊断日期--> \n" +
" <effectiveTime value=\"20230217160046\"/> \n" +
" <!--中药使用类别--> \n" +
" <entryRelationship typeCode=\"COMP\" displayName=\"中药使用类别\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE06.00.164.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"中药使用类别代码\"/> \n" +
" <!--中药使用类别代码--> \n" +
" <value code=\"9\" displayName=\"其他中药\" codeSystem=\"2.16.156.10011.2.3.1.157\" codeSystemName=\"中药使用类别代码表\" xsi:type=\"CD\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <value xsi:type=\"ST\">乳房病类</value> \n" +
" <entryRelationship typeCode=\"COMP\" displayName=\"出院诊断-中医病名\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <!--出院诊断-中医诊断编码-代码--> \n" +
" <code code=\"DE05.10.130.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"出院诊断-中医病名代码\"/> \n" +
" <value xsi:type=\"CD\" code=\"\" displayName=\"\" codeSystem=\"2.16.156.10011.2.3.3.14\" codeSystemName=\"中医病证分类与代码表( GB/T 15657)\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <entryRelationship typeCode=\"COMP\" displayName=\"出院诊断-中医证候\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <!--出院诊断-中医证候编码-名称--> \n" +
" <code code=\"\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"出院诊断-中医证候名称\"/> \n" +
" <value xsi:type=\"ST\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <entryRelationship typeCode=\"COMP\" displayName=\"出院诊断-中医证候\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <!--出院诊断-中医证候编码-代码--> \n" +
" <code code=\"DE05.10.130.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"出院诊断-中医证候代码\"/> \n" +
" <value xsi:type=\"CD\" code=\"\" displayName=\"\" codeSystem=\"2.16.156.10011.2.3.3.14\" codeSystemName=\"中医病证分类与代码表( GB/T 15657)\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" <!--出院诊断顺位--> \n" +
" <entryRelationship typeCode=\"COMP\" displayName=\"出院诊断顺位\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE05.01.080.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"出院诊断顺位\"/> \n" +
" <value xsi:type=\"INT\" value=\"\"/> \n" +
" </observation> \n" +
" </entryRelationship> \n" +
" </observation> \n" +
" </entry> \n" +
" <entry displayName=\"出院时症状与体征\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE04.01.117.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"出院时症状与体征\"/> \n" +
" <value xsi:type=\"ST\"/> \n" +
" </observation> \n" +
" </entry> \n" +
" <entry displayName=\"出院医嘱\"> \n" +
" <observation classCode=\"OBS\" moodCode=\"EVN\"> \n" +
" <code code=\"DE06.00.287.00\" codeSystem=\"2.16.156.10011.2.2.1\" codeSystemName=\"卫生信息数据元目录\" displayName=\"出院医嘱\"/> \n" +
" <value xsi:type=\"ST\"/> \n" +
" </observation> \n" +
" </entry> \n" +
" <!-- 抗菌药物接口所需 --> \n" +
" <antibacterial_drugs> \n" +
" <!-- 诊断类别 --> \n" +
" <diagClass/> \n" +
" <!-- 治疗情况 --> \n" +
" <diagResult/> \n" +
" <!-- 治愈医生工号 --> \n" +
" <healDoc/> \n" +
" </antibacterial_drugs> \n" +
" </section> \n" +
" </component> \n" +
" </encounterEvent> \n" +
" </subject> \n" +
" </controlActProcess> \n" +
" <emr> \n" +
" <!-- 离院方式 --> \n" +
" <P_OUT_TYPE/> \n" +
" <!-- 治疗转归 --> \n" +
" <P_OUT_STATE>治愈</P_OUT_STATE> \n" +
" <!-- 在院状态在院是I出院是O取消入院是N --> \n" +
" <P_IN_STATE>O</P_IN_STATE> \n" +
" <!-- 总费用 --> \n" +
" <TOTAL_COSTS>0</TOTAL_COSTS> \n" +
" </emr> \n" +
" <!-- 抗菌药物接口所需 --> \n" +
" <antibacterial_drugs> \n" +
" <!-- 出院结算类型代码 --> \n" +
" <rcptPolicy>01</rcptPolicy> \n" +
" <!-- 出院医嘱名称 --> \n" +
" <dischgState>出院医嘱</dischgState> \n" +
" </antibacterial_drugs> \n" +
"</PRPA_HIP0032>\n";
}
public static void main(String[] args) {
XmlUtil a=XmlUtil.of(str);
Node node=null;
//id-消息流水号
node = a.getNode("/PRPA_HIP0032/id/@extension");
String serialId = node.toString();
System.out.println(serialId);
//住院流水号
node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/item/@extension");
String jzh = node.toString();
System.out.println(jzh);
//住院号标识
node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/id/item/@extension");
String inpatientNo = node.toString();
System.out.println(inpatientNo);
//住院次数[]
node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/lengthOfStayQuantity[@unit='次']/@value");
String admissTimes=node.toString();
System.out.println(admissTimes);
//姓名
node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/subject/patient/patientPerson/name/item/part/@value");
String name = node.toString();
System.out.println(name);
//入院日期时间
node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/low/@value");
String admissDate = node.toString();
System.out.println(admissDate);
//出院日期时间
node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/effectiveTime/high/@value");
String disDate = node.toString();
System.out.println(disDate);
//入院诊断科室名称[]
node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='入院诊断']/section/entry[@displayName='入院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name");
String admissDeptName = node.getTextContent();
System.out.println(admissDeptName);
//出院诊断科室名称[]
node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/component[@displayName='出院诊断']/section/entry[@displayName='出院诊断-西医条目']/observation/performer/assignedEntity/representedOrganization/name");
String disDeptName = node.getTextContent();
System.out.println(disDeptName);
//主治医师[]
node = a.getNode("/PRPA_HIP0032/controlActProcess/subject/encounterEvent/authenticator[@displayName='主治医师']/assignedEntity/assignedPerson/name");
String attendingName = node.getTextContent();
System.out.println(attendingName);
}
}

@ -0,0 +1,30 @@
package com.docus.server.fsy.api;
import com.docus.server.fsy.api.dto.LisPatientListRequest;
import com.docus.server.fsy.api.dto.LisPatientListResponse;
import com.docus.server.fsy.api.dto.LisPatientReportRequest;
import com.docus.server.fsy.api.dto.LisPatientReportResponse;
/**
* @author YongBin Wen
* @date 2024/3/29 10:20
*/
public interface LisReportService {
/**
*
*
* @param request
* @return
*/
LisPatientListResponse getPatientList(LisPatientListRequest request);
/**
* PDF
*
* @param request
* @return
*/
LisPatientReportResponse getPatientReport(LisPatientReportRequest request);
}

@ -0,0 +1,27 @@
package com.docus.server.fsy.api.dto;
import lombok.Data;
/**
* @author YongBin Wen
* @date 2024/3/29 10:26
*/
@Data
public class LisPatientListRequest {
/**
*
*/
private String pidInNo;
/**
*
*/
private Integer pidAddmissTimes;
/**
*
*/
private String startDate;
/**
*
*/
private String endDate;
}

@ -0,0 +1,41 @@
package com.docus.server.fsy.api.dto;
import lombok.Data;
import java.util.List;
/**
* @author YongBin Wen
* @date 2024/3/29 10:26
*/
@Data
public class LisPatientListResponse {
/**
*
*/
List<Patient> patientList;
@Data
public static class Patient {
/**
*
*/
private String pidInNo;
/**
*
*/
private String pidAddmissTimes;
/**
*
*/
private String repId;
/**
*
*/
private String pidComName;
/**
*
*/
private String repInDate;
}
}

@ -0,0 +1,19 @@
package com.docus.server.fsy.api.dto;
import lombok.Data;
/**
* @author YongBin Wen
* @date 2024/3/29 10:22
*/
@Data
public class LisPatientReportRequest {
/**
*
*/
private String repId;
/**
* ()
*/
private String customReportSuffix;
}

@ -0,0 +1,19 @@
package com.docus.server.fsy.api.dto;
import lombok.Data;
/**
* @author YongBin Wen
* @date 2024/3/29 10:22
*/
@Data
public class LisPatientReportResponse {
/**
*
*/
private String repId;
/**
* PDFbase64
*/
private String patientReport;
}

@ -0,0 +1,160 @@
package com.docus.server.fsy.converter;
import com.docus.core.util.Func;
import com.docus.server.archive.rpc.dto.ReportDownDto;
import com.docus.server.archive.rpc.dto.ReportDownPatientDto;
import com.docus.server.archive.rpc.dto.ReportDownScanFileDto;
import com.docus.server.archive.rpc.dto.ReportDownTwoDto;
import com.docus.server.archive.utils.XmlUtil;
import com.docus.server.fsy.api.dto.LisPatientListRequest;
import com.docus.server.fsy.api.dto.LisPatientListResponse;
import com.docus.server.fsy.api.dto.LisPatientReportRequest;
import com.docus.server.fsy.api.dto.LisPatientReportResponse;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* @author YongBin Wen
* @date 2024/3/29 10:24
*/
public class LisReportConverter {
/**
* test-pass
*/
public static String convertWsParam(LisPatientListRequest request) {
String pidInNo = Func.isBlank(request.getPidInNo()) ? "" : request.getPidInNo();
String pidAddmissTimes = Objects.isNull(request.getPidAddmissTimes()) ? "" : request.getPidAddmissTimes().toString();
String startDate = Func.isBlank(request.getStartDate()) ? "" : request.getStartDate();
String endDate = Func.isBlank(request.getEndDate()) ? "" : request.getEndDate();
return "<Request>\n" +
" <PidInNo>" + pidInNo + "</PidInNo>\n" +
" <PidAddmissTimes>" + pidAddmissTimes + "</PidAddmissTimes>\n" +
" <StartDate>" + startDate + "</StartDate>\n" +
" <EndDate>" + endDate + "</EndDate>\n" +
"</Request>";
}
/**
* test-pass
*/
public static String convertWsParam(LisPatientReportRequest request) {
String repId = Func.isBlank(request.getRepId()) ? "" : request.getRepId();
String customReportSuffix = Func.isBlank(request.getCustomReportSuffix()) ? "" : request.getCustomReportSuffix();
return "<Request>\n" +
" <RepID>" + repId + "</RepID>\n" +
" <CustomReportSuffix>" + customReportSuffix + "</CustomReportSuffix>\n" +
"</Request>";
}
/**
* test-pass
*/
public static LisPatientListResponse convertWsPatientListResponse(String result) {
if (Func.isBlank(result)) {
return null;
}
XmlUtil xmlUtil = XmlUtil.of(result);
if (wsIsFailed(xmlUtil)) {
return null;
}
ArrayList<LisPatientListResponse.Patient> patients = new ArrayList<>();
NodeList pidReportMainNodeList = xmlUtil.getNodeList("/Response/Result/PidReportMain");
int mainNodeListLength = pidReportMainNodeList.getLength();
for (int i = 0; i < mainNodeListLength; i++) {
Node pidReportMainNode = pidReportMainNodeList.item(i);
NodeList childNodes = pidReportMainNode.getChildNodes();
int childNodesLength = childNodes.getLength();
LisPatientListResponse.Patient patient = new LisPatientListResponse.Patient();
for (int j = 0; j < childNodesLength; j++) {
Node node = childNodes.item(j);
if ("PidInNo".equals(node.getNodeName())) {
patient.setPidInNo(node.getTextContent());
continue;
}
if ("PidAddmissTimes".equals(node.getNodeName())) {
patient.setPidAddmissTimes(node.getTextContent());
continue;
}
if ("RepId".equals(node.getNodeName())) {
patient.setRepId(node.getTextContent());
continue;
}
if ("PidComName".equals(node.getNodeName())) {
patient.setPidComName(node.getTextContent());
continue;
}
if ("RepInDate".equals(node.getNodeName())) {
patient.setRepInDate(node.getTextContent());
}
}
patients.add(patient);
}
LisPatientListResponse response = new LisPatientListResponse();
response.setPatientList(patients);
return response;
}
/**
* test-pass
*/
public static LisPatientReportResponse convertWsPatientReportResponse(String result) {
if (Func.isBlank(result)) {
return null;
}
XmlUtil xmlUtil = XmlUtil.of(result);
if (wsIsFailed(xmlUtil)) {
return null;
}
Node repIdNode = xmlUtil.getNode("/Response/Result/Patient/RepId");
Node patientReportNode = xmlUtil.getNode("/Response/Result/Patient/PatientReport");
LisPatientReportResponse response = new LisPatientReportResponse();
response.setRepId(repIdNode.getTextContent());
response.setPatientReport(patientReportNode.getTextContent());
return response;
}
/**
* test-pass
*/
public static boolean wsIsFailed(XmlUtil xmlUtil) {
Node resultCodeNode = xmlUtil.getNode("/Response/ResultCode");
String failedCode = "1";
return resultCodeNode == null || failedCode.equals(resultCodeNode.getTextContent());
}
/**
*
*/
public static ReportDownDto convertDownloadPlatform(ReportDownTwoDto reportDownTwoDto, LisPatientListResponse.Patient patient, LisPatientReportResponse reportResponse) {
ReportDownScanFileDto scanFileDto = new ReportDownScanFileDto();
scanFileDto.setTaskid(reportDownTwoDto.getTasks().get(0).getTaskId());
scanFileDto.setFiletitle(patient.getPidComName());
scanFileDto.setFilesource(1);
scanFileDto.setFilestoragetype(1);
scanFileDto.setFiletype(2);
scanFileDto.setDownurl(reportResponse.getPatientReport());
scanFileDto.setSerialnum(reportResponse.getRepId());
List<ReportDownScanFileDto> scanfiles = new ArrayList<>();
scanfiles.add(scanFileDto);
ReportDownPatientDto reportDownPatientDto = new ReportDownPatientDto();
reportDownPatientDto.setPatientid(reportDownTwoDto.getPatientId());
ReportDownDto reportDownDto = new ReportDownDto();
reportDownDto.setIp("ws-java");
reportDownDto.setScanusercode("ws-java");
reportDownDto.setScanusername("ws-java-");
reportDownDto.setPatient(reportDownPatientDto);
reportDownDto.setScanfiles(scanfiles);
return reportDownDto;
}
}

@ -0,0 +1,45 @@
package com.docus.server.fsy.service.impl;
import com.docus.server.archive.utils.JaxWsDynamicClientUtil;
import com.docus.server.fsy.api.LisReportService;
import com.docus.server.fsy.api.dto.LisPatientListRequest;
import com.docus.server.fsy.api.dto.LisPatientListResponse;
import com.docus.server.fsy.api.dto.LisPatientReportRequest;
import com.docus.server.fsy.api.dto.LisPatientReportResponse;
import com.docus.server.fsy.converter.LisReportConverter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
/**
* @author YongBin Wen
* @date 2024/3/29 10:20
*/
@Service
@Slf4j
public class LisReportServiceImpl implements LisReportService {
@Value("${fsy.lis.ws-url}")
private String lisUrl;
@Override
public LisPatientListResponse getPatientList(LisPatientListRequest request) {
final String method="GetPatientList";
Object[] params = new Object[2];
params[0]=method;
params[1]=LisReportConverter.convertWsParam(request);;
String result = JaxWsDynamicClientUtil.send(lisUrl, null, "DCLInterface", params);
return LisReportConverter.convertWsPatientListResponse(result);
}
@Override
public LisPatientReportResponse getPatientReport(LisPatientReportRequest request) {
final String method="GetPatientReport";
Object[] params = new Object[2];
params[0]=method;
params[1]= LisReportConverter.convertWsParam(request);
String result = JaxWsDynamicClientUtil.send(lisUrl, null, "DCLInterface", params);
return LisReportConverter.convertWsPatientReportResponse(result);
}
}

@ -70,14 +70,20 @@ spring:
shared-configs: shared-configs:
- comm.${spring.cloud.nacos.config.file-extension} - comm.${spring.cloud.nacos.config.file-extension}
fsy:
lis:
ws-url: http://10.100.23.96:8095/DCLService.asmx
sysflag: 6
assortid: 1213131
docus: docus:
url: url:
# 采集任务补偿地址 # 采集任务补偿地址
compensate-task-url: http://localhost:9295/ viewcollect-server: http://localhost:9295/
# 下载地址 # 报告上报地址
down-url: http://localhost:9291/api/downplatform/report downploadlatform-server: http://localhost:9291/
medicalrecord: http://192.168.16.85:9102 # 获取无视图模式采集任务地址
taskdistribute-server: http://localhost:9296/
dbtype: mysql dbtype: mysql

Loading…
Cancel
Save