|
|
|
@ -4,6 +4,7 @@ import com.docus.core.util.DateUtil;
|
|
|
|
|
import com.docus.core.util.Func;
|
|
|
|
|
import com.docus.infrastructure.core.exception.BaseException;
|
|
|
|
|
import com.docus.infrastructure.redis.service.RedisOps;
|
|
|
|
|
import com.docus.server.collection.mapper.TBasicMapper;
|
|
|
|
|
import com.docus.server.report.api.ShunDePeopleService;
|
|
|
|
|
import com.docus.server.report.api.dto.ReportDto;
|
|
|
|
|
import com.docus.server.report.config.SdRyReportHandledConfig;
|
|
|
|
@ -21,6 +22,7 @@ import org.w3c.dom.Node;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* HIP1008-检查报告新增服务处理
|
|
|
|
@ -38,6 +40,8 @@ public class HIP1008InspectionReportAdditionHandler implements WebserviceReceive
|
|
|
|
|
private ReportJob reportJob;
|
|
|
|
|
@Resource
|
|
|
|
|
private RedisOps redisOps;
|
|
|
|
|
@Resource
|
|
|
|
|
private TBasicMapper tBasicMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -145,6 +149,7 @@ public class HIP1008InspectionReportAdditionHandler implements WebserviceReceive
|
|
|
|
|
return reportDto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ReportDto getReportDtoByInspectionInsert(XmlUtil inspectionInsertXmlUtil) {
|
|
|
|
|
Node senderNode = inspectionInsertXmlUtil.getNode("/POOR_HIP1008/sender/device/id/item/@extension");
|
|
|
|
|
String sender = senderNode.getNodeValue();
|
|
|
|
@ -157,7 +162,13 @@ public class HIP1008InspectionReportAdditionHandler implements WebserviceReceive
|
|
|
|
|
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());
|
|
|
|
|
Integer admissTimes;
|
|
|
|
|
try {
|
|
|
|
|
admissTimes = Integer.valueOf(admissTimesNode.getNodeValue());
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
log.error(ex.getMessage(), ex);
|
|
|
|
|
admissTimes = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查报告单号标识
|
|
|
|
|
Node reportFlagNode = inspectionInsertXmlUtil.getNode("/POOR_HIP1008/controlActProcess/subject/recordTarget/patientRole/id[@root='2.16.156.10011.1.32']/@extension");
|
|
|
|
@ -171,6 +182,28 @@ public class HIP1008InspectionReportAdditionHandler implements WebserviceReceive
|
|
|
|
|
String[] split = reportFlag.split("_");
|
|
|
|
|
serialnum = split[0];
|
|
|
|
|
}
|
|
|
|
|
// 如果是手工单,住院次数可能为空,则需要根据检查报告时间与出入院区间获取住院次数
|
|
|
|
|
// todo 实施手工单需求确认
|
|
|
|
|
if (admissTimes == null && isManualDocuments(eafNo)) {
|
|
|
|
|
//检查报告日期 yyyyMMddHHmmss
|
|
|
|
|
String pattern = "yyyyMMddHHmmss";
|
|
|
|
|
Node reportTimeNode = inspectionInsertXmlUtil.getNode("/POOR_HIP1008/controlActProcess/subject/author/time/@value");
|
|
|
|
|
String reportTime = reportTimeNode.getNodeValue();
|
|
|
|
|
Date reportDate = Func.parseDate(reportTime, pattern);
|
|
|
|
|
String formatDateTime = Func.formatDateTime(reportDate);
|
|
|
|
|
List<Integer> admissTimesList = tBasicMapper.getAdmissTimesByInpNoAndReportTime(inpatientNo, formatDateTime);
|
|
|
|
|
if (Func.isEmpty(admissTimesList)) {
|
|
|
|
|
log.warn("住院号:{},报告时间:{} 根据住院号与出入院日期匹配患者基础数据失败!", inpatientNo, formatDateTime);
|
|
|
|
|
} else if (admissTimesList.size() > 1) {
|
|
|
|
|
log.warn("住院号:{},报告时间:{} 根据住院号与出入院日期匹配患者基础数据失败,有多条!", inpatientNo, formatDateTime);
|
|
|
|
|
} else {
|
|
|
|
|
admissTimes = admissTimesList.get(0);
|
|
|
|
|
if (admissTimes == null) {
|
|
|
|
|
log.warn("住院号:{},报告时间:{} 根据住院号与出入院日期匹配患者基础数据,住院次数为空!", inpatientNo, formatDateTime);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Node assortIdNode = inspectionInsertXmlUtil.getNode("/POOR_HIP1008/controlActProcess/subject/component/structuredBody/component[@displayName='检查报告']/section/entry[@displayName='检查类型']/observation/code/@displayName");
|
|
|
|
|
// String assortId = assortIdNode.getNodeValue();
|
|
|
|
@ -199,6 +232,19 @@ public class HIP1008InspectionReportAdditionHandler implements WebserviceReceive
|
|
|
|
|
return reportDto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据电子申请单号判断是否手工单
|
|
|
|
|
*
|
|
|
|
|
* @param eafNo 电子申请单号
|
|
|
|
|
* @return boolean
|
|
|
|
|
* @date 2024/1/9 14:38
|
|
|
|
|
* @author YongBin Wen
|
|
|
|
|
*/
|
|
|
|
|
private boolean isManualDocuments(String eafNo) {
|
|
|
|
|
return Func.isBlank(eafNo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 返回检查报告新增成功消息
|
|
|
|
|
*
|
|
|
|
|