|
@@ -2,6 +2,7 @@ package com.lantone.structure.facade.tran;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
+import com.lantone.common.util.StringUtil;
|
|
|
import com.lantone.structure.facade.tran.util.CommonAnalysisUtil;
|
|
|
import com.lantone.structure.util.MapUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -22,14 +23,20 @@ public class ClinicBloodConsentDocTran extends TargetTran {
|
|
|
Map<String, String> structureMap = cutWord(text);
|
|
|
Map<String, String> retMap = new HashMap<String, String>();
|
|
|
CommonAnalysisUtil.mapKeyContrastCommon(structureMap, keyContrasts, retMap);
|
|
|
+ retMap.entrySet().removeIf(entry -> StringUtil.isBlank(entry.getValue()));
|
|
|
+ retMap.entrySet().removeIf(entry ->
|
|
|
+ !entry.getValue().matches("\\d") && ("患者/法定代理人签名日期时间".equals(entry.getKey()) || "医师签名日期时间".equals(entry.getKey()))
|
|
|
+ );
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
private Map<String, String> cutWord(String text) {
|
|
|
Map<String, String> sourceMap = Maps.newHashMap();
|
|
|
String dataStr = "";
|
|
|
+ text = text.replace("年 月 日 时 分", "").replace("如果患者无法签署知情同意书,请其授权的亲属在此签名:", "");
|
|
|
List<String> titles = CommonAnalysisUtil.sortTitles(
|
|
|
- Lists.newArrayList("姓名", "性别", "年龄", "床号", "病历号", "疾病介绍和治疗建议", "1.患者基本情况", "诊断", "输血前检查", "2.拟使用的血液制品","2.我理解此治疗可能发生的风险",
|
|
|
+ Lists.newArrayList("姓名", "性别", "年龄", "住院号", "床号", "病历号", "疾病介绍和治疗建议", "1.患者基本情况", "⒈患者基本情况", "(4)\t输血前检查",
|
|
|
+ "输血前检查", "2.拟使用的血液制品", "⒉拟实施的输血方案", "治疗潜在风险和对策", "2.我理解此治疗可能发生的风险",
|
|
|
"医护人员陈述"),
|
|
|
text
|
|
|
);
|
|
@@ -40,22 +47,26 @@ public class ClinicBloodConsentDocTran extends TargetTran {
|
|
|
sourceMap.put("医护人员陈述", dataStr.substring(0, Math.max(0, dataStr.indexOf("医生签名"))));
|
|
|
}
|
|
|
List<String> listTitle = Lists.newArrayList(
|
|
|
- "医生签名", "患者/患者授权委托人签名", "患者、患者家属或患者的法定监护人、授权委托人意见", "患者/患者授权委托人签名", "患者/患者授权委托人签名"
|
|
|
+ "医生签名", "患者、患者家属或患者的法定监护人、授权委托人意见", "患者/患者授权委托人签名", "患者签名", "代理人签名", "与患者关系"
|
|
|
);
|
|
|
+ CommonAnalysisUtil.sortTitlesNoColon(listTitle, dataStr);
|
|
|
CommonAnalysisUtil.cutByTitlesNoColon(dataStr, listTitle, 0, sourceMap);
|
|
|
- CommonAnalysisUtil.removeKey(sourceMap, "病情概要", "主要抢救措施");
|
|
|
+ CommonAnalysisUtil.removeKey(sourceMap, "1.患者基本情况", "2.拟使用的血液制品", "⒈患者基本情况", "⒉拟实施的输血方案", "与患者关系");
|
|
|
+ disDate(sourceMap, "住院号", "疾病介绍和治疗建议");
|
|
|
disDate(sourceMap, "医生签名", "签名日期");
|
|
|
+ disDate(sourceMap, "医生签名", "签名时间");
|
|
|
disDate(sourceMap, "患者/患者授权委托人签名", "签名日期");
|
|
|
+ disDate(sourceMap, "患者签名", "签名时间");
|
|
|
}
|
|
|
return sourceMap;
|
|
|
}
|
|
|
|
|
|
private void disDate(Map sourceMap, String... args) {
|
|
|
Map<String, String> sourceMap_ = MapUtil.copyMap(sourceMap);
|
|
|
- if(sourceMap.containsKey(args[0]) && sourceMap_.get(args[0]).contains(args[1])){
|
|
|
+ if (sourceMap.containsKey(args[0]) && sourceMap_.get(args[0]).contains(args[1])) {
|
|
|
int index = sourceMap_.get(args[0]).indexOf(args[1]);
|
|
|
- sourceMap.put(args[0],sourceMap_.get(args[0]).substring(0,index));
|
|
|
- sourceMap.put(args[0]+args[1],sourceMap_.get(args[0]).substring(index).replace(args[1],"").replaceAll("[::]",""));
|
|
|
+ sourceMap.put(args[0], sourceMap_.get(args[0]).substring(0, index));
|
|
|
+ sourceMap.put(args[0] + args[1], sourceMap_.get(args[0]).substring(index).replace(args[1], "").replaceAll("[::]", ""));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -71,7 +82,10 @@ public class ClinicBloodConsentDocTran extends TargetTran {
|
|
|
"患者、患者家属或患者的法定监护人、授权委托人意见=患者/法定代理人意见",
|
|
|
"医生签名=医师签名",
|
|
|
"医生签名签名日期=医师签名日期时间",
|
|
|
+ "医生签名签名时间=医师签名日期时间",
|
|
|
"患者/患者授权委托人签名=患者/法定代理人签名",
|
|
|
- "患者/患者授权委托人签名签名日期=患者/法定代理人签名日期时间"
|
|
|
+ "患者/患者授权委托人签名签名日期=患者/法定代理人签名日期时间",
|
|
|
+ "住院号疾病介绍和治疗建议=疾病介绍和治疗建议",
|
|
|
+ "患者签名签名时间=患者/法定代理人签名日期时间"
|
|
|
);
|
|
|
}
|