|
@@ -3,6 +3,7 @@ package com.lantone.qc.trans.ywzxyy.util;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Maps;
|
|
import com.google.common.collect.Maps;
|
|
import com.lantone.qc.dbanaly.facade.ywzxyy.YwzxyyXmlUtil;
|
|
import com.lantone.qc.dbanaly.facade.ywzxyy.YwzxyyXmlUtil;
|
|
|
|
+import com.lantone.qc.pub.util.StringUtil;
|
|
import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
|
|
import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
@@ -22,9 +23,36 @@ public class YwzxyyCriticallyIllNoticeXmlAnalysis implements YwzxyyXmlAnalysis {
|
|
Map<String, String> level1StructureMap = Maps.newHashMap();
|
|
Map<String, String> level1StructureMap = Maps.newHashMap();
|
|
try {
|
|
try {
|
|
String xml = args[0];
|
|
String xml = args[0];
|
|
- String level1Text = YwzxyyXmlUtil.bcXmlAna(xml);
|
|
|
|
- List<String> level1Titles = CommonAnalysisUtil.sortTitles(Lists.newArrayList("原始文本"), level1Text);
|
|
|
|
|
|
+ String level1Text = YwzxyyXmlUtil.xml2Txt(xml);
|
|
|
|
+ level1Text = level1Text.replace("目前患者病情危重,且病情有进一步恶化可能", "通知内容:目前患者病情危重,且病情有进一步恶化可能")
|
|
|
|
+ .replace("我的医师已经告知患者目前病情", "代理人意见:我的医师已经告知患者目前病情")
|
|
|
|
+ .replace("如果患者无法签署知情同意书,请代理人在此签名。", "代理人提醒:如果患者无法签署知情同意书,请代理人在此签名。");
|
|
|
|
+ level1Text = StringUtil.matRegx(level1Text, "(谈话医师签名)[\\s\\S]*(患者签名|患者或代理人签名)", "签名时间", "谈话医师签名时间");
|
|
|
|
+ level1Text = StringUtil.matRegx(level1Text, "(患者签名)[\\s\\S]*(代理人签名)", "签名时间", "患者签名时间");
|
|
|
|
+ level1Text = StringUtil.matRegx(level1Text, "(与患者的关系)[\\s\\S]*(签名时间)", "签名时间", "代理人签名时间");
|
|
|
|
+ level1Text = StringUtil.matRegx(level1Text, "(患者或代理人签名)[\\s\\S]*(签名时间)", "签名时间", "患者或代理人签名时间");
|
|
|
|
+ List<String> level1Titles = CommonAnalysisUtil.sortTitles(
|
|
|
|
+ Lists.newArrayList("目前诊断", "目前病情", "病危(重)通知日期时间", "通知内容", "抢救措施",
|
|
|
|
+ "谈话医师签名", "谈话医师签名时间", "患者签名", "患者签名时间", "患者或代理人签名", "患者或代理人签名时间",
|
|
|
|
+ "代理人签名", "与患者的关系", "与患者关系", "代理人签名时间", "代理人意见", "代理人提醒"),
|
|
|
|
+ level1Text
|
|
|
|
+ );
|
|
CommonAnalysisUtil.cutByTitles(level1Text, level1Titles, 0, level1StructureMap);
|
|
CommonAnalysisUtil.cutByTitles(level1Text, level1Titles, 0, level1StructureMap);
|
|
|
|
+ if (StringUtil.isBlank(level1StructureMap.get("患者或代理人签名"))
|
|
|
|
+ && (StringUtil.isBlank(level1StructureMap.get("患者或代理人签名时间"))
|
|
|
|
+ || StringUtil.removeBlank(level1StructureMap.get("患者或代理人签名时间")).equals("年月日时分"))) {
|
|
|
|
+ if (StringUtil.isNotBlank(level1StructureMap.get("患者签名"))
|
|
|
|
+ || (StringUtil.isNotBlank(level1StructureMap.get("患者签名时间"))
|
|
|
|
+ && !StringUtil.removeBlank(level1StructureMap.get("患者签名时间")).equals("年月日时分"))) {
|
|
|
|
+ level1StructureMap.put("患者或代理人签名", level1StructureMap.get("患者签名"));
|
|
|
|
+ level1StructureMap.put("患者或代理人签名时间", level1StructureMap.get("患者签名时间"));
|
|
|
|
+ } else if (StringUtil.isNotBlank(level1StructureMap.get("代理人签名"))
|
|
|
|
+ || (StringUtil.isNotBlank(level1StructureMap.get("代理人签名时间"))
|
|
|
|
+ && !StringUtil.removeBlank(level1StructureMap.get("代理人签名时间")).equals("年月日时分"))) {
|
|
|
|
+ level1StructureMap.put("患者或代理人签名", level1StructureMap.get("代理人签名"));
|
|
|
|
+ level1StructureMap.put("患者或代理人签名时间", level1StructureMap.get("代理人签名时间"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|
|
}
|
|
}
|