|
@@ -0,0 +1,83 @@
|
|
|
+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;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description: 特殊检查及特殊治疗同意书
|
|
|
+ * @author: wsy
|
|
|
+ * @time: 2021/3/11 14:49
|
|
|
+ */
|
|
|
+@Slf4j
|
|
|
+public class SpecialCureConsentDocTran extends TargetTran {
|
|
|
+ @Override
|
|
|
+ public Map<String, String> convert(String text) {
|
|
|
+ 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("姓名", "性别", "年龄", "科别", "床号","门诊号/住院号", "就诊/入院日期", "临床诊断", "康复治疗计划", "并发症及注意事项",
|
|
|
+ "医生签名", "治疗师签名", "患方签名", "患者家属签名(关系)"),
|
|
|
+ text
|
|
|
+ );
|
|
|
+ CommonAnalysisUtil.cutByTitles(text, titles, 0, sourceMap);
|
|
|
+// if (sourceMap != null) {
|
|
|
+// if (sourceMap.containsKey("医护人员陈述")) {
|
|
|
+// dataStr = sourceMap.get("医护人员陈述");
|
|
|
+// 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, "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])) {
|
|
|
+ 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("[::]", ""));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private List<String> keyContrasts = Lists.newArrayList(
|
|
|
+ "门诊号/住院号=住院号",
|
|
|
+ "姓名=患者姓名",
|
|
|
+ "年龄=年龄(岁)",
|
|
|
+ "床号=病床号",
|
|
|
+ "科别=病区名称",
|
|
|
+ "临床诊断=特殊检查及特殊治疗项目名称",
|
|
|
+ "康复治疗计划=特殊检查及特殊治疗目的",
|
|
|
+ "并发症及注意事项=特殊检查及特殊治疗可能引起的并发症及风险"
|
|
|
+ );
|
|
|
+}
|