Browse Source

北仑术前讨论小结医生签名不存在时处理

wangsy 4 năm trước cách đây
mục cha
commit
0d570fc2d6

+ 11 - 7
trans/src/main/java/com/lantone/qc/trans/beilun/util/BeiLunPreoperativeHtmlAnalysis.java

@@ -2,6 +2,7 @@ package com.lantone.qc.trans.beilun.util;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import com.lantone.qc.pub.util.StringUtil;
 import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
@@ -46,10 +47,12 @@ public class BeiLunPreoperativeHtmlAnalysis implements BeiLunHtmlAnalysis {
 
         int index1 = text.lastIndexOf("经治医生签名");
         int index2 = text.lastIndexOf("主刀医生签名");
-        text = text.substring(0, index1).replace("(如高血压病、冠心病、糖尿病、脑梗、心梗、心肺肝肾功能不全,口服抗凝药", "")
-                .replace("等)", "").replace("(如腹腔镜可能改开腹等)", "")
-                + text.substring(index1, index2).replace("签字时间", "经治医生签字时间").replace("年月日时分", "")
-                + text.substring(index2).replace("签字时间", "主刀医生签字时间").replace("年月日时分", "");
+        if (index1 != -1 && index2 != -1) {
+            text = text.substring(0, index1).replace("(如高血压病、冠心病、糖尿病、脑梗、心梗、心肺肝肾功能不全,口服抗凝药", "")
+                    .replace("等)", "").replace("(如腹腔镜可能改开腹等)", "")
+                    + text.substring(index1, index2).replace("签字时间", "经治医生签字时间").replace("年月日时分", "")
+                    + text.substring(index2).replace("签字时间", "主刀医生签字时间").replace("年月日时分", "");
+        }
         text = text.replace("术前讨论及术前小结", "").replace("讨论结论:", "");
         List<String> titles = Lists.newArrayList("姓名", "性别", "出生日期", "出生年月", "科别", "科室", "病区", "床号", "床位", "住院号",
                 "讨论时间", "讨论方式", "参加人员", "简要病情", "具体讨论意见",
@@ -57,7 +60,8 @@ public class BeiLunPreoperativeHtmlAnalysis implements BeiLunHtmlAnalysis {
                 "5.本次手术是否属于计划性多次手术",
                 "5.拟施麻醉方式", "6.术前特殊准备", "7.主要术中、术后风险及防范措施", "8.术中、术后注意事项(含护理事项)",
                 "6.拟施麻醉方式", "7.术前特殊准备", "8.主要术中、术后风险及防范措施", "9.术中、术后注意事项(含护理事项)",
-                "经治医生签名", "经治医生签字时间", "主刀医生签名", "主刀医生签字时间");
+                "术前诊断", "手术指征", "拟施手术名称及方式", "拟施麻醉方式", "其他术前相关情况", "注意事项",
+                "经治医生签名", "经治医生签字时间", "主刀医生签名", "医生签名", "主刀医生签字时间", "签字时间");
         CommonAnalysisUtil.cutByTitles(text, titles, 0, map);
         CommonAnalysisUtil.processType(map, "5.计划性多次手术");
         CommonAnalysisUtil.processType(map, "5.本次手术是否属于计划性多次手术");
@@ -75,10 +79,10 @@ public class BeiLunPreoperativeHtmlAnalysis implements BeiLunHtmlAnalysis {
     private void signatureTime(Map<String, String> map) {
         String goCureDoctor = map.get("经治医生签字时间");
         String operateDoctor = map.get("主刀医生签字时间");
-        if (goCureDoctor.contains("年 月 日 时 分")) {
+        if (StringUtil.isNotBlank(goCureDoctor) && goCureDoctor.contains("年 月 日 时 分")) {
             map.put("经治医生签字时间", goCureDoctor.replace("年 月 日 时 分", ""));
         }
-        if (operateDoctor.contains("年 月 日 时 分")) {
+        if (StringUtil.isNotBlank(operateDoctor) && operateDoctor.contains("年 月 日 时 分")) {
             map.put("主刀医生签字时间", operateDoctor.replace("年 月 日 时 分", ""));
         }
     }