|
|
|
@ -1,23 +1,13 @@
|
|
|
|
|
package com.docus.server.report.webservice.impl;
|
|
|
|
|
|
|
|
|
|
import com.docus.core.util.DateUtil;
|
|
|
|
|
import com.docus.core.util.Func;
|
|
|
|
|
import com.docus.infrastructure.core.exception.BaseException;
|
|
|
|
|
import com.docus.server.report.api.dto.ReportDto;
|
|
|
|
|
import com.docus.server.report.config.SdRyReportHandledConfig;
|
|
|
|
|
import com.docus.server.report.config.ZdAssortConfig;
|
|
|
|
|
import com.docus.server.report.service.ReportService;
|
|
|
|
|
import com.docus.server.report.util.IdUtil;
|
|
|
|
|
import com.docus.server.report.util.JSXMLResult;
|
|
|
|
|
import com.docus.server.report.util.TableJsonRead;
|
|
|
|
|
import com.docus.server.report.util.XmlUtil;
|
|
|
|
|
import com.docus.server.report.webservice.IReportServer;
|
|
|
|
|
import com.docus.server.report.webservice.WebserviceReceiveServerHandler;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.w3c.dom.Node;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author wyb
|
|
|
|
@ -27,773 +17,40 @@ import java.util.Date;
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class SdryReportServerImpl implements IReportServer {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ReportService reportService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private Map<String,WebserviceReceiveServerHandler> webserviceReceiveServerHandler=new ConcurrentHashMap<>();
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String pushSAReport(String saReportMessage) {
|
|
|
|
|
// 待做
|
|
|
|
|
log.info("收到手麻消息:{}", saReportMessage);
|
|
|
|
|
String msgId = "";
|
|
|
|
|
try {
|
|
|
|
|
XmlUtil xmlUtil = XmlUtil.of(saReportMessage);
|
|
|
|
|
Node msgNode = xmlUtil.getNode("/Request/Msg/ID");
|
|
|
|
|
msgId = msgNode.getTextContent();
|
|
|
|
|
ReportDto reportDto = getReportDtoByJSXML(xmlUtil);
|
|
|
|
|
verifyReportDto(reportDto);
|
|
|
|
|
reportService.report(reportDto);
|
|
|
|
|
return JSXMLResult.success(msgId);
|
|
|
|
|
} catch (BaseException baseException) {
|
|
|
|
|
log.error(baseException.getMessage(), baseException);
|
|
|
|
|
return JSXMLResult.failed(msgId, baseException.getMessage());
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error(ex.getMessage(), ex);
|
|
|
|
|
return JSXMLResult.failed(msgId, "系统故障!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 嘉时自定义接收接口使用,从xml工具读取返回文件上报需要的数据
|
|
|
|
|
*
|
|
|
|
|
* @param xmlUtil xml消息工具封装
|
|
|
|
|
* @return 文件上报数据
|
|
|
|
|
*/
|
|
|
|
|
public ReportDto getReportDtoByJSXML(XmlUtil xmlUtil) {
|
|
|
|
|
TableJsonRead jsonRead = new TableJsonRead();
|
|
|
|
|
String jsReportConfigXml = jsonRead.ReadContent("data-config", "js-report-config.xml");
|
|
|
|
|
XmlUtil configXmlUtil = XmlUtil.of(jsReportConfigXml);
|
|
|
|
|
|
|
|
|
|
Node inpatientNoXpathNode = configXmlUtil.getNode("/REPORT/INPATIENT_NO");
|
|
|
|
|
String inpatientNoXpath = inpatientNoXpathNode.getTextContent();
|
|
|
|
|
Node inpatientNoNode = xmlUtil.getNode(inpatientNoXpath);
|
|
|
|
|
String inpatientNo = inpatientNoNode.getTextContent();
|
|
|
|
|
|
|
|
|
|
Node jzhXpathNode = configXmlUtil.getNode("/REPORT/JZH");
|
|
|
|
|
String jzhXpath = jzhXpathNode.getTextContent();
|
|
|
|
|
Node jzhNode = xmlUtil.getNode(jzhXpath);
|
|
|
|
|
String jzh = jzhNode.getTextContent();
|
|
|
|
|
|
|
|
|
|
Node admissTimesXpathNode = configXmlUtil.getNode("/REPORT/ADMISS_TIMES");
|
|
|
|
|
String admissTimesXpath = admissTimesXpathNode.getTextContent();
|
|
|
|
|
Node admissTimesNode = xmlUtil.getNode(admissTimesXpath);
|
|
|
|
|
Integer admissTimes = Integer.valueOf(admissTimesNode.getTextContent());
|
|
|
|
|
|
|
|
|
|
Node serialnumXpathNode = configXmlUtil.getNode("/REPORT/SERIALNUM");
|
|
|
|
|
String serialnumXpath = serialnumXpathNode.getTextContent();
|
|
|
|
|
Node serialnumNode = xmlUtil.getNode(serialnumXpath);
|
|
|
|
|
String serialnum = serialnumNode.getTextContent();
|
|
|
|
|
|
|
|
|
|
Node fileTitleXpathNode = configXmlUtil.getNode("/REPORT/FILE_TITLE");
|
|
|
|
|
String fileTitleXpath = fileTitleXpathNode.getTextContent();
|
|
|
|
|
Node fileTitleNode = xmlUtil.getNode(fileTitleXpath);
|
|
|
|
|
String fileTitle = fileTitleNode.getTextContent();
|
|
|
|
|
|
|
|
|
|
Node downUrlXpathNode = configXmlUtil.getNode("/REPORT/DOWNURL");
|
|
|
|
|
String downUrlXpath = downUrlXpathNode.getTextContent();
|
|
|
|
|
Node downUrlNode = xmlUtil.getNode(downUrlXpath);
|
|
|
|
|
String downUrl = downUrlNode.getTextContent();
|
|
|
|
|
|
|
|
|
|
Node tableTypeXpathNode = configXmlUtil.getNode("/REPORT/TABLE_TYPE");
|
|
|
|
|
String tableTypeXpath = tableTypeXpathNode.getTextContent();
|
|
|
|
|
Node tableTypeNode = xmlUtil.getNode(tableTypeXpath);
|
|
|
|
|
String tableType = tableTypeNode.getTextContent();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Node assortIdXpathNode = configXmlUtil.getNode("/REPORT/ASSORT_ID");
|
|
|
|
|
String assortIdXpath = assortIdXpathNode.getTextContent();
|
|
|
|
|
String assortId;
|
|
|
|
|
if (Func.isBlank(assortIdXpath)) {
|
|
|
|
|
// 如果没有配置 取value 属性,如果value也未配置 取 tableType 对应的json配置,最终方案默认 other 分段
|
|
|
|
|
Node assortIdValueNode = assortIdXpathNode.getAttributes().getNamedItem("value");
|
|
|
|
|
if (Func.isEmpty(assortIdValueNode)) {
|
|
|
|
|
assortId = assortIdValueNode.getNodeValue();
|
|
|
|
|
} else {
|
|
|
|
|
assortId= ZdAssortConfig.getZdAssortId(tableType);
|
|
|
|
|
}
|
|
|
|
|
if (Func.isBlank(assortId)) {
|
|
|
|
|
assortId = ZdAssortConfig.getOtherAssortId();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
Node assortIdNode = xmlUtil.getNode(assortIdXpath);
|
|
|
|
|
assortId = assortIdNode.getTextContent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Node sysFlagXpathNode = configXmlUtil.getNode("/REPORT/SYSTEM_FLAG");
|
|
|
|
|
String sysFlagXpath = sysFlagXpathNode.getTextContent();
|
|
|
|
|
Node sysFlagNode = xmlUtil.getNode(sysFlagXpath);
|
|
|
|
|
String sysFlag = sysFlagNode.getTextContent();
|
|
|
|
|
|
|
|
|
|
Node fileSourceXpathNode = configXmlUtil.getNode("/REPORT/FILESOURCE");
|
|
|
|
|
String fileSourceXpath = fileSourceXpathNode.getTextContent();
|
|
|
|
|
String fileSource;
|
|
|
|
|
if (Func.isBlank(fileSourceXpath)) {
|
|
|
|
|
Node fileSourceValueNode = fileSourceXpathNode.getAttributes().getNamedItem("value");
|
|
|
|
|
if (Func.isEmpty(fileSourceValueNode)) {
|
|
|
|
|
fileSource = null;
|
|
|
|
|
} else {
|
|
|
|
|
fileSource = fileSourceValueNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
Node fileSourceNode = xmlUtil.getNode(fileSourceXpath);
|
|
|
|
|
fileSource = fileSourceNode.getTextContent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Node fileStorageTypeXpathNode = configXmlUtil.getNode("/REPORT/FILE_STORAGE_TYPE");
|
|
|
|
|
String fileStorageTypeXpath = fileStorageTypeXpathNode.getTextContent();
|
|
|
|
|
String fileStorageType;
|
|
|
|
|
if (Func.isBlank(fileStorageTypeXpath)) {
|
|
|
|
|
Node filestoragetypeValueNode = fileStorageTypeXpathNode.getAttributes().getNamedItem("value");
|
|
|
|
|
if (Func.isEmpty(filestoragetypeValueNode)) {
|
|
|
|
|
fileStorageType = "1";
|
|
|
|
|
} else {
|
|
|
|
|
fileStorageType = filestoragetypeValueNode.getNodeValue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
Node filestoragetypeNode = xmlUtil.getNode(fileStorageTypeXpath);
|
|
|
|
|
fileStorageType = filestoragetypeNode.getTextContent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ReportDto reportDto = new ReportDto();
|
|
|
|
|
reportDto.setAdmisstimes(admissTimes);
|
|
|
|
|
reportDto.setInpatientNo(inpatientNo);
|
|
|
|
|
reportDto.setJzh(jzh);
|
|
|
|
|
reportDto.setSerialnum(serialnum);
|
|
|
|
|
reportDto.setFileTitle(fileTitle);
|
|
|
|
|
reportDto.setDownUrl(downUrl);
|
|
|
|
|
reportDto.setAssortId(assortId);
|
|
|
|
|
reportDto.setSysFlag(sysFlag);
|
|
|
|
|
reportDto.setFileSource(fileSource);
|
|
|
|
|
reportDto.setFilestoragetype(fileStorageType);
|
|
|
|
|
return reportDto;
|
|
|
|
|
return webserviceReceiveServerHandler.get("sa").handle(saReportMessage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String pushICUReport(String icuReportMessage) {
|
|
|
|
|
log.info("收到重症消息:{}", icuReportMessage);
|
|
|
|
|
String msgId = "";
|
|
|
|
|
try {
|
|
|
|
|
XmlUtil xmlUtil = XmlUtil.of(icuReportMessage);
|
|
|
|
|
Node msgNode = xmlUtil.getNode("/Request/Msg/ID");
|
|
|
|
|
msgId = msgNode.getTextContent();
|
|
|
|
|
ReportDto reportDto = getReportDtoByJSXML(xmlUtil);
|
|
|
|
|
verifyReportDto(reportDto);
|
|
|
|
|
reportService.report(reportDto);
|
|
|
|
|
return JSXMLResult.success(msgId);
|
|
|
|
|
} catch (BaseException baseException) {
|
|
|
|
|
log.error(baseException.getMessage(), baseException);
|
|
|
|
|
return JSXMLResult.failed(msgId, baseException.getMessage());
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error(ex.getMessage(), ex);
|
|
|
|
|
return JSXMLResult.failed(msgId, "系统故障!");
|
|
|
|
|
}
|
|
|
|
|
return webserviceReceiveServerHandler.get("icu").handle(icuReportMessage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String pushExaminationReport(String examinationReportMessage){
|
|
|
|
|
log.info("收到检验报告消息:{}", examinationReportMessage);
|
|
|
|
|
String msgId = "";
|
|
|
|
|
try {
|
|
|
|
|
XmlUtil xmlUtil = XmlUtil.of(examinationReportMessage);
|
|
|
|
|
Node msgNode = xmlUtil.getNode("/Request/Msg/ID");
|
|
|
|
|
msgId = msgNode.getTextContent();
|
|
|
|
|
ReportDto reportDto = getReportDtoByJSXML(xmlUtil);
|
|
|
|
|
verifyReportDto(reportDto);
|
|
|
|
|
reportService.report(reportDto);
|
|
|
|
|
return JSXMLResult.success(msgId);
|
|
|
|
|
} catch (BaseException baseException) {
|
|
|
|
|
log.error(baseException.getMessage(), baseException);
|
|
|
|
|
return JSXMLResult.failed(msgId, baseException.getMessage());
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error(ex.getMessage(), ex);
|
|
|
|
|
return JSXMLResult.failed(msgId, "系统故障!");
|
|
|
|
|
}
|
|
|
|
|
return webserviceReceiveServerHandler.get("examination").handle(examinationReportMessage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String pushAddInspectionReport(String inspectionReportMessage) {
|
|
|
|
|
log.info("收到检查报告新增消息:{}", inspectionReportMessage);
|
|
|
|
|
String msgId = "";
|
|
|
|
|
String sender = "";
|
|
|
|
|
String receiver = "";
|
|
|
|
|
try {
|
|
|
|
|
XmlUtil xmlUtil = XmlUtil.of(inspectionReportMessage);
|
|
|
|
|
msgId = xmlUtil.getNode("/POOR_HIP1008/id/@extension").getNodeValue();
|
|
|
|
|
sender = xmlUtil.getNode("/POOR_HIP1008/sender/device/id/item/@extension").getNodeValue();
|
|
|
|
|
receiver = xmlUtil.getNode("/POOR_HIP1008/receiver/device/id/item/@extension").getNodeValue();
|
|
|
|
|
SdRyReportHandledConfig sdRyReportHandledConfig = new SdRyReportHandledConfig();
|
|
|
|
|
ReportDto reportDto = getReportDtoByInspectionInsert(xmlUtil);
|
|
|
|
|
String sysFlag = reportDto.getSysFlag();
|
|
|
|
|
if (sdRyReportHandledConfig.isNotHandled(sysFlag)) {
|
|
|
|
|
return insertSuccess(msgId, sender, receiver);
|
|
|
|
|
}
|
|
|
|
|
if(sdRyReportHandledConfig.isBlocking(sysFlag)){
|
|
|
|
|
reportDto.setDownUrl(null);
|
|
|
|
|
reportService.reportBuffer(reportDto);
|
|
|
|
|
return insertSuccess(msgId, sender, receiver);
|
|
|
|
|
}
|
|
|
|
|
verifyReportDto(reportDto);
|
|
|
|
|
reportService.report(reportDto);
|
|
|
|
|
return insertSuccess(msgId, sender, receiver);
|
|
|
|
|
} catch (BaseException baseException) {
|
|
|
|
|
log.error(baseException.getMessage(), baseException);
|
|
|
|
|
return insertFailed(msgId, sender, receiver, baseException.getMessage());
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error(ex.getMessage(), ex);
|
|
|
|
|
return insertFailed(msgId, sender, receiver, "系统错误!");
|
|
|
|
|
}
|
|
|
|
|
return webserviceReceiveServerHandler.get("HIP1008").handle(inspectionReportMessage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String pushUpdateInspectionReport(String inspectionReportMessage) {
|
|
|
|
|
log.info("收到检查报告更新消息{}", inspectionReportMessage);
|
|
|
|
|
String msgId = "";
|
|
|
|
|
String sender = "";
|
|
|
|
|
String receiver = "";
|
|
|
|
|
try {
|
|
|
|
|
XmlUtil xmlUtil = XmlUtil.of(inspectionReportMessage);
|
|
|
|
|
msgId = xmlUtil.getNode("/POOR_HIP1009/id/@extension").getNodeValue();
|
|
|
|
|
sender = xmlUtil.getNode("/POOR_HIP1009/sender/device/id/item/@extension").getNodeValue();
|
|
|
|
|
receiver = xmlUtil.getNode("/POOR_HIP1009/receiver/device/id/item/@extension").getNodeValue();
|
|
|
|
|
|
|
|
|
|
ReportDto reportDto = getReportDtoByInspectionUpdate(xmlUtil);
|
|
|
|
|
verifyReportDto(reportDto);
|
|
|
|
|
reportService.report(reportDto);
|
|
|
|
|
return updateSuccess(msgId, sender, receiver);
|
|
|
|
|
} catch (BaseException baseException) {
|
|
|
|
|
log.error(baseException.getMessage(), baseException);
|
|
|
|
|
return updateFailed(msgId, sender, receiver, baseException.getMessage());
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error(ex.getMessage(), ex);
|
|
|
|
|
return updateFailed(msgId, sender, receiver, "系统错误");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return webserviceReceiveServerHandler.get("HIP1009").handle(inspectionReportMessage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String pdfUpload(String uploadMessage) {
|
|
|
|
|
log.info("收到pdf上传信息{}", uploadMessage);
|
|
|
|
|
String msgId = "";
|
|
|
|
|
String sender = "";
|
|
|
|
|
String receiver = "";
|
|
|
|
|
try {
|
|
|
|
|
XmlUtil xmlUtil = XmlUtil.of(uploadMessage);
|
|
|
|
|
msgId = xmlUtil.getNode("/POOR_HIP1166/id/@extension").getNodeValue();
|
|
|
|
|
sender = xmlUtil.getNode("/POOR_HIP1166/sender/device/id/item/@extension").getNodeValue();
|
|
|
|
|
receiver = xmlUtil.getNode("/POOR_HIP1166/receiver/device/id/item/@extension").getNodeValue();
|
|
|
|
|
ReportDto reportDto = getReportDtoByPdfUpload(xmlUtil);
|
|
|
|
|
reportService.reportBuffer(reportDto);
|
|
|
|
|
return uploadSuccess(msgId, sender, receiver);
|
|
|
|
|
} catch (BaseException baseException) {
|
|
|
|
|
log.error(baseException.getMessage(), baseException);
|
|
|
|
|
return uploadFailed(msgId, sender, receiver, baseException.getMessage());
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error(ex.getMessage(), ex);
|
|
|
|
|
return uploadFailed(msgId, sender, receiver, "系统错误!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String uploadFailed(String msgId, String sender, String receiver, String message) {
|
|
|
|
|
String createTime = Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI);
|
|
|
|
|
return "<MCCI_IN000002UV01 xmlns=\"urn:hl7-org:v3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ITSVersion=\"XML_1.0\" xsi:schemaLocation=\"urn:hl7-org:v3 file:///E:/hl7/HL7/v3ballot_fullsite_2011MAY/v3ballot/html/processable/multicacheschemas/MCCI _IN000002UV01.xsd\">" +
|
|
|
|
|
"<id extension=\""+IdUtil.standardUUID()+"\"/>" +
|
|
|
|
|
"<creationTime value=\""+createTime+"\"/>" +
|
|
|
|
|
"<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"MCCI_IN000002UV01\"/>" +
|
|
|
|
|
"<processingCode code=\"P\"/>" +
|
|
|
|
|
"<processingModeCode/>" +
|
|
|
|
|
"<acceptAckCode code=\"AL\"/>" +
|
|
|
|
|
"<receiver typeCode=\"RCV\">" +
|
|
|
|
|
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
"<id>" +
|
|
|
|
|
"<item extension=\"Orion-001\"/>" +
|
|
|
|
|
"</id>" +
|
|
|
|
|
"</device>" +
|
|
|
|
|
"</receiver>" +
|
|
|
|
|
"<sender typeCode=\"SND\">" +
|
|
|
|
|
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
"<id>" +
|
|
|
|
|
"<item extension=\"PaperlessManagementMRIS-001\"/>" +
|
|
|
|
|
"</id>" +
|
|
|
|
|
"</device>" +
|
|
|
|
|
"</sender>" +
|
|
|
|
|
"<acknowledgement typeCode=\"AE\">" +
|
|
|
|
|
"<targetMessage>" +
|
|
|
|
|
"<id extension=\""+msgId+"\"/>" +
|
|
|
|
|
"</targetMessage>" +
|
|
|
|
|
"<acknowledgementDetail>" +
|
|
|
|
|
"<text value=\""+message+"\"/>" +
|
|
|
|
|
"</acknowledgementDetail>" +
|
|
|
|
|
"</acknowledgement>" +
|
|
|
|
|
"</MCCI_IN000002UV01>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String uploadSuccess(String msgId, String sender, String receiver) {
|
|
|
|
|
String createTime = Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI);
|
|
|
|
|
return "<MCCI_IN000002UV01 xmlns=\"urn:hl7-org:v3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ITSVersion=\"XML_1.0\" xsi:schemaLocation=\"urn:hl7-org:v3 file:///E:/hl7/HL7/v3ballot_fullsite_2011MAY/v3ballot/html/processable/multicacheschemas/MCCI _IN000002UV01.xsd\">" +
|
|
|
|
|
"<id extension=\""+IdUtil.standardUUID()+"\"/>" +
|
|
|
|
|
"<creationTime value=\""+createTime+"\"/>" +
|
|
|
|
|
"<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"MCCI_IN000002UV01\"/>" +
|
|
|
|
|
"<processingCode code=\"P\"/>" +
|
|
|
|
|
"<processingModeCode/>" +
|
|
|
|
|
"<acceptAckCode code=\"AL\"/>" +
|
|
|
|
|
"<receiver typeCode=\"RCV\">" +
|
|
|
|
|
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
"<id>" +
|
|
|
|
|
"<item extension=\"Orion-001\"/>" +
|
|
|
|
|
"</id>" +
|
|
|
|
|
"</device>" +
|
|
|
|
|
"</receiver>" +
|
|
|
|
|
"<sender typeCode=\"SND\">" +
|
|
|
|
|
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
"<id>" +
|
|
|
|
|
"<item extension=\"PaperlessManagementMRIS-001\"/>" +
|
|
|
|
|
"</id>" +
|
|
|
|
|
"</device>" +
|
|
|
|
|
"</sender>" +
|
|
|
|
|
"<acknowledgement typeCode=\"AA\">" +
|
|
|
|
|
"<targetMessage>" +
|
|
|
|
|
"<id extension=\""+msgId+"\"/>" +
|
|
|
|
|
"</targetMessage>" +
|
|
|
|
|
"<acknowledgementDetail>" +
|
|
|
|
|
"<text value=\"成功\"/>" +
|
|
|
|
|
"</acknowledgementDetail>" +
|
|
|
|
|
"</acknowledgement>" +
|
|
|
|
|
"</MCCI_IN000002UV01>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ReportDto getReportDtoByPdfUpload(XmlUtil xmlUtil) {
|
|
|
|
|
// 检查报告单号标识
|
|
|
|
|
Node reportSnNode = xmlUtil.getNode("/POOR_HIP1166/controlActProcess/component/structuredBody/component[@displayName='文档描述信息']/section/entry/reportInfomation/reportSn/@extension");
|
|
|
|
|
String reportSn = reportSnNode.getNodeValue();
|
|
|
|
|
|
|
|
|
|
Node downUrlNode = xmlUtil.getNode("/POOR_HIP1166/controlActProcess/component/structuredBody/component[@displayName='文档描述信息']/section/entry/reportInfomation/reportPath/@extension");
|
|
|
|
|
String downUrl = downUrlNode.getTextContent();
|
|
|
|
|
|
|
|
|
|
ReportDto reportDto = new ReportDto();
|
|
|
|
|
reportDto.setReportSn(reportSn);
|
|
|
|
|
reportDto.setDowntype(1);
|
|
|
|
|
reportDto.setDownUrl(downUrl);
|
|
|
|
|
return reportDto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 验证上报文件的信息
|
|
|
|
|
*
|
|
|
|
|
* @param reportDto 上报文件的信息
|
|
|
|
|
* @throws BaseException 验证不通过抛出业务异常
|
|
|
|
|
*/
|
|
|
|
|
private void verifyReportDto(ReportDto reportDto) throws BaseException {
|
|
|
|
|
|
|
|
|
|
if (Func.isBlank(reportDto.getInpatientNo())) {
|
|
|
|
|
throw new BaseException("住院号不能为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Func.isEmpty(reportDto.getAdmisstimes()) && Func.isBlank(reportDto.getJzh())) {
|
|
|
|
|
throw new BaseException("当住院号与住院次数都为空时,住院流水号/记账号不能为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Func.isBlank(reportDto.getFileTitle())) {
|
|
|
|
|
throw new BaseException("文件名不能为空!");
|
|
|
|
|
}
|
|
|
|
|
if (Func.isBlank(reportDto.getDownUrl())) {
|
|
|
|
|
throw new BaseException("文件下载路径不能为空!");
|
|
|
|
|
}
|
|
|
|
|
return webserviceReceiveServerHandler.get("HIP1166").handle(uploadMessage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ReportDto getReportDtoByInspectionInsert(XmlUtil inspectionInsertXmlUtil) {
|
|
|
|
|
Node senderNode = inspectionInsertXmlUtil.getNode("/POOR_HIP1008/sender/device/id/item/@extension");
|
|
|
|
|
String sender = senderNode.getNodeValue();
|
|
|
|
|
String zdAssortId = ZdAssortConfig.getZdAssortId(sender);
|
|
|
|
|
if(Func.isBlank(zdAssortId)){
|
|
|
|
|
zdAssortId=ZdAssortConfig.getOtherAssortId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Node inpatientNoNode = inspectionInsertXmlUtil.getNode("/POOR_HIP1008/controlActProcess/subject/recordTarget/patientRole/id[@root='2.16.156.10011.1.12']/@extension");
|
|
|
|
|
String inpatientNo = inpatientNoNode.getNodeValue();
|
|
|
|
|
|
|
|
|
|
Node admissTimesNode = inspectionInsertXmlUtil.getNode("/POOR_HIP1008/controlActProcess/subject/recordTarget/patientRole/item[@root='1.2.156.112635.1.2.1.7']/@extension");
|
|
|
|
|
Integer admissTimes = Integer.valueOf(admissTimesNode.getNodeValue());
|
|
|
|
|
|
|
|
|
|
// 检查报告单号标识
|
|
|
|
|
Node reportFlagNode = inspectionInsertXmlUtil.getNode("/POOR_HIP1008/controlActProcess/subject/recordTarget/patientRole/id[@root='2.16.156.10011.1.32']/@extension");
|
|
|
|
|
String reportFlag = reportFlagNode.getNodeValue();
|
|
|
|
|
//电子申请单编号
|
|
|
|
|
Node eafNoNode = inspectionInsertXmlUtil.getNode("/POOR_HIP1008/controlActProcess/subject/recordTarget/patientRole/id[@root='2.16.156.10011.1.24']/@extension");
|
|
|
|
|
String eafNo = eafNoNode.getNodeValue();
|
|
|
|
|
String serialnum = reportFlag + "@" + eafNo;
|
|
|
|
|
|
|
|
|
|
// Node assortIdNode = inspectionInsertXmlUtil.getNode("/POOR_HIP1008/controlActProcess/subject/component/structuredBody/component[@displayName='检查报告']/section/entry[@displayName='检查类型']/observation/code/@displayName");
|
|
|
|
|
// String assortId = assortIdNode.getNodeValue();
|
|
|
|
|
|
|
|
|
|
// Node sysFlagNode = inspectionInsertXmlUtil.getNode("/POOR_HIP1008/controlActProcess/subject/component/structuredBody/component[@displayName='检查报告']/section/entry[@displayName='检查类型']/observation/code/@displayName");
|
|
|
|
|
// String sysFlag = sysFlagNode.getNodeValue();
|
|
|
|
|
|
|
|
|
|
Node fileTitleNode = inspectionInsertXmlUtil.getNode("/POOR_HIP1008/controlActProcess/subject/component/structuredBody/component[@displayName='检查报告']/section/entry[@displayName='检查报告类型']/observation/code/@displayName");
|
|
|
|
|
String fileTitle = fileTitleNode.getNodeValue();
|
|
|
|
|
|
|
|
|
|
Node downUrlNode = inspectionInsertXmlUtil.getNode("/POOR_HIP1008/controlActProcess/subject/component/structuredBody/component[@displayName='检查报告图像']/report/entry[@displayName='检查报告图像URL地址']/observation/value");
|
|
|
|
|
String downUrl = downUrlNode.getTextContent();
|
|
|
|
|
|
|
|
|
|
ReportDto reportDto = new ReportDto();
|
|
|
|
|
reportDto.setReportSn(reportFlag);
|
|
|
|
|
reportDto.setAdmisstimes(admissTimes);
|
|
|
|
|
reportDto.setInpatientNo(inpatientNo);
|
|
|
|
|
reportDto.setSerialnum(serialnum);
|
|
|
|
|
reportDto.setFileTitle(fileTitle);
|
|
|
|
|
reportDto.setDownUrl(downUrl);
|
|
|
|
|
reportDto.setAssortId(zdAssortId);
|
|
|
|
|
reportDto.setSysFlag(sender);
|
|
|
|
|
reportDto.setFileSource("1");
|
|
|
|
|
reportDto.setFilestoragetype("1");
|
|
|
|
|
return reportDto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ReportDto getReportDtoByInspectionUpdate(XmlUtil inspectionUpdateXmlUtil) {
|
|
|
|
|
Node senderNode = inspectionUpdateXmlUtil.getNode("/POOR_HIP1009/sender/device/id/item/@extension");
|
|
|
|
|
String sender = senderNode.getNodeValue();
|
|
|
|
|
String zdAssortId = ZdAssortConfig.getZdAssortId(sender);
|
|
|
|
|
if(Func.isBlank(zdAssortId)){
|
|
|
|
|
zdAssortId=ZdAssortConfig.getOtherAssortId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Node inpatientNoNode = inspectionUpdateXmlUtil.getNode("/POOR_HIP1009/controlActProcess/subject/recordTarget/patientRole/id[@root='2.16.156.10011.1.12']/@extension");
|
|
|
|
|
String inpatientNo = inpatientNoNode.getNodeValue();
|
|
|
|
|
|
|
|
|
|
Node admissTimesNode = inspectionUpdateXmlUtil.getNode("/POOR_HIP1009/controlActProcess/subject/recordTarget/patientRole/item[@root='1.2.156.112635.1.2.1.7']/@extension");
|
|
|
|
|
Integer admissTimes = Integer.valueOf(admissTimesNode.getNodeValue());
|
|
|
|
|
|
|
|
|
|
// 检查报告单号标识
|
|
|
|
|
Node reportFlagNode = inspectionUpdateXmlUtil.getNode("/POOR_HIP1009/controlActProcess/subject/recordTarget/patientRole/id[@root='2.16.156.10011.1.32']/@extension");
|
|
|
|
|
String reportFlag = reportFlagNode.getNodeValue();
|
|
|
|
|
//电子申请单编号
|
|
|
|
|
Node eafNoNode = inspectionUpdateXmlUtil.getNode("/POOR_HIP1009/controlActProcess/subject/recordTarget/patientRole/id[@root='2.16.156.10011.1.24']/@extension");
|
|
|
|
|
String eafNo = eafNoNode.getNodeValue();
|
|
|
|
|
String serialnum = reportFlag + "@" + eafNo;
|
|
|
|
|
|
|
|
|
|
// Node assortIdNode = inspectionUpdateXmlUtil.getNode("/POOR_HIP1009/controlActProcess/subject/component/structuredBody/component[@displayName='检查报告']/section/entry[@displayName='检查类型']/observation/code/@displayName");
|
|
|
|
|
// String assortId = assortIdNode.getNodeValue();
|
|
|
|
|
//
|
|
|
|
|
// Node sysFlagNode = inspectionUpdateXmlUtil.getNode("/POOR_HIP1009/controlActProcess/subject/component/structuredBody/component[@displayName='检查报告']/section/entry[@displayName='检查类型']/observation/code/@displayName");
|
|
|
|
|
// String sysFlag = sysFlagNode.getNodeValue();
|
|
|
|
|
|
|
|
|
|
Node fileTitleNode = inspectionUpdateXmlUtil.getNode("/POOR_HIP1009/controlActProcess/subject/component/structuredBody/component[@displayName='检查报告']/section/entry[@displayName='检查报告类型']/observation/code/@displayName");
|
|
|
|
|
String fileTitle = fileTitleNode.getNodeValue();
|
|
|
|
|
|
|
|
|
|
Node downUrlNode = inspectionUpdateXmlUtil.getNode("/POOR_HIP1009/controlActProcess/subject/component/structuredBody/component[@displayName='检查报告图像']/report/entry[@displayName='检查报告图像URL地址']/observation/value");
|
|
|
|
|
String downUrl = downUrlNode.getTextContent();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ReportDto reportDto = new ReportDto();
|
|
|
|
|
reportDto.setReportSn(reportFlag);
|
|
|
|
|
reportDto.setAdmisstimes(admissTimes);
|
|
|
|
|
reportDto.setInpatientNo(inpatientNo);
|
|
|
|
|
reportDto.setSerialnum(serialnum);
|
|
|
|
|
reportDto.setFileTitle(fileTitle);
|
|
|
|
|
reportDto.setDownUrl(downUrl);
|
|
|
|
|
reportDto.setAssortId(zdAssortId);
|
|
|
|
|
reportDto.setSysFlag(sender);
|
|
|
|
|
reportDto.setFileSource("1");
|
|
|
|
|
reportDto.setFilestoragetype("1");
|
|
|
|
|
return reportDto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 返回检查报告新增成功消息
|
|
|
|
|
*
|
|
|
|
|
* @param msgId 消息id
|
|
|
|
|
* @param sender 发送路由
|
|
|
|
|
* @param receiver 接收路由
|
|
|
|
|
* @return 新增成功消息响应
|
|
|
|
|
*/
|
|
|
|
|
public String insertSuccess(String msgId, String sender, String receiver) {
|
|
|
|
|
String createTime = Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI);
|
|
|
|
|
return "<MCCI_IN000002UV01 xmlns=\"urn:hl7-org:v3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ITSVersion=\"XML_1.0\" xsi:schemaLocation=\"urn:hl7-org:v3 file:///E:/hl7/HL7/v3ballot_fullsite_2011MAY/v3ballot/html/processable/multicacheschemas/MCCI _IN000002UV01.xsd\">" +
|
|
|
|
|
"<id extension=\""+IdUtil.standardUUID()+"\"/>" +
|
|
|
|
|
"<creationTime value=\""+createTime+"\"/>" +
|
|
|
|
|
"<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"MCCI_IN000002UV01\"/>" +
|
|
|
|
|
"<processingCode code=\"P\"/>" +
|
|
|
|
|
"<processingModeCode/>" +
|
|
|
|
|
"<acceptAckCode code=\"AL\"/>" +
|
|
|
|
|
"<receiver typeCode=\"RCV\">" +
|
|
|
|
|
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
"<id>" +
|
|
|
|
|
"<item extension=\"Orion-001\"/>" +
|
|
|
|
|
"</id>" +
|
|
|
|
|
"</device>" +
|
|
|
|
|
"</receiver>" +
|
|
|
|
|
"<sender typeCode=\"SND\">" +
|
|
|
|
|
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
"<id>" +
|
|
|
|
|
"<item extension=\"PaperlessManagementMRIS-001\"/>" +
|
|
|
|
|
"</id>" +
|
|
|
|
|
"</device>" +
|
|
|
|
|
"</sender>" +
|
|
|
|
|
"<acknowledgement typeCode=\"AA\">" +
|
|
|
|
|
"<targetMessage>" +
|
|
|
|
|
"<id extension=\""+msgId+"\"/>" +
|
|
|
|
|
"</targetMessage>" +
|
|
|
|
|
"<acknowledgementDetail>" +
|
|
|
|
|
"<text value=\"成功\"/>" +
|
|
|
|
|
"</acknowledgementDetail>" +
|
|
|
|
|
"</acknowledgement>" +
|
|
|
|
|
"</MCCI_IN000002UV01>";
|
|
|
|
|
// return "<MCCI_IN000002UV01 ITSVersion=\"XML_1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:hl7-org:v3 ../multicacheschemas/MCCI_IN000002UV01.xsd\" xmlns=\"urn:hl7-org:v3\">" +
|
|
|
|
|
// "<id root=\"2.16.156.10011.0\" extension=\"" + IdUtil.standardUUID() + "\"/>" +
|
|
|
|
|
// "<creationTime value=\"" + createTime + "\"/>" +
|
|
|
|
|
// "<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"MCCI_IN000002UV01\" displayable=\"true\"/>" +
|
|
|
|
|
// "<processingCode code=\"P\"/>" +
|
|
|
|
|
// "<processingModeCode/>" +
|
|
|
|
|
// "<acceptAckCode code=\"AL\"/>" +
|
|
|
|
|
// "<receiver typeCode=\"RCV\">" +
|
|
|
|
|
// "<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
// "<id>" +
|
|
|
|
|
// "<item root=\"2.16.156.10011.0.1.1\" extension=\"2.16.156.10011.0.1.1\"/>" +
|
|
|
|
|
// "</id>" +
|
|
|
|
|
// "</device>" +
|
|
|
|
|
// "</receiver>" +
|
|
|
|
|
// "<sender typeCode=\"SND\">" +
|
|
|
|
|
// "<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
// "<id>" +
|
|
|
|
|
// "<item root=\"2.16.156.10011.0.1.2\" extension=\"2.16.156.10011.0.1.2\"/>" +
|
|
|
|
|
// "</id>" +
|
|
|
|
|
// "</device>" +
|
|
|
|
|
// "</sender>" +
|
|
|
|
|
// "<acknowledgement typeCode=\"AA\">" +
|
|
|
|
|
// "<targetMessage>" +
|
|
|
|
|
// "<id root=\"2.16.156.10011.0\" extension=\"" + msgId + "\"/>" +
|
|
|
|
|
// "</targetMessage>" +
|
|
|
|
|
// "<acknowledgementDetail typeCode=\"I\">" +
|
|
|
|
|
// " <text value=\"成功!\"/> " +
|
|
|
|
|
// "</acknowledgementDetail>" +
|
|
|
|
|
// "</acknowledgement>" +
|
|
|
|
|
// "</MCCI_IN000002UV01>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 返回检查报告插入失败响应消息
|
|
|
|
|
*
|
|
|
|
|
* @param msgId 消息id
|
|
|
|
|
* @param sender 发送路由
|
|
|
|
|
* @param receiver 接收路由
|
|
|
|
|
* @return 检查报告新增失败响应消息
|
|
|
|
|
*/
|
|
|
|
|
public String insertFailed(String msgId, String sender, String receiver, String failedMessage) {
|
|
|
|
|
|
|
|
|
|
String createTime = Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI);
|
|
|
|
|
return "<MCCI_IN000002UV01 xmlns=\"urn:hl7-org:v3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ITSVersion=\"XML_1.0\" xsi:schemaLocation=\"urn:hl7-org:v3 file:///E:/hl7/HL7/v3ballot_fullsite_2011MAY/v3ballot/html/processable/multicacheschemas/MCCI _IN000002UV01.xsd\">" +
|
|
|
|
|
"<id extension=\""+IdUtil.standardUUID()+"\"/>" +
|
|
|
|
|
"<creationTime value=\""+createTime+"\"/>" +
|
|
|
|
|
"<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"MCCI_IN000002UV01\"/>" +
|
|
|
|
|
"<processingCode code=\"P\"/>" +
|
|
|
|
|
"<processingModeCode/>" +
|
|
|
|
|
"<acceptAckCode code=\"AL\"/>" +
|
|
|
|
|
"<receiver typeCode=\"RCV\">" +
|
|
|
|
|
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
"<id>" +
|
|
|
|
|
"<item extension=\"Orion-001\"/>" +
|
|
|
|
|
"</id>" +
|
|
|
|
|
"</device>" +
|
|
|
|
|
"</receiver>" +
|
|
|
|
|
"<sender typeCode=\"SND\">" +
|
|
|
|
|
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
"<id>" +
|
|
|
|
|
"<item extension=\"PaperlessManagementMRIS-001\"/>" +
|
|
|
|
|
"</id>" +
|
|
|
|
|
"</device>" +
|
|
|
|
|
"</sender>" +
|
|
|
|
|
"<acknowledgement typeCode=\"AE\">" +
|
|
|
|
|
"<targetMessage>" +
|
|
|
|
|
"<id extension=\""+msgId+"\"/>" +
|
|
|
|
|
"</targetMessage>" +
|
|
|
|
|
"<acknowledgementDetail>" +
|
|
|
|
|
"<text value=\""+failedMessage+"\"/>" +
|
|
|
|
|
"</acknowledgementDetail>" +
|
|
|
|
|
"</acknowledgement>" +
|
|
|
|
|
"</MCCI_IN000002UV01>";
|
|
|
|
|
// return "<MCCI_IN000002UV01 ITSVersion=\"XML_1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:hl7-org:v3 ../multicacheschemas/MCCI_IN000002UV01.xsd\" xmlns=\"urn:hl7-org:v3\">" +
|
|
|
|
|
// "<id root=\"2.16.156.10011.0\" extension=\"" + IdUtil.standardUUID() + "\"/>" +
|
|
|
|
|
// "<creationTime value=\"" + createTime + "\"/>" +
|
|
|
|
|
// "<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"MCCI_IN000002UV01\" displayable=\"true\"/>" +
|
|
|
|
|
// "<processingCode code=\"P\"/>" +
|
|
|
|
|
// "<processingModeCode/>" +
|
|
|
|
|
// "<acceptAckCode code=\"AL\"/>" +
|
|
|
|
|
// "<receiver typeCode=\"RCV\">" +
|
|
|
|
|
// "<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
// "<id>" +
|
|
|
|
|
// "<item root=\"2.16.156.10011.0.1.1\" extension=\"" + receiver + "\"/>" +
|
|
|
|
|
// "</id>" +
|
|
|
|
|
// "</device>" +
|
|
|
|
|
// "</receiver>" +
|
|
|
|
|
// "<sender typeCode=\"SND\">" +
|
|
|
|
|
// "<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
// "<id>" +
|
|
|
|
|
// "<item root=\"2.16.156.10011.0.1.2\" extension=\"" + sender + "\"/>" +
|
|
|
|
|
// "</id>" +
|
|
|
|
|
// "</device>" +
|
|
|
|
|
// "</sender>" +
|
|
|
|
|
// "<acknowledgement typeCode=\"AE\">" +
|
|
|
|
|
// "<targetMessage>" +
|
|
|
|
|
// "<id root=\"2.16.156.10011.0\" extension=\"" + msgId + "\"/>" +
|
|
|
|
|
// "</targetMessage>" +
|
|
|
|
|
// "<acknowledgementDetail typeCode=\"I\">" +
|
|
|
|
|
// " <text value=\""+failedMessage+"\"/> " +
|
|
|
|
|
// "</acknowledgementDetail>" +
|
|
|
|
|
// "</acknowledgement>" +
|
|
|
|
|
// "</MCCI_IN000002UV01>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 返回检查报告更新成功响应消息
|
|
|
|
|
*
|
|
|
|
|
* @param msgId 消息id
|
|
|
|
|
* @param sender 发送路由
|
|
|
|
|
* @param receiver 接收路由
|
|
|
|
|
* @return 更新成功响应消息
|
|
|
|
|
*/
|
|
|
|
|
public String updateSuccess(String msgId, String sender, String receiver) {
|
|
|
|
|
String createTime = Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI);
|
|
|
|
|
|
|
|
|
|
return "<MCCI_IN000002UV01 xmlns=\"urn:hl7-org:v3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ITSVersion=\"XML_1.0\" xsi:schemaLocation=\"urn:hl7-org:v3 file:///E:/hl7/HL7/v3ballot_fullsite_2011MAY/v3ballot/html/processable/multicacheschemas/MCCI _IN000002UV01.xsd\">" +
|
|
|
|
|
"<id extension=\""+IdUtil.standardUUID()+"\"/>" +
|
|
|
|
|
"<creationTime value=\""+createTime+"\"/>" +
|
|
|
|
|
"<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"MCCI_IN000002UV01\"/>" +
|
|
|
|
|
"<processingCode code=\"P\"/>" +
|
|
|
|
|
"<processingModeCode/>" +
|
|
|
|
|
"<acceptAckCode code=\"AL\"/>" +
|
|
|
|
|
"<receiver typeCode=\"RCV\">" +
|
|
|
|
|
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
"<id>" +
|
|
|
|
|
"<item extension=\"Orion-001\"/>" +
|
|
|
|
|
"</id>" +
|
|
|
|
|
"</device>" +
|
|
|
|
|
"</receiver>" +
|
|
|
|
|
"<sender typeCode=\"SND\">" +
|
|
|
|
|
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
"<id>" +
|
|
|
|
|
"<item extension=\"PaperlessManagementMRIS-001\"/>" +
|
|
|
|
|
"</id>" +
|
|
|
|
|
"</device>" +
|
|
|
|
|
"</sender>" +
|
|
|
|
|
"<acknowledgement typeCode=\"AA\">" +
|
|
|
|
|
"<targetMessage>" +
|
|
|
|
|
"<id extension=\""+msgId+"\"/>" +
|
|
|
|
|
"</targetMessage>" +
|
|
|
|
|
"<acknowledgementDetail>" +
|
|
|
|
|
"<text value=\"成功\"/>" +
|
|
|
|
|
"</acknowledgementDetail>" +
|
|
|
|
|
"</acknowledgement>" +
|
|
|
|
|
"</MCCI_IN000002UV01>";
|
|
|
|
|
|
|
|
|
|
// return "<MCCI_IN000002UV01 ITSVersion=\"XML_1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:hl7-org:v3 ../multicacheschemas/MCCI_IN000002UV01.xsd\" xmlns=\"urn:hl7-org:v3\">" +
|
|
|
|
|
// "<id root=\"2.16.156.10011.0\" extension=\"" + IdUtil.standardUUID() + "\"/>" +
|
|
|
|
|
// "<creationTime value=\"" + createTime + "\"/>" +
|
|
|
|
|
// "<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"MCCI_IN000002UV01\" displayable=\"true\"/>" +
|
|
|
|
|
// "<processingCode code=\"P\"/>" +
|
|
|
|
|
// "<processingModeCode/>" +
|
|
|
|
|
// "<acceptAckCode code=\"AL\"/>" +
|
|
|
|
|
// "<receiver typeCode=\"RCV\">" +
|
|
|
|
|
// "<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
// "<id>" +
|
|
|
|
|
// "<item root=\"2.16.156.10011.0.1.1\" extension=\"" + receiver + "\"/>" +
|
|
|
|
|
// "</id>" +
|
|
|
|
|
// "</device>" +
|
|
|
|
|
// "</receiver>" +
|
|
|
|
|
// "<sender typeCode=\"SND\">" +
|
|
|
|
|
// "<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
// "<id>" +
|
|
|
|
|
// "<item root=\"2.16.156.10011.0.1.2\" extension=\"" + sender + "\"/>" +
|
|
|
|
|
// "</id>" +
|
|
|
|
|
// "</device>" +
|
|
|
|
|
// "</sender>" +
|
|
|
|
|
// "<acknowledgement typeCode=\"AA\">" +
|
|
|
|
|
// "<targetMessage>" +
|
|
|
|
|
// "<id root=\"2.16.156.10011.0\" extension=\"" + msgId + "\"/>" +
|
|
|
|
|
// "</targetMessage>" +
|
|
|
|
|
// "<acknowledgementDetail typeCode=\"I\">" +
|
|
|
|
|
// " <text value=\"成功!\"/> " +
|
|
|
|
|
// "</acknowledgementDetail>" +
|
|
|
|
|
// "</acknowledgement>" +
|
|
|
|
|
// "</MCCI_IN000002UV01>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查报告更新失败响应
|
|
|
|
|
*
|
|
|
|
|
* @param msgId 消息id
|
|
|
|
|
* @param sender 发送路由
|
|
|
|
|
* @param receiver 接收路由
|
|
|
|
|
* @param failedMessage 失败信息
|
|
|
|
|
* @return 更新失败响应信息
|
|
|
|
|
*/
|
|
|
|
|
public String updateFailed(String msgId, String sender, String receiver, String failedMessage) {
|
|
|
|
|
String createTime = Func.format(new Date(), DateUtil.PATTERN_DATETIME_MINI);
|
|
|
|
|
return "<MCCI_IN000002UV01 xmlns=\"urn:hl7-org:v3\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ITSVersion=\"XML_1.0\" xsi:schemaLocation=\"urn:hl7-org:v3 file:///E:/hl7/HL7/v3ballot_fullsite_2011MAY/v3ballot/html/processable/multicacheschemas/MCCI _IN000002UV01.xsd\">" +
|
|
|
|
|
"<id extension=\""+IdUtil.standardUUID()+"\"/>" +
|
|
|
|
|
"<creationTime value=\""+createTime+"\"/>" +
|
|
|
|
|
"<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"MCCI_IN000002UV01\"/>" +
|
|
|
|
|
"<processingCode code=\"P\"/>" +
|
|
|
|
|
"<processingModeCode/>" +
|
|
|
|
|
"<acceptAckCode code=\"AL\"/>" +
|
|
|
|
|
"<receiver typeCode=\"RCV\">" +
|
|
|
|
|
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
"<id>" +
|
|
|
|
|
"<item extension=\"Orion-001\"/>" +
|
|
|
|
|
"</id>" +
|
|
|
|
|
"</device>" +
|
|
|
|
|
"</receiver>" +
|
|
|
|
|
"<sender typeCode=\"SND\">" +
|
|
|
|
|
"<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
"<id>" +
|
|
|
|
|
"<item extension=\"PaperlessManagementMRIS-001\"/>" +
|
|
|
|
|
"</id>" +
|
|
|
|
|
"</device>" +
|
|
|
|
|
"</sender>" +
|
|
|
|
|
"<acknowledgement typeCode=\"AE\">" +
|
|
|
|
|
"<targetMessage>" +
|
|
|
|
|
"<id extension=\""+msgId+"\"/>" +
|
|
|
|
|
"</targetMessage>" +
|
|
|
|
|
"<acknowledgementDetail>" +
|
|
|
|
|
"<text value=\""+failedMessage+"\"/>" +
|
|
|
|
|
"</acknowledgementDetail>" +
|
|
|
|
|
"</acknowledgement>" +
|
|
|
|
|
"</MCCI_IN000002UV01>";
|
|
|
|
|
|
|
|
|
|
// return "<MCCI_IN000002UV01 ITSVersion=\"XML_1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:hl7-org:v3 ../multicacheschemas/MCCI_IN000002UV01.xsd\" xmlns=\"urn:hl7-org:v3\">" +
|
|
|
|
|
// "<id root=\"2.16.156.10011.0\" extension=\"" + IdUtil.standardUUID() + "\"/>" +
|
|
|
|
|
// "<creationTime value=\"" + createTime + "\"/>" +
|
|
|
|
|
// "<interactionId root=\"2.16.840.1.113883.1.6\" extension=\"MCCI_IN000002UV01\" displayable=\"true\"/>" +
|
|
|
|
|
// "<processingCode code=\"P\"/>" +
|
|
|
|
|
// "<processingModeCode/>" +
|
|
|
|
|
// "<acceptAckCode code=\"AL\"/>" +
|
|
|
|
|
// "<receiver typeCode=\"RCV\">" +
|
|
|
|
|
// "<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
// "<id>" +
|
|
|
|
|
// "<item root=\"2.16.156.10011.0.1.1\" extension=\"" + receiver + "\"/>" +
|
|
|
|
|
// "</id>" +
|
|
|
|
|
// "</device>" +
|
|
|
|
|
// "</receiver>" +
|
|
|
|
|
// "<sender typeCode=\"SND\">" +
|
|
|
|
|
// "<device classCode=\"DEV\" determinerCode=\"INSTANCE\">" +
|
|
|
|
|
// "<id>" +
|
|
|
|
|
// "<item root=\"2.16.156.10011.0.1.2\" extension=\"" + sender + "\"/>" +
|
|
|
|
|
// "</id>" +
|
|
|
|
|
// "</device>" +
|
|
|
|
|
// "</sender>" +
|
|
|
|
|
// "<acknowledgement typeCode=\"AE\">" +
|
|
|
|
|
// "<targetMessage>" +
|
|
|
|
|
// "<id root=\"2.16.156.10011.0\" extension=\"" + msgId + "\"/>" +
|
|
|
|
|
// "</targetMessage>" +
|
|
|
|
|
// "<acknowledgementDetail typeCode=\"I\">" +
|
|
|
|
|
// " <text value=\""+failedMessage+"\"/> " +
|
|
|
|
|
// "</acknowledgementDetail>" +
|
|
|
|
|
// "</acknowledgement>" +
|
|
|
|
|
// "</MCCI_IN000002UV01>";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|