Przeglądaj źródła

恩泽:bug优化

wangsy 4 lat temu
rodzic
commit
65287e1b85

+ 21 - 7
structure-center/src/main/java/com/lantone/structure/facade/tran/ClinicBloodConsentDocTran.java

@@ -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 {
             "患者、患者家属或患者的法定监护人、授权委托人意见=患者/法定代理人意见",
             "医生签名=医师签名",
             "医生签名签名日期=医师签名日期时间",
+            "医生签名签名时间=医师签名日期时间",
             "患者/患者授权委托人签名=患者/法定代理人签名",
-            "患者/患者授权委托人签名签名日期=患者/法定代理人签名日期时间"
+            "患者/患者授权委托人签名签名日期=患者/法定代理人签名日期时间",
+            "住院号疾病介绍和治疗建议=疾病介绍和治疗建议",
+            "患者签名签名时间=患者/法定代理人签名日期时间"
     );
 }

+ 14 - 12
structure-center/src/main/java/com/lantone/structure/facade/tran/CriticallyIllNoticeDocTran.java

@@ -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;
@@ -20,31 +21,40 @@ public class CriticallyIllNoticeDocTran 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 dateStr = "";
+        text = text.replace("年   月   日   时   分", "").replace("年 月 日  时  分","");
         List<String> titles = CommonAnalysisUtil.sortTitles(
-                Lists.newArrayList("科别", "住院号", "入院日期", "入住院日期", "姓名", "性别", "年龄", "职业", "临床诊断", "病情概要", "病重情况", "病情危重情况", "主要抢救措施"),
+                Lists.newArrayList("科别", "住院号", "入院日期", "入住院日期", "姓名", "性别", "年龄", "职业", "临床诊断","病危通知书", "病情概要", "病重情况", "病情危重情况", "主要抢救措施"),
 //                        "病人家属签名", "关系", "时间", "签名日期", "通知时间", "经治医师"),
                 text
         );
-        text = text.replace("年   月   日   时   分", "");
         CommonAnalysisUtil.cutByTitles(text, titles, 0, sourceMap);
         List<String> keys = Lists.newArrayList("病情概要", "主要抢救措施");
         if (sourceMap != null) {
             if (sourceMap.containsKey("主要抢救措施")) {
                 dateStr = sourceMap.get("主要抢救措施");
                 sourceMap.put("主要抢救措施", dateStr.substring(0, Math.max(0, dateStr.indexOf("病人家属签名"))));
+            }else if(sourceMap.containsKey("病危通知书")){
+                dateStr = sourceMap.get("病危通知书");
+                sourceMap.put("病危通知书", dateStr.substring(0, Math.max(0, dateStr.indexOf("病人家属签名"))));
             }
             joinWord(sourceMap, keys);
             List<String> listTitle = Lists.newArrayList(
                     "病人家属签名", "关系", "签名日期", "通知时间", "经治医师", "科主任"
             );
             CommonAnalysisUtil.cutByTitlesNoColon(dateStr, listTitle, 0, sourceMap);
-            removeKey(sourceMap, "病情概要", "主要抢救措施");
+            CommonAnalysisUtil.removeKey(sourceMap, "病情概要", "主要抢救措施");
+            //判断日期是否正确
+
             disDate(sourceMap, "关系", "时间");
         }
         return sourceMap;
@@ -70,15 +80,6 @@ public class CriticallyIllNoticeDocTran extends TargetTran {
         sourceMap.put("病情概况及主要抢救措施", sb.toString());
     }
 
-    private void removeKey(Map<String, String> sourceMap, String... args) {
-        for (String dateStr : args) {
-            if (sourceMap.containsKey(dateStr)) {
-                sourceMap.remove(dateStr);
-            }
-        }
-    }
-
-
     private List<String> keyContrasts = Lists.newArrayList(
             "科别=病区名称",
             "科室=科室名称",
@@ -87,6 +88,7 @@ public class CriticallyIllNoticeDocTran extends TargetTran {
             "病床=病床号",
             "年龄=年龄(岁)",
             "病重情况=病危(重)通知内容",
+            "病危通知书=病危(重)通知内容",
             "病情危重情况=病危(重)通知内容",
             "通知时间=病危(重)通知日期时间",
             "病人家属签名=法定代理人签名",

+ 6 - 1
structure-center/src/main/java/com/lantone/structure/facade/tran/OperationInformedConsentDocTran.java

@@ -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,6 +23,10 @@ public class OperationInformedConsentDocTran 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;
     }
 
@@ -41,7 +46,7 @@ public class OperationInformedConsentDocTran extends TargetTran {
             disDate(sourceMap, "主刀医师签名", "八、患方意见");
             disDate(sourceMap, "主刀医师签名", "签名时间");
 
-            CommonAnalysisUtil.removeKey(sourceMap, "二、您的主刀医师是", "四、医师会用通俗易懂的语言向您解释");
+            CommonAnalysisUtil.removeKey(sourceMap, "二、您的主刀医师是", "四、医师会用通俗易懂的语言向您解释","3.特殊风险或主要高危因素");
         }
         return sourceMap;
     }