@@ -14,4 +15,11 @@ import com.docus.server.report.entity.TBasic;
*/
public interface TBasicMapper{
+ /**
+ * 根据住院号和住院次数查询业务系统中病案主键
+ * @param inpatientNo 住院号
+ * @param admissTimes 住院次数
+ * @return 病案主键
+ */
+ String getPatientIdByInpatientNoAndAdminssTimes(@Param("inpatientNo") String inpatientNo,@Param("adminssTimes") Integer admissTimes);
}
diff --git a/src/main/java/com/docus/server/report/service/impl/ReportServiceImpl.java b/src/main/java/com/docus/server/report/service/impl/ReportServiceImpl.java
index bfe91ab..2c00cbb 100644
--- a/src/main/java/com/docus/server/report/service/impl/ReportServiceImpl.java
+++ b/src/main/java/com/docus/server/report/service/impl/ReportServiceImpl.java
@@ -1,14 +1,21 @@
package com.docus.server.report.service.impl;
+import com.docus.core.util.Func;
+import com.docus.infrastructure.redis.service.IdService;
import com.docus.server.report.dto.ReportDto;
+import com.docus.server.report.entity.AfCollectTask;
+import com.docus.server.report.entity.AfReportRecord;
import com.docus.server.report.event.ReportDownEvent;
+import com.docus.server.report.mapper.AfCollectTaskMapper;
+import com.docus.server.report.mapper.AfReportRecordMapper;
+import com.docus.server.report.mapper.TBasicMapper;
import com.docus.server.report.service.ReportService;
import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+
/**
* 报告服务实现类
* @author wyb
@@ -17,12 +24,66 @@ import org.springframework.stereotype.Service;
@Service
public class ReportServiceImpl implements ReportService {
- @Autowired
+ @Resource
private ApplicationContext applicationContext;
+ @Resource
+ private AfCollectTaskMapper collectTaskMapper;
+ @Resource
+ private AfReportRecordMapper afReportRecordMapper;
+ @Resource
+ private TBasicMapper tBasicMapper;
+ @Resource
+ private IdService idService;
@Override
public void report(ReportDto reportDto) {
+ String patientId=null;
+ try {
+ // 如果出现多条出错的情况,还是得保存收到的信息,人工干预处理
+ patientId=tBasicMapper.getPatientIdByInpatientNoAndAdminssTimes(reportDto.getInpatientNo(),reportDto.getAdmisstimes());
+ }catch (Exception ex){
+ log.error("查询病案主键出错了",ex);
+ }
+ // 不验证数据,始终保存收到的信息
+ AfReportRecord afReportRecord = afReportRecordMapper.getRecordBySerialnumAndInpatientNoAndSysFlag(reportDto.getSerialnum(),reportDto.getInpatientNo(),reportDto.getAdmisstimes(),reportDto.getSysFlag());
+ if(afReportRecord==null){
+ long id = idService.getDateSeq();
+ afReportRecord = new AfReportRecord(reportDto);
+ afReportRecord.setTaskId(id);
+ afReportRecord.setPatientId(patientId);
+ afReportRecordMapper.saveRecord(afReportRecord);
+ }else {
+ // 更新 主要更新 url
+ afReportRecord.setDownUrl(reportDto.getDownUrl());
+ afReportRecord.setDownType(reportDto.getDowntype());
+ afReportRecord.setFileName(reportDto.getFileTitle());
+ afReportRecord.setPatientId(patientId);
+ afReportRecordMapper.updateRecordByTaskId(afReportRecord);
+ }
+ // 不使用事务,不需要回滚上面的保存
+ // 根据记录中的任务id,查询是否需要新增任务
+ if(Func.isBlank(patientId)){
+ log.warn("病案号:{},住院次数:{} 未找到病案基础数据,暂不进行下载任务!",reportDto.getInpatientNo(),reportDto.getAdmisstimes());
+ return;
+ }
+ // 判断是否需要保存任务
+ AfCollectTask afCollectTask=collectTaskMapper.getTaskById(afReportRecord.getTaskId());
+ if(afCollectTask==null){
+ afCollectTask=new AfCollectTask();
+ afCollectTask.setId(afReportRecord.getTaskId());
+ afCollectTask.setC1(reportDto.getSerialnum());
+ afCollectTask.setC2(reportDto.getFileTitle());
+ afCollectTask.setC3(reportDto.getJzh());
+ afCollectTask.setPatientId(patientId);
+ afCollectTask.setSysflag(reportDto.getSysFlag());
+ afCollectTask.setState("0");
+ afCollectTask.setPatientId(patientId);
+ collectTaskMapper.saveTask(afCollectTask);
+ }
+ // 都成功后发布下载事件
+ reportDto.setTaskId(afReportRecord.getTaskId());
+ reportDto.setPatientId(patientId);
applicationContext.publishEvent(new ReportDownEvent(reportDto));
}
}
diff --git a/src/main/java/com/docus/server/report/webservice/IReportServer.java b/src/main/java/com/docus/server/report/webservice/IReportServer.java
index 853f9ee..99cc0ca 100644
--- a/src/main/java/com/docus/server/report/webservice/IReportServer.java
+++ b/src/main/java/com/docus/server/report/webservice/IReportServer.java
@@ -24,15 +24,15 @@ public interface IReportServer {
String pushICUReport(String icuReportMessage);
/**
- * 接收检查检验报告的信息 - 新增
- * @param inspectionReportMessage 检查检验报告信息 - 新增
+ * 接收检查报告的信息 - 新增
+ * @param inspectionReportMessage 检查报告信息 - 新增
* @return 成功或者异常信息
*/
String pushAddInspectionReport(String inspectionReportMessage);
/**
- * 接收检查检验报告的信息 - 更新
- * @param inspectionReportMessage 检查检验报告信息 -更新
+ * 接收检查报告的信息 - 更新
+ * @param inspectionReportMessage 检查报告信息 -更新
* @return 成功或者异常信息
*/
String pushUpdateInspectionReport(String inspectionReportMessage);
diff --git a/src/main/java/com/docus/server/report/webservice/impl/SdryReportServerImpl.java b/src/main/java/com/docus/server/report/webservice/impl/SdryReportServerImpl.java
index 8477272..c8a4b55 100644
--- a/src/main/java/com/docus/server/report/webservice/impl/SdryReportServerImpl.java
+++ b/src/main/java/com/docus/server/report/webservice/impl/SdryReportServerImpl.java
@@ -1,20 +1,23 @@
package com.docus.server.report.webservice.impl;
import com.alibaba.fastjson.JSONObject;
+import com.docus.core.util.DateUtil;
import com.docus.core.util.Func;
import com.docus.infrastructure.core.exception.BaseException;
import com.docus.server.report.dto.ReportDto;
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 lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+import javax.annotation.Resource;
+import java.util.Date;
+
/**
* @author wyb
* @date 2023年3月3日13:42:36
@@ -23,7 +26,7 @@ import org.w3c.dom.Node;
@Slf4j
public class SdryReportServerImpl implements IReportServer {
- @Autowired
+ @Resource
private ReportService reportService;
@Override
@@ -36,6 +39,7 @@ public class SdryReportServerImpl implements IReportServer {
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) {
@@ -47,18 +51,6 @@ public class SdryReportServerImpl implements IReportServer {
}
}
- public static void main(String[] args) {
- TableJsonRead jsonRead = new TableJsonRead();
- JSONObject jsonObject = jsonRead.Read("data-config", "js-table-type.json", JSONObject.class);
- String jsReportConfigXml = jsonRead.ReadContent("data-config", "js-report-config.xml");
- XmlUtil of = XmlUtil.of(jsReportConfigXml);
- Node node = of.getNode("/REPORT/ASSORT_ID");
- System.out.println(node.getTextContent());
- System.out.println(node.getNodeValue());
- NamedNodeMap attributes = node.getAttributes();
- System.out.println(attributes.getNamedItem("value").getNodeValue());
-
- }
/**
* 嘉时自定义接收接口使用,从xml工具读取返回文件上报需要的数据
@@ -72,48 +64,48 @@ public class SdryReportServerImpl implements IReportServer {
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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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();
+ Node assortIdXpathNode = configXmlUtil.getNode("/REPORT/ASSORT_ID");
+ String assortIdXpath = assortIdXpathNode.getTextContent();
String assortId;
- if (Func.isBlank(assortIdXPath)) {
+ if (Func.isBlank(assortIdXpath)) {
// 如果没有配置 取value 属性,如果value也未配置 取 tableType 对应的json配置,最终方案默认 other 分段
- Node assortIdValueNode = assortIdXPathNode.getAttributes().getNamedItem("value");
+ Node assortIdValueNode = assortIdXpathNode.getAttributes().getNamedItem("value");
if (Func.isEmpty(assortIdValueNode)) {
assortId = assortIdValueNode.getNodeValue();
} else {
@@ -123,20 +115,20 @@ public class SdryReportServerImpl implements IReportServer {
assortId = tableTypeJson.getString("other");
}
} else {
- Node assortIdNode = xmlUtil.getNode(assortIdXPath);
+ Node assortIdNode = xmlUtil.getNode(assortIdXpath);
assortId = assortIdNode.getTextContent();
}
- Node sysFlagXPathNode = configXmlUtil.getNode("/REPORT/SYSTEM_FLAG");
- String sysFlagXPath = sysFlagXPathNode.getTextContent();
- Node sysFlagNode = xmlUtil.getNode(sysFlagXPath);
+ 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();
+ Node fileSourceXpathNode = configXmlUtil.getNode("/REPORT/FILESOURCE");
+ String fileSourceXpath = fileSourceXpathNode.getTextContent();
String fileSource;
- if (Func.isBlank(fileSourceXPath)) {
- Node fileSourceValueNode = fileSourceXPathNode.getAttributes().getNamedItem("value");
+ if (Func.isBlank(fileSourceXpath)) {
+ Node fileSourceValueNode = fileSourceXpathNode.getAttributes().getNamedItem("value");
if (Func.isEmpty(fileSourceValueNode)) {
fileSource = null;
} else {
@@ -144,16 +136,16 @@ public class SdryReportServerImpl implements IReportServer {
}
} else {
- Node fileSourceNode = xmlUtil.getNode(fileSourceXPath);
+ Node fileSourceNode = xmlUtil.getNode(fileSourceXpath);
fileSource = fileSourceNode.getTextContent();
}
- Node fileStorageTypeXPathNode = configXmlUtil.getNode("/REPORT/FILE_STORAGE_TYPE");
- String fileStorageTypeXPath = fileStorageTypeXPathNode.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.isBlank(fileStorageTypeXpath)) {
+ Node filestoragetypeValueNode = fileStorageTypeXpathNode.getAttributes().getNamedItem("value");
if (Func.isEmpty(filestoragetypeValueNode)) {
fileStorageType = "1";
} else {
@@ -161,7 +153,7 @@ public class SdryReportServerImpl implements IReportServer {
}
} else {
- Node filestoragetypeNode = xmlUtil.getNode(fileStorageTypeXPath);
+ Node filestoragetypeNode = xmlUtil.getNode(fileStorageTypeXpath);
fileStorageType = filestoragetypeNode.getTextContent();
}
@@ -188,6 +180,7 @@ public class SdryReportServerImpl implements IReportServer {
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) {
@@ -201,37 +194,336 @@ public class SdryReportServerImpl implements IReportServer {
@Override
public String pushAddInspectionReport(String inspectionReportMessage) {
- log.info("收到检查检验报告新增消息:{}", inspectionReportMessage);
+ log.info("收到检查报告新增消息:{}", inspectionReportMessage);
+ String msgId = "";
+ String sender = "";
+ String receiver = "";
try {
XmlUtil xmlUtil = XmlUtil.of(inspectionReportMessage);
- Node msgNode = xmlUtil.getNode("/Request/Msg/ID");
+ 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();
+ ReportDto reportDto = getReportDtoByInspectionInsert(xmlUtil);
+ 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 null;
}
+
@Override
public String pushUpdateInspectionReport(String inspectionReportMessage) {
- log.info("收到检查检验报告更新消息{}", inspectionReportMessage);
+ log.info("收到检查报告更新消息{}", inspectionReportMessage);
+ String msgId = "";
+ String sender = "";
+ String receiver = "";
try {
XmlUtil xmlUtil = XmlUtil.of(inspectionReportMessage);
- Node msgNode = xmlUtil.getNode("");
- msgNode.getTextContent();
-
+ 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 insertFailed(msgId, sender, receiver, baseException.getMessage());
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
+ return insertFailed(msgId, sender, receiver, "系统错误");
+ }
+
+ }
+
+ /**
+ * 验证上报文件的信息
+ *
+ * @param reportDto 上报文件的信息
+ * @throws BaseException 验证不通过抛出业务异常
+ */
+ private void verifyReportDto(ReportDto reportDto) throws BaseException {
+ if (Func.isBlank(reportDto.getInpatientNo())) {
+ throw new BaseException("住院号不能为空!");
}
- return null;
+
+ 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("文件下载路径不能为空!");
+ }
+ }
+
+ public ReportDto getReportDtoByInspectionInsert(XmlUtil inspectionInsertXmlUtil) {
+
+ 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.setAdmisstimes(admissTimes);
+ reportDto.setInpatientNo(inpatientNo);
+ reportDto.setSerialnum(serialnum);
+ reportDto.setFileTitle(fileTitle);
+ reportDto.setDownUrl(downUrl);
+ reportDto.setAssortId(assortId);
+ reportDto.setSysFlag(sysFlag);
+ reportDto.setFileSource("1");
+ reportDto.setFilestoragetype("1");
+ return reportDto;
+ }
+
+ public ReportDto getReportDtoByInspectionUpdate(XmlUtil inspectionUpdateXmlUtil) {
+ 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.setAdmisstimes(admissTimes);
+ reportDto.setInpatientNo(inpatientNo);
+ reportDto.setSerialnum(serialnum);
+ reportDto.setFileTitle(fileTitle);
+ reportDto.setDownUrl(downUrl);
+ reportDto.setAssortId(assortId);
+ reportDto.setSysFlag(sysFlag);
+ 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 "\n" +
+ "\t\t
\n" +
+ "\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t\n" +
+ "\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t\n" +
+ "\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t\t\t\n" +
+ "\t\t\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t\t\t\t\n" +
+ "\t\t\t\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t\t\t\t\t\n" +
+ "\t\t\t\t\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t\t
\n" +
+ "\t\t\t\t\t\t\t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