Explorar el Código

余杭三院文书初步解析完成

licy hace 3 años
padre
commit
64923953c4
Se han modificado 19 ficheros con 997 adiciones y 481 borrados
  1. 50 111
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyBeHospitalizedHtmlAnalysis.java
  2. 7 19
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyConsultationRecordHtmlAnalysis.java
  3. 17 16
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyCrisisValueReportHtmlAnalysis.java
  4. 36 8
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyCriticallyIllNoticeHtmlAnalysis.java
  5. 10 13
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyDeathCaseDiscussHtmlAnalysis.java
  6. 18 7
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyDeathRecordHtmlAnalysis.java
  7. 7 38
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyDifficultCaseDiscussHtmlAnalysis.java
  8. 7 44
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyFirstCourseRecordHtmlAnalysis.java
  9. 54 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyHtmlAnalysisUtil.java
  10. 16 17
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyLeaveHospitalHtmlAnalysis.java
  11. 24 22
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyOperationHtmlAnalysis.java
  12. 27 48
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyOperationRecordHtmlAnalysis.java
  13. 27 43
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyPreoperativeHtmlAnalysis.java
  14. 25 16
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyRescueHtmlAnalysis.java
  15. 7 20
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyStagesSummaryHtmlAnalysis.java
  16. 7 10
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyThreeLevelWardHtmlAnalysis.java
  17. 9 20
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyTransferIntoHtmlAnalysis.java
  18. 8 29
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyTransferOutHtmlAnalysis.java
  19. 641 0
      trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/comsis/YuhangsyCommonAnalysisUtil.java

+ 50 - 111
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyBeHospitalizedHtmlAnalysis.java

@@ -3,8 +3,11 @@ package com.lantone.qc.trans.yuhangsy.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.changshaxy.util.XyHtmlAnalysisUtil;
 import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
@@ -46,128 +49,64 @@ public class YuhangsyBeHospitalizedHtmlAnalysis implements YuhangsyHtmlAnalysis
     }
 
     //一般模板
-    private void analysisGeneral(Document doc, String recTitle, Map<String, String> map) {
-        //个人基础信息table解析
-        YuhangsyHtmlAnalysisUtil.tableStyle1InsertMap(doc.getElementById("table1"), map);
-        //主诉、现病史等table解析
-        YuhangsyHtmlAnalysisUtil.tableStyle2InsertMap(doc.getElementById("table6"), map);
-        if (StringUtil.isNotBlank(map.get("婚育史月经史")) && map.get("婚育史月经史").contains("经期")) {
-            map.put("婚育史", map.get("婚育史月经史").substring(0, map.get("婚育史月经史").indexOf("经期")));
+    private void analysisGeneral(Document doc, String recTitle, Map<String, String> structureMap) {
+        List<String> titles = Lists.newArrayList("姓名", "工作单位", "性别", "住址", "年龄", "联系人(电话)", "婚姻",
+                "入院日期", "民族", "记录日期", "职业", "供史者", "籍贯",
+                "主 诉","现病史", "既往史", "个人史","家族史", "体格检查一般状况", "其 他","实验室检查", "特殊检查","辅助检查",
+                "初步诊断", "医师签名", "时间", "修正诊断");
+
+        String htmlContent = YuhangsyCommonAnalysisUtil.html2String(doc.toString());
+        if (StringUtil.isNotBlank(htmlContent)) {
+            YuhangsyCommonAnalysisUtil.html2StructureMap(titles,htmlContent,structureMap);
         }
-        //体 格 检 查 表(一) table解析
-        Element tgjcTableElement = doc.getElementById("table3");
-        YuhangsyHtmlAnalysisUtil.tableStyle2InsertMap(tgjcTableElement, map);
-
-        //诊断 table解析
-        String disTableElementId = null;
-        Element disTableElement = null;
-        String[] disTableElementIds = {"table7_2_0_0_1_1_2_0_1_4_5_6_7_0_1_37", "table7_2_0_0_1_1_2_0_1_4_5_6_7_0_1", "table7_2_0_0_1_1_2_0_1_4_5_6_7", "table7_2_0_0_1_1_2_0_1_4_5_6_7_0_1_5_2_3_1_2", "table7_2_0_0_1_1_2_0_1_4_5_6_7_0_1_5_2_3", "table7_2_0_0_1_1_2_0_1_4_5_6_7_0_1_5_2_3_1_2_27", "table7_2_0_0_1_1_2_0_1_4_5_6_7_0_1_5_2_3_1"};
-        for (String eid : disTableElementIds) {
-            disTableElement = doc.getElementById(eid);
-            if (disTableElement != null) {
-                disTableElementId = eid;
-                break;
-            }
+        //如果医师签名包括时间
+        if(StringUtil.isNotBlank(structureMap.get("医师签名"))&& structureMap.get("医师签名").contains("时间")){
+            Integer index = structureMap.get("医师签名").indexOf("时间");
+            structureMap.put("时间", structureMap.get("医师签名").substring(index+"时间:".length()));
+            structureMap.put("医师签名", structureMap.get("医师签名").substring(0, index));
         }
+    }
 
-        YuhangsyHtmlAnalysisUtil.tableStyle1InsertMap(disTableElement, map);
-        disHandleExt(map);
-
-        //医生签名、医生签名时间
-        Element docSignElement = null, docSignTimeElement = null;
-        if (disTableElement != null) {
-            for (Element disTableElementNt : disTableElement.nextElementSiblings()) {
-                docSignElement = disTableElementNt.selectFirst("image,img");
-                if (docSignElement != null) {
-                    docSignTimeElement = disTableElementNt.nextElementSibling();
-                    break;
-                }
+    //24小时出入院记录、24小时出入院记录(全院)、24小时入出院记录(全院通用)、24小时内入院死亡记录(全院通用)
+    private void analysis24h(Document doc, Map<String, String> structureMap) {
+        try {
+            List<String> titles = Lists.newArrayList("入院时间", "出院时间", "住院天数", "入院诊断",
+                    "出院诊断","主 诉", "入院情况", "入院查体", "住院经过", "出院情况", "出院医嘱","查体",
+                    "患者或患者授权亲属签名", "医师签名", "签名时间","日 期","出院指导"
+            );
+            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(doc.toString());
+
+            if (StringUtil.isNotBlank(htmlContent)) {
+                YuhangsyCommonAnalysisUtil.html2StructureMap(titles,htmlContent,structureMap);
             }
-        }
-        if (docSignElement != null) {
-//            map.put("医生签名", docSignElement.outerHtml());
-            map.put("医生签名", "暂无");
-        }
-        if (docSignTimeElement != null) {
-            map.put("医生签名时间", YuhangsyHtmlAnalysisUtil.elementLayer1ToStr(docSignTimeElement, false).trim());
-        }
-
-        //专科检查、辅助检查
-        Element yuElement = new Element("div");
-        if (tgjcTableElement != null) {
-            for (Element tgjcTableElementNt : tgjcTableElement.nextElementSiblings()) {
-                if (StringUtil.isNotBlank(disTableElementId) && tgjcTableElementNt.id().contains(disTableElementId)) {
-                    break;
-                }
-                if (tgjcTableElementNt.tagName().equals("table")) {
-                    continue;
-                }
-                tgjcTableElementNt.appendTo(yuElement);
+            //如果医师签名包括签名时间
+            if(StringUtil.isNotBlank(structureMap.get("医师签名"))&& structureMap.get("医师签名").contains("签名时间")){
+                Integer index = structureMap.get("医师签名").indexOf("签名时间");
+                structureMap.put("签名时间", structureMap.get("医师签名").substring(index+"签名时间:".length()));
+                structureMap.put("医师签名", structureMap.get("医师签名").substring(0, index));
             }
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
         }
-        String yuText = YuhangsyHtmlAnalysisUtil.blockDivToStr(yuElement, true)
-                .replace("体  格  检  查  表 (二)", "")
-                .replace("(补充及专科情况)", "")
-                .replace("辅  助  检  查", "辅助检查:")
-                .replace("诊断:", "")
-                .replace("补充专科情况", "补充专科情况:")
-                .trim();
-        CommonAnalysisUtil.cutByTitles(yuText, Lists.newArrayList("专科检查", "辅助检查"), 0, map);
-
     }
 
-    //24小时出入院记录、24小时出入院记录(全院)、24小时入出院记录(全院通用)、24小时内入院死亡记录(全院通用)
-    private void analysis24h(Document doc, Map<String, String> map) {
-        String text = YuhangsyHtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), false);
-        text = text.substring(text.lastIndexOf("24小时入出院记录姓    名")).replaceFirst("第1页", "");
-        List<String> titles = Lists.newArrayList("姓    名", "家庭住址", "性    别", "工作单位", "年    龄", "身份证号码", "民    族",
-                "联系人(关系)", "职    业", "入院时间", "婚    姻", "死亡时间", "记录时间", "出 生 地", "病史陈述者", "主    诉", "入院情况", "心理评估",
-                "疼痛评估", "营养评估", "功能评估", "入院诊断", "诊疗经过", "死亡原因", "死亡诊断", "出院情况", "出院诊断", "出院计划", "出院医嘱",
-                "出院去向", "医师签名", "书写时间");
+    //原-日间病历入出院记录、日间病历-性早熟
+    private void analysisDay(Document doc, Map<String, String> structureMap) {
+        List<String> titles = Lists.newArrayList("入院时间", "出院时间", "住院天数", "入院诊断",
+                "出院诊断","主 诉", "入院情况", "入院查体", "住院经过", "出院情况", "出院医嘱","查体",
+                "患者或患者授权亲属签名", "医师签名", "签名时间","日 期","出院指导"
+        );
+        String htmlContent = YuhangsyCommonAnalysisUtil.html2String(doc.toString());
 
-        CommonAnalysisUtil.cutByTitles(text, titles, 0, map);
-        CommonAnalysisUtil.processType(map, "出院去向");
-    }
 
-    //原-日间病历入出院记录、日间病历-性早熟
-    private void analysisDay(Document doc, Map<String, String> map) {
-        //个人基础信息table解析
-        YuhangsyHtmlAnalysisUtil.tableStyle1InsertMap(doc.getElementById("table1"), map);
-        //主诉、入院情况等table解析
-        YuhangsyHtmlAnalysisUtil.tableStyle2InsertMap(doc.getElementById("table6"), map);
-        //医生签名、医生签名时间
-        Element docSignElement = null, docSignTimeElement = null;
-        for (Element table6ElementNt : doc.getElementById("table6").parent().nextElementSiblings()) {
-            docSignElement = table6ElementNt.selectFirst("image,img");
-            if (docSignElement != null) {
-                docSignTimeElement = table6ElementNt.nextElementSibling();
-                break;
-            }
+        if (StringUtil.isNotBlank(htmlContent)) {
+            YuhangsyCommonAnalysisUtil.html2StructureMap(titles,htmlContent,structureMap);
         }
-        if (docSignElement != null) {
-//            map.put("医生签名", docSignElement.outerHtml());
-            map.put("医生签名", "暂无");
-        }
-        if (docSignTimeElement != null) {
-            map.put("医生签名时间", YuhangsyHtmlAnalysisUtil.elementLayer1ToStr(docSignTimeElement, false).trim());
-        }
-    }
-
-    private void disHandleExt(Map<String, String> map) {
-        String[] keys = {"补充诊断", "修正诊断"};
-        String value = null;
-        int index = 0;
-        for (String key : keys) {
-            value = map.get(key);
-            if (StringUtil.isNotBlank(value)) {
-                for (String key_ : keys) {
-                    index = value.indexOf(key_);
-                    if (index > 0) {
-                        map.put(key_, value.substring(index + 5));
-                        map.put(key, value.substring(0, index));
-                    }
-                }
-            }
+        //如果医师签名包括签名时间
+        if(StringUtil.isNotBlank(structureMap.get("医师签名"))&& structureMap.get("医师签名").contains("签名时间")){
+            Integer index = structureMap.get("医师签名").indexOf("签名时间");
+            structureMap.put("签名时间", structureMap.get("医师签名").substring(index+"签名时间:".length()));
+            structureMap.put("医师签名", structureMap.get("医师签名").substring(0, index));
         }
     }
 

+ 7 - 19
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyConsultationRecordHtmlAnalysis.java

@@ -2,7 +2,9 @@ package com.lantone.qc.trans.yuhangsy.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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Element;
@@ -27,8 +29,11 @@ public class YuhangsyConsultationRecordHtmlAnalysis implements YuhangsyHtmlAnaly
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
-            Element bigDivElement = Jsoup.parse(html).selectFirst("body").child(0);
-            analysisGeneral(recTitle,bigDivElement, map);
+            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(html);
+            if (StringUtil.isNotBlank(htmlContent)) {
+                YuhangsyCommonAnalysisUtil.extractWardInfo2(recTitle, htmlContent, map);
+            }
+            YuhangsyCommonAnalysisUtil.signatureTime1("病历日期", map);
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
@@ -36,21 +41,4 @@ public class YuhangsyConsultationRecordHtmlAnalysis implements YuhangsyHtmlAnaly
         return map;
     }
 
-    private void analysisGeneral(String recTitle,Element bigDivElement, Map<String, String> map) {
-        if (bigDivElement.childNodeSize() == 1) {
-            bigDivElement = bigDivElement.child(0);
-        }
-        if (bigDivElement.selectFirst("hr") != null) {
-            bigDivElement.selectFirst("hr").previousElementSiblings().remove();
-        }
-        String text = YuhangsyHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
-        CommonAnalysisUtil.extractWardInfo(recTitle,text, map);
-        String bqjlText = "病情记录" + map.get("病情记录");
-        List<String> titles = Lists.newArrayList(
-                "病情记录"
-        );
-        titles = CommonAnalysisUtil.sortTitlesNoColon(titles, bqjlText);
-        CommonAnalysisUtil.cutByTitlesNoColon(bqjlText, titles, 0, map);
-    }
-
 }

+ 17 - 16
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyCrisisValueReportHtmlAnalysis.java

@@ -2,9 +2,12 @@ package com.lantone.qc.trans.yuhangsy.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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 
 import java.util.List;
@@ -27,8 +30,11 @@ public class YuhangsyCrisisValueReportHtmlAnalysis implements YuhangsyHtmlAnalys
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
-            Element bigDivElement = Jsoup.parse(html).selectFirst("body").child(0);
-            analysisGeneral(recTitle,bigDivElement, map);
+            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(html);
+            if (StringUtil.isNotBlank(htmlContent)) {
+                YuhangsyCommonAnalysisUtil.extractWardInfo2(recTitle, htmlContent, map);
+            }
+            YuhangsyCommonAnalysisUtil.signatureTime1("病历日期", map);
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
@@ -36,21 +42,16 @@ public class YuhangsyCrisisValueReportHtmlAnalysis implements YuhangsyHtmlAnalys
         return map;
     }
 
-    private void analysisGeneral(String recTitle,Element bigDivElement, Map<String, String> map) {
-        if (bigDivElement.childNodeSize() == 1) {
-            bigDivElement = bigDivElement.child(0);
+    /**
+     * 病情记录中带有记录医师
+     *
+     * @param map
+     */
+    private void customMethod(Map<String, String> map) {
+        String goCureDoctor = map.get("病情记录");
+        if (StringUtil.isNotBlank(goCureDoctor) && goCureDoctor.contains("记录医师")) {
+            map.put("病情记录", goCureDoctor.substring(0, goCureDoctor.indexOf("记录医师")));
         }
-        if (bigDivElement.selectFirst("hr") != null) {
-            bigDivElement.selectFirst("hr").previousElementSiblings().remove();
-        }
-        String text = YuhangsyHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
-        CommonAnalysisUtil.extractWardInfo(recTitle,text, map);
-        String bqjlText = "病情记录" + map.get("病情记录");
-        List<String> titles = Lists.newArrayList(
-                "病情记录"
-        );
-        titles = CommonAnalysisUtil.sortTitlesNoColon(titles, bqjlText);
-        CommonAnalysisUtil.cutByTitlesNoColon(bqjlText, titles, 0, map);
     }
 
 }

+ 36 - 8
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyCriticallyIllNoticeHtmlAnalysis.java

@@ -4,6 +4,7 @@ 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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
@@ -26,19 +27,27 @@ public class YuhangsyCriticallyIllNoticeHtmlAnalysis implements YuhangsyHtmlAnal
         Map<String, String> structureMap = Maps.newLinkedHashMap();
 
         try {
-            List<String> titles = Lists.newArrayList("姓名", "性别", "出生日期", "科别", "病区", "床号", "住院号",
-                    "临床诊断", "病情摘要", "主要症状", "体格检查", "辅助检查", "告知医师签名",
-                    "告知时间", "患方意见", "患方签名", "手印说明", "与患者关系", "签字时间");
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
-            Document doc = Jsoup.parse(html);
-            String htmlContent = YuhangsyHtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), true);
+            List<String> titles = Lists.newArrayList("患者姓名","性别","年龄","尊敬的患者家属或患者的法定监护人、授权委托人:","现在我院",
+                    "目前诊断为",
+                    "虽经医护人员积极救治,但目前患者病情危重,并且病情有可能进一步恶化,随时会出现以下一种或多种危及患者生命的并发症:",
+                    "虽经医护人员积极救治,但目前患儿病情尚不稳定,并且病情有可能进一步加重,随时会出现以下一种或多种危及患者生命的并发症:","其他:",
+                    "关于患者目前的病情危重、可能出现的风险和后果以及医护人员对于患者病情危重时进行的救治措施,医护人员已经向我详细告知。我了解了患者病情危重,",
+                    "患者目前的病情危重,并且有可能进一步恶化,随时会出现以下危及患者生命的并发症:",
+                    "如您还有其他问题和要求,请在接到本通知后联系医生了解咨询。请您留下准确的联系方式,以便医护人员随时与您沟通。联系方式是:",
+                    "患者家属或患者的法定监护人、授权委托人意见:",
+                    "患者家属或患者的法定监护人意见:","患者监护人签名",
+                    "患者授权亲属签名","与患者关系","签名日期","医护人员陈述:","医护人员陈述","医护人员签名"
+            );
+            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(html);
+
             if (StringUtil.isNotBlank(htmlContent)) {
-                htmlContent = htmlContent.replaceAll("[   ]", " ");
-                CommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
+                //标题中无冒号版本
+                YuhangsyCommonAnalysisUtil.html2StructureMapNoColon(titles,htmlContent,structureMap);
             }
-            CommonAnalysisUtil.extractDateByTitle(structureMap, "告知时间");
+            customMethod(structureMap);
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, structureMap);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
@@ -46,4 +55,23 @@ public class YuhangsyCriticallyIllNoticeHtmlAnalysis implements YuhangsyHtmlAnal
         return structureMap;
     }
 
+    /**
+     * 抽取医护人员签名时间以及医护人员签名
+     *
+     * @param map
+     */
+    private void customMethod(Map<String, String> map) {
+        //签名中存在医师签名以及签名日期未分离
+        if (map.containsKey("医护人员签名")){
+            String name =map.get("医护人员签名");
+            String date =YuhangsyCommonAnalysisUtil.extractDate(name);
+            if (date != null) {
+                map.put("医护人员签名签名日期", date);
+                name =name.substring(0,name.indexOf("签名日期"));
+                map.put("医护人员签名",name);
+            }
+        }
+
+    }
+
 }

+ 10 - 13
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyDeathCaseDiscussHtmlAnalysis.java

@@ -2,7 +2,9 @@ package com.lantone.qc.trans.yuhangsy.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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
@@ -27,19 +29,14 @@ public class YuhangsyDeathCaseDiscussHtmlAnalysis implements YuhangsyHtmlAnalysi
         try {
             String html = args[0];
             String recTypeId = args[2];
-            Document doc = Jsoup.parse(html);
-            Element bigDivElement = doc.selectFirst("body").child(0);
-
-            bigDivElement.child(0).lastElementSibling().remove();
-            map.put("医生签名时间", YuhangsyHtmlAnalysisUtil.elementLayer1ToStr(bigDivElement.child(0).lastElementSibling(), false));
-            bigDivElement.child(0).lastElementSibling().remove();
-
-            String text = YuhangsyHtmlAnalysisUtil.blockDivToStr(bigDivElement, false);
-            List<String> titles = Lists.newArrayList("姓名", "性别", "出生日期", "科别", "病区", "床号", "住院号",
-                    "入院诊断", "死亡诊断", "尸检结果", "讨论时间", "讨论地点",
-                    "主 持 人", "参加人员", "具体讨论意见", "主持人小结意见", "主持人(签名)", "记录者签名");
-            CommonAnalysisUtil.cutByTitlesNoColon(text, titles, 0, map);
-            YuhangsyHtmlAnalysisUtil.mapValueRemoveStartColon(map);
+            List<String> titles = Lists.newArrayList("入院时间","死亡时间","讨论时间","讨论地点","主持人","参加人员的姓名及专业技术职务","医师汇报病情",
+                    "主持人小结","归结","结论","记录医师签名","主持人审核签名"
+            );
+            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(html);
+
+            if (StringUtil.isNotBlank(htmlContent)) {
+                YuhangsyCommonAnalysisUtil.html2StructureMap(titles,htmlContent,map);
+            }
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
         } catch (Exception e) {
             log.error(e.getMessage(), e);

+ 18 - 7
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyDeathRecordHtmlAnalysis.java

@@ -4,10 +4,14 @@ 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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -25,22 +29,29 @@ public class YuhangsyDeathRecordHtmlAnalysis implements YuhangsyHtmlAnalysis {
     public Map<String, String> analysis(String... args) {
         Map<String, String> structureMap = Maps.newLinkedHashMap();
         try {
-            List<String> titles = Lists.newArrayList("入院日期", "死亡时间", "入院情况", "入院诊断",
-                    "诊疗经过(重点记录病情演变、抢救经过)", "死亡原因", "死亡诊断", "医师签字", "记录时间");
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
-            Document doc = Jsoup.parse(html);
-            String htmlContent = YuhangsyHtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), false);
+            List<String> titles = Lists.newArrayList("入院时间", "死亡时间", "入院情况", "查体","转入诊断", "入院诊断", "诊疗经过", "实验室及器械检查结果",
+                     "死亡诊断", "医师签名", "时间","主 诉","主诉","实验室及其他检查结果","辅助检查","特殊检查","日 期",
+                    "姓名","性别","年龄","婚姻","职业","民族","工作单位","住址","入院日期","入院诊断","手术日期","手术名称","死亡日期","住院天数","死亡诊断",
+                    "入院时情况(简要病史、阳性体征、有关实验室及器械检查结果)","体格检查","实验室检查","特殊检查","住院经过及抢救经过","死亡原因","尸体病理解剖情况","X线片号","病理检验号",
+                    "主治医师签名","科主任(副主任医师以上)","医师签名"
+            );
+            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(html);
+
             if (StringUtil.isNotBlank(htmlContent)) {
-                htmlContent = htmlContent.replaceAll("[   ]", " ");
-                CommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
+                YuhangsyCommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
             }
-            CommonAnalysisUtil.extractDateByTitle(structureMap, "记录时间");
+            // 解决时间显示 年 月 日 时
+            YuhangsyCommonAnalysisUtil.signatureTime1("时间",structureMap);
+            YuhangsyCommonAnalysisUtil.signatureTime1("日 期",structureMap);
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, structureMap);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
         }
         return structureMap;
     }
+
+
 }

+ 7 - 38
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyDifficultCaseDiscussHtmlAnalysis.java

@@ -4,6 +4,7 @@ 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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
@@ -25,54 +26,22 @@ public class YuhangsyDifficultCaseDiscussHtmlAnalysis implements YuhangsyHtmlAna
     public Map<String, String> analysis(String... args) {
         Map<String, String> structureMap = Maps.newLinkedHashMap();
         try {
-            List<String> titles = Lists.newArrayList("姓名", "性别", "出生日期", "科别", "病区", "床号",
-                    "住院号", "年龄", "床号", "住院号", "住址(单位)", "讨论日期", "讨论地点", "主持人", "参加人员", "具体讨论意见",
-                    "主持人小结意见", "主持人小结意见/讨论结论", "主持人签名", "记录医生签名");
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
             Document doc = Jsoup.parse(html);
-            String htmlContent = YuhangsyHtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), true);
-            if (StringUtil.isNotBlank(htmlContent)) {
-                htmlContent = htmlContent.replaceAll("[   ]", " ").replace("第一页","");
-                CommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
-            }
-            CommonAnalysisUtil.extractDateByTitle(structureMap, "告知时间");
-            removeLast(structureMap);
-            if (structureMap.containsKey("住院号")) {
-                String date = CommonAnalysisUtil.extractDate(structureMap.get("住院号"));
-                if (StringUtil.isNotBlank(date)) {
-                    structureMap.put("时间", date);
-                    structureMap.put("住院号", structureMap.get("住院号").replace(date, "").replace("\n", ""));
+            List<String> titles = Lists.newArrayList("病历记录时间", "病历记录标题", "病程内容","记录医师"
+            );
+            String htmlContent = YuhangsyHtmlAnalysisUtil.blockDivToStr2(doc.selectFirst("body"), true);
 
-                }
+            if (StringUtil.isNotBlank(htmlContent)) {
+                YuhangsyCommonAnalysisUtil.html2StructureMap(titles,htmlContent,structureMap);
             }
+            YuhangsyCommonAnalysisUtil.signatureTime1("病历记录时间",structureMap);
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, structureMap);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
         }
         return structureMap;
     }
-
-    /**
-     * 去除value中最后的逗号
-     *
-     * @param structureMap
-     */
-    private void removeLast(Map<String, String> structureMap) {
-        for (Map.Entry<String, String> entry : structureMap.entrySet()) {
-            structureMap.put(entry.getKey(), findLast(entry.getValue()));
-        }
-    }
-
-    private String findLast(String value) {
-        if (StringUtil.isNotBlank(value)) {
-            if (value.lastIndexOf(",") != value.length() - 1) {
-                return value;
-            }
-            value = value.substring(0, value.length() - 1);
-            findLast(value);
-        }
-        return value;
-    }
 }

+ 7 - 44
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyFirstCourseRecordHtmlAnalysis.java

@@ -4,6 +4,7 @@ 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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
@@ -25,55 +26,17 @@ public class YuhangsyFirstCourseRecordHtmlAnalysis implements YuhangsyHtmlAnalys
     public Map<String, String> analysis(String... args) {
         Map<String, String> structureMap = Maps.newLinkedHashMap();
         try {
-            List<String> titles = Lists.newArrayList("(一)病历特点", "(二)诊断依据", "(三)鉴别诊断",
-                    "(四)初步诊断", "(五)诊疗计划", "(二)拟诊讨论", "初步诊断", "诊断依据", "鉴别诊断", "(三)诊疗计划", "心理治疗", "(五)疼痛评估",
-                    "疼痛治疗", "营养治疗", "康复治疗", "VTE预防", "医生签名", "(六)诊疗计划");
             String html = args[0];
             String recTitle = args[1];
+            String recTypeId = args[2];
             Document doc = Jsoup.parse(html);
-            String htmlContent = YuhangsyHtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), true);
+            List<String> titles = Lists.newArrayList("病历记录标题","病历记录时间","病程内容","一般情况","病历特点","初步诊断","诊断依据","鉴别诊断","诊疗计划","记录医师");
+            String htmlContent = YuhangsyHtmlAnalysisUtil.blockDivToStr2(doc.selectFirst("EMRDoc"), true);
             if (StringUtil.isNotBlank(htmlContent)) {
-                htmlContent = htmlContent.replace("—/—", "")
-                        .replace("第1页", "")
-                        .replace("建议先书写大病", "")
-                        .replace("历,并对导入的既往史和现病史进行归纳", "")
-                        .replace("若书写者为诊疗组长本人,以下签名框中可只签一个名字", "");
-                String[] lines = htmlContent.split("\n\n");
-                String text = "";
-                if (lines.length > 1) {
-                    if (lines[0].contains("宁波市北仑区人民医院")) {
-                        for (int i = 1; i < lines.length; i++) {
-                            text += lines[i];
-                        }
-                    } else {
-                        for (int i = 0; i < lines.length; i++) {
-                            text += lines[i];
-                        }
-                    }
-                    //htmlContent = lines[1];
-                } else if (lines.length == 1) {
-                    text = lines[0];
-                }
-                if (StringUtil.isNotBlank(text)) {
-                    String date = CommonAnalysisUtil.extractDate(text);
-                    if (StringUtil.isNotBlank(date)) {
-                        structureMap.put("时间", date);
-                        text = text.replace(date, "");
-                    }
-                    text = text.replaceAll("[   ]", " ");
-                    CommonAnalysisUtil.html2StructureMap(titles, text, structureMap);
-                }
+                YuhangsyCommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
             }
-            if (structureMap.containsKey("(一)病历特点")) {
-                CommonAnalysisUtil.cutByTitles(structureMap.get("(一)病历特点"), Lists.newArrayList("入院查体", "辅助检查"), 0, structureMap);
-                if (structureMap.containsKey("入院查体")) {
-                    structureMap.put("(一)病历特点", structureMap.get("(一)病历特点").split("入院查体")[0]);
-                }
-            }
-            YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, args[2], structureMap);
-            //        CommonAnalysisUtil.extractDateByTitle(structureMap, "时间");
-            //        structureMap.forEach((k,v)-> System.out.println(k + "------" + v));
-            //        structureMap.put("rec_title=", "107");
+            YuhangsyCommonAnalysisUtil.signatureTime1("病历记录时间",structureMap);
+            YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, structureMap);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
         }

+ 54 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyHtmlAnalysisUtil.java

@@ -235,4 +235,58 @@ public class YuhangsyHtmlAnalysisUtil {
         return sbfString;
     }
 
+    /**
+     * 余杭三院自定义xml解析模板(入院记录)
+     * @param divElement
+     * @param isLineBreak 是否保留换行
+     * @return
+     */
+    public static String blockDivToStr2(Element divElement, boolean isLineBreak) {
+        if (divElement == null) {
+            return "";
+        }
+        StringBuffer sbf = new StringBuffer();
+        for (Element childElement : divElement.children()) {
+            if (isLineBreak) {
+                sbf.append(elementLayer1ToStr2(childElement, false)).append("\n");
+            } else {
+                sbf.append(elementLayer1ToStr2(childElement, false).trim());
+            }
+        }
+        return sbf.toString();
+    }
+
+    /**
+     * 余杭三院自定义xml解析模板(入院记录)
+     * @param element
+     * @param isLineBreak 是否保留换行
+     * @return
+     */
+    public static String elementLayer1ToStr2(Element element, boolean isLineBreak) {
+        if (element == null) {
+            return "";
+        }
+        StringBuffer sbf = new StringBuffer();
+        List<Element> elements = Lists.newArrayList();
+        Elements childElements = element.children();
+        if (childElements.size() == 0) {
+            elements.add(element);
+        }
+        for (Element childElement : childElements) {
+            elements.add(childElement);
+        }
+        for (Element childElement : elements) {
+            if (childElement.tagName().equals("img") || childElement.tagName().equals("image")) {
+                //                sbf.append(childElement.outerHtml());
+                sbf.append("—");
+            } else {
+                sbf.append(childElement.tagName()+":"+childElement.text()+" ");
+            }
+            if (isLineBreak) {
+                sbf.append("\n");
+            }
+        }
+        String sbfString = removeSex(sbf.toString().replaceAll(" ", " "));
+        return sbfString;
+    }
 }

+ 16 - 17
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyLeaveHospitalHtmlAnalysis.java

@@ -3,7 +3,9 @@ package com.lantone.qc.trans.yuhangsy.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.changshaxy.util.comsis.XyCommonAnalysisUtil;
 import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
@@ -25,30 +27,27 @@ public class YuhangsyLeaveHospitalHtmlAnalysis implements YuhangsyHtmlAnalysis {
     public Map<String, String> analysis(String... args) {
         Map<String, String> structureMap = Maps.newLinkedHashMap();
         try {
-            List<String> titles = Lists.newArrayList("姓名", "出生年月", "性别", "年龄", "出生日期", "科室", "病区", "床位", "床号", "住院号 ", "住院号",
-                    "入院日期", "出院日期", "地址", "住院天数", "婚姻", "入院诊断", "出院诊断", "分娩日期", "分娩方式", "手术指征",
-                    "入院情况", "诊治经过", "入院后检查化验结果", "入院后化验检查结果", "诊疗经过", "治疗结果", "出院计划", "病理检查结果", "出院情况", "婴儿情况",
-                    "治疗效果", "出院医嘱", "医师签名", "日期", "病理号", "X片号", "MR号", "CT号", "其它", "主治医师", "住院医师");
+            List<String> titles = Lists.newArrayList("入院时间", "出院时间", "住院天数", "入院诊断",
+                    "出院诊断","主 诉", "入院情况", "入院查体", "住院经过", "出院情况", "出院医嘱","查体",
+                    "患者或患者授权亲属签名", "医师签名", "签名时间","日 期","出院指导"
+            );
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
             Document doc = Jsoup.parse(html);
-            String htmlContent = YuhangsyHtmlAnalysisUtil.blockDivToStr(doc.selectFirst("body").child(0), true);
+
+            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(html);
+
             if (StringUtil.isNotBlank(htmlContent)) {
-                htmlContent = htmlContent.replace("下拉选择无或右键调用临床数据", "");
-                htmlContent = htmlContent.replaceAll("[   ]", " ").replace("第1页", "");
-                htmlContent = htmlContent.replace("\n", "");
-                List<String> sortTitles = CommonAnalysisUtil.sortTitles(titles, htmlContent.replace("复诊时间", ""));
-                sortTitles.add("时间");
-                CommonAnalysisUtil.cutByTitles(htmlContent, sortTitles, 0, structureMap);
+                YuhangsyCommonAnalysisUtil.html2StructureMap(titles,htmlContent,structureMap);
             }
-            if (structureMap.containsKey("出院诊断") && structureMap.get("出院诊断").contains("入院情况")) {
-                String discharge = structureMap.get("出院诊断");
-                int index = discharge.indexOf("入院情况");
-                structureMap.put("出院诊断", discharge.substring(0, index));
-                structureMap.put("入院情况", discharge.substring(index + 4));
+            //如果医师签名包括签名时间
+            if(StringUtil.isNotBlank(structureMap.get("医师签名"))&& structureMap.get("医师签名").contains("签名时间")){
+                Integer index = structureMap.get("医师签名").indexOf("签名时间");
+                structureMap.put("签名时间", structureMap.get("医师签名").substring(index+"签名时间:".length()));
+                structureMap.put("医师签名", structureMap.get("医师签名").substring(0, index));
             }
-            CommonAnalysisUtil.extractDateByTitle(structureMap, "时间");
+
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, structureMap);
         } catch (Exception e) {
             log.error(e.getMessage(), e);

+ 24 - 22
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyOperationHtmlAnalysis.java

@@ -2,7 +2,9 @@ package com.lantone.qc.trans.yuhangsy.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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Element;
@@ -27,9 +29,18 @@ public class YuhangsyOperationHtmlAnalysis implements YuhangsyHtmlAnalysis {
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
-            Element bigDivElement = Jsoup.parse(html).selectFirst("body").child(0);
-            analysisGeneral(recTitle, bigDivElement, map);
-            CommonAnalysisUtil.makeEmpty(map, "医生签名");
+            List<String> titles = Lists.newArrayList("手术方式", "术后诊断", "手术简要经过","术后可能出现的并发症及特别需要观察的事项",
+                    "术后处理措施及注意事项","其他","术前诊断","患方代表签字","主刀医师签字","日 期"
+            );
+            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(html);
+
+            if (StringUtil.isNotBlank(htmlContent)) {
+                YuhangsyCommonAnalysisUtil.html2StructureMap(titles,htmlContent,map);
+            }
+
+            // 解决其他中带有(二、患方意见)
+            customMethod(map);
+
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
@@ -37,25 +48,16 @@ public class YuhangsyOperationHtmlAnalysis implements YuhangsyHtmlAnalysis {
         return map;
     }
 
-    private void analysisGeneral(String recTitle, Element bigDivElement, Map<String, String> map) {
-        if (bigDivElement.childNodeSize() == 1) {
-            bigDivElement = bigDivElement.child(0);
+    /**
+     * 其他中带有(二、患方意见)
+     *
+     * @param map
+     */
+    private void customMethod(Map<String, String> map) {
+        String goCureDoctor = map.get("其他");
+        if (StringUtil.isNotBlank(goCureDoctor) && goCureDoctor.contains("二、患方意见")) {
+            map.put("患方意见", goCureDoctor.substring(goCureDoctor.indexOf("二、患方意见")+"二、患方意见".length()));
+            map.put("其他", goCureDoctor.substring(0,goCureDoctor.indexOf("二、患方意见")));
         }
-        if (bigDivElement.selectFirst("hr") != null) {
-            bigDivElement.selectFirst("hr").previousElementSiblings().remove();
-        }
-        String text = YuhangsyHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
-        CommonAnalysisUtil.extractWardInfo(recTitle, text, map);
-        String bqjlText = "病情记录" + map.get("病情记录")
-                .replace("提醒:有创诊疗操作记录内容包括操作名称、时间、步骤、结果及患者的一般情况,记录操作过","")
-                .replace("程是否顺利,有无不良反应,术后注意事项,操作医师签名、记录时间等。","")
-                .replace("手术室完成的、治疗性质的及全麻下完成的有创诊疗操作参照手术管理。(包括介入治疗、胃肠镜","")
-                .replace("下肿瘤切除/粘膜下肿瘤剥除等)","");
-        List<String> titles = Lists.newArrayList(
-                "病情记录", "患者手术后情况", "手术简要经过(包括手术方式、术中所见、过程是否顺利、有无并发症等)", "术后去向", "术后去向", "术后诊断", "术后处理措施", "术后应当特别注意观察的事项:", "术后治疗计划(包括术后应当特别注意观察的事项)", "医生签名", "医师签名"
-        );
-        titles = CommonAnalysisUtil.sortTitlesNoColon(titles, bqjlText);
-        CommonAnalysisUtil.cutByTitlesNoColon(bqjlText, titles, 0, map);
     }
-
 }

+ 27 - 48
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyOperationRecordHtmlAnalysis.java

@@ -3,9 +3,14 @@ package com.lantone.qc.trans.yuhangsy.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.changshaxy.util.XyHtmlAnalysisUtil;
+import com.lantone.qc.trans.changshaxy.util.comsis.XyCommonAnalysisUtil;
 import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
+import com.lantone.qc.trans.ningbozhenhai.util.HtmlAnalysisUtil;
+import com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 
 import java.util.List;
@@ -28,39 +33,31 @@ public class YuhangsyOperationRecordHtmlAnalysis implements YuhangsyHtmlAnalysis
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
-            Element bigDivElement = Jsoup.parse(html).selectFirst("body").child(0);
-            analysisGeneral(bigDivElement, map);
-            YuhangsyHtmlAnalysisUtil.mapValueRemoveStartColon(map);
-            String operatingCrew = null;
-            if (map.containsKey("手术人员")) {
-                operatingCrew = map.get("手术人员");
-            } else if (map.containsKey("手术者及助手名称")) {
-                operatingCrew = map.get("手术者及助手名称");
-            }
-            if (StringUtil.isNotBlank(operatingCrew)) {
-                CommonAnalysisUtil.cutByTitles(operatingCrew, Lists.newArrayList("主刀", "一助", "二助", "助手", "洗手护士"), 0, map);
-            }
-            if (map.containsKey("主刀")) {
-                map.put("主刀", map.get("主刀").replaceAll("[^\u4E00-\u9FA5]", ""));
-            }
-            if (map.containsKey("麻醉者")) {
-                String anesthetist = map.get("麻醉者").replace("麻醉医生:", "");
-                map.put("麻醉医师", anesthetist);
-                if (anesthetist.contains("1.")) {
-                    int index = anesthetist.indexOf("1.");
-                    map.put("麻醉医师", anesthetist.substring(0, index));
-                    map.put("手术经过", anesthetist.substring(index));
-                }
+            Document doc = Jsoup.parse(html);
+            List<String> titles = Lists.newArrayList("手术开始时间", "术前诊断", "手术名称", "术中诊断",
+                    "手术人员","麻醉方式", "麻醉医师", "手术过程","术中状态", "签名"
+            );
+            String htmlContent = YuhangsyHtmlAnalysisUtil.blockDivToStr2(doc.selectFirst("body"), true);
+//            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(html);
+
+            if (StringUtil.isNotBlank(htmlContent)) {
+                YuhangsyCommonAnalysisUtil.html2StructureMap(titles,htmlContent,map);
             }
-            if (map.containsKey("手术日期")) {
-                String operatorDateStr = map.get("手术日期");
-                if (operatorDateStr.contains("--")) {
-                    String[] operatorDate = operatorDateStr.split("--");
-                    map.put("手术开始时间", operatorDate[0]);
-                    map.put("手术结束时间", operatorDate[1]);
+
+            //签名中存在医师签名以及签名日期未分离
+            if (map.containsKey("签名")){
+                String name =map.get("签名");
+
+                String date =YuhangsyCommonAnalysisUtil.extractDate(name);
+                if (date != null) {
+                    //创建签名时间
+                    map.put("签名日期", date);
+                    //
+                    name =name.substring(name.indexOf("医师签名:")+"医师签名:".length(),name.indexOf("签名日期"));
+                    map.put("医师签名",name);
                 }
             }
-            CommonAnalysisUtil.makeEmpty(map, "医生签名");
+
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
@@ -68,22 +65,4 @@ public class YuhangsyOperationRecordHtmlAnalysis implements YuhangsyHtmlAnalysis
         return map;
     }
 
-    private void analysisGeneral(Element bigDivElement, Map<String, String> map) {
-        /*if (bigDivElement.selectFirst("hr") != null) {
-            bigDivElement.selectFirst("hr").previousElementSiblings().remove();
-        }*/
-        String text = YuhangsyHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
-        text = text.replaceAll("第1页", "");
-        List<String> titles = Lists.newArrayList(
-                "姓名", "性别", "出生日期", "出生年月", "科别", "科室", "病区", "床号", "床位", "住院号",
-                "手术时间", "手术日期", "术前诊断", "手术指征", "手术人员", "麻醉方式", "麻醉人员", "麻 醉 者", "洗手护士", "本次手术是否属于非计划再次手术", "接生者",
-                "术前胎心", "手术名称", "术后诊断", "手术者及助手名称", "术中取病理标本", "麻醉方法", "诊断手术/操作简要经过(包括术中有无并发症及具体描述和处理)", "手术经过",
-                "医生签名", "记录时间", "时间", "手术/操作医生", "记录者", "术中输血", "术前宫颈准备日期", "药物名称及用法", "导管或其他", "插入深度",
-                "阴道填塞纱布条", "准备者", "取出日期", "手术方法", "术中特殊情况", "病理检查", "其他", "记录者", "手术者",
-                "检查子宫位置"
-        );
-        titles = CommonAnalysisUtil.sortTitles(titles, text);
-        CommonAnalysisUtil.cutByTitlesNoColon(text, titles, 0, map);
-    }
-
 }

+ 27 - 43
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyPreoperativeHtmlAnalysis.java

@@ -4,6 +4,7 @@ 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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Element;
@@ -28,10 +29,19 @@ public class YuhangsyPreoperativeHtmlAnalysis implements YuhangsyHtmlAnalysis {
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
-            Element bigDivElement = Jsoup.parse(html).selectFirst("body").child(0);
-            analysisGeneral(bigDivElement, map);
+            List<String> titles = Lists.newArrayList("讨论时间", "讨论方式", "参加人员的姓名及专业技术职务","参加人员",
+                    "简要病情","入院查体","术前诊断","手术指征与禁忌症","可替代方案","拟施手术方式(名称)及可能的变更方案","计划性多次手术","拟麻醉方式","拟施麻醉方式","术前准备","主要术中、术后风险及防范措施","术中、术后注意事项(含护理事项)","围术期预防性抗菌药使用",
+                    "主刀医生签名", "分标记医生签名","经治医师签名","分主刀医师签名"
+                    ,"病史摘要","查体","辅助检查","拟施手术","拟施麻醉","术中注意点","家属谈话内容","医生签名","日 期"
+            );
+            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(html);
+
+            if (StringUtil.isNotBlank(htmlContent)) {
+                YuhangsyCommonAnalysisUtil.html2StructureMap(titles,htmlContent,map);
+            }
+            // 解决医生签名显示 年 月 日 时
+            signatureTime(map);
 
-            YuhangsyHtmlAnalysisUtil.mapValueRemoveStartColon(map);
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
@@ -39,40 +49,6 @@ public class YuhangsyPreoperativeHtmlAnalysis implements YuhangsyHtmlAnalysis {
         return map;
     }
 
-    private void analysisGeneral(Element bigDivElement, Map<String, String> map) {
-        /*if (bigDivElement.selectFirst("hr") != null) {
-            bigDivElement.selectFirst("hr").previousElementSiblings().remove();
-        }*/
-        String text = YuhangsyHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
-
-        int index1 = text.lastIndexOf("经治医生签名");
-        int index2 = text.lastIndexOf("主刀医生签名");
-        if (index1 != -1 && index2 != -1) {
-            text = text.substring(0, index1).replace("(如高血压病、冠心病、糖尿病、脑梗、心梗、心肺肝肾功能不全,口服抗凝药", "").replace("等)", "")
-                    .replace("(如腹腔镜可能改开腹等)", "").replace("(如腹腔镜可能改开腹", "").replace("皮瓣转移术可能的变更方案","")
-                    .replace("四级手术、疑难手术等必须填写以下“具体讨论意见”,作为科室三大讨论本留存资料", "")
-                    .replace("术后术后", "术后")
-                    + text.substring(index1, index2).replace("签字时间", "经治医生签字时间").replace("年月日时分", "")
-                    + text.substring(index2).replace("签字时间", "主刀医生签字时间").replace("年月日时分", "");
-        }
-        text = text.replace("术前讨论及术前小结", "").replace("讨论结论:", "").replace("年月日时\n" +
-                "分", "");
-        List<String> titles = Lists.newArrayList("姓名", "性别", "出生日期", "出生年月", "科别", "科室", "病区", "床号", "床位", "住院号",
-                "讨论时间", "讨论方式", "参加人员", "简要病情", "具体讨论意见",
-                "1.术前诊断", "2.手术指征与禁忌征", "3.可替代方案", "4.拟施手术方式(名称)及可能的变更方案", "5.计划性多次手术",
-                "5.本次手术是否属于计划性多次手术",
-                "5.拟施麻醉方式", "6.术前特殊准备", "7.主要术中、术后风险及防范措施", "8.术中、术后注意事项(含护理事项)",
-                "6.拟施麻醉方式", "7.术前特殊准备", "8.主要术中、术后风险及防范措施", "9.术中、术后注意事项(含护理事项)",
-                "术前诊断", "手术指征", "拟施手术名称及方式", "拟施麻醉方式", "其他术前相关情况", "注意事项",
-                "经治医生签名", "经治医生签字时间", "主刀医生签名", "医生签名", "主刀医生签字时间", "签字时间");
-        CommonAnalysisUtil.cutByTitles(text, titles, 0, map);
-        CommonAnalysisUtil.processType(map, "5.计划性多次手术");
-        CommonAnalysisUtil.processType(map, "5.本次手术是否属于计划性多次手术");
-        CommonAnalysisUtil.processType(map, "讨论方式");
-        CommonAnalysisUtil.makeEmpty(map, "主刀医生签名");
-        // 解决医生签名显示 年 月 日 时 分
-        signatureTime(map);
-    }
 
     /**
      * 解决医生签名时间显示 年 月 日 时 分
@@ -80,13 +56,21 @@ public class YuhangsyPreoperativeHtmlAnalysis implements YuhangsyHtmlAnalysis {
      * @param map
      */
     private void signatureTime(Map<String, String> map) {
-        String goCureDoctor = map.get("经治医生签字时间");
-        String operateDoctor = map.get("主刀医生签字时间");
-        if (StringUtil.isNotBlank(goCureDoctor) && goCureDoctor.contains("年 月 日 时 分")) {
-            map.put("经治医生签字时间", goCureDoctor.replace("年 月 日 时 分", ""));
+        String goCureDoctor = map.get("经治医师签名");
+        String operateDoctor = map.get("主刀医生签名");
+        String goCureDoctor2 = map.get("分主刀医师签名");
+        String operateDoctor2 = map.get("分标记医生签名");
+        if (StringUtil.isNotBlank(goCureDoctor) && goCureDoctor.contains("年 月 日 时")) {
+            map.put("经治医师签名", goCureDoctor.replace("年 月 日 时", ""));
+        }
+        if (StringUtil.isNotBlank(operateDoctor) && operateDoctor.contains("年 月 日 时")) {
+            map.put("主刀医生签名", operateDoctor.replace("年 月 日 时", ""));
+        }
+        if (StringUtil.isNotBlank(goCureDoctor2) && goCureDoctor2.contains("年 月 日 时 分")) {
+            map.put("分主刀医师签名", goCureDoctor2.replace("年 月 日 时 分", ""));
         }
-        if (StringUtil.isNotBlank(operateDoctor) && operateDoctor.contains("年 月 日 时 分")) {
-            map.put("主刀医生签字时间", operateDoctor.replace("年 月 日 时 分", ""));
+        if (StringUtil.isNotBlank(operateDoctor2) && operateDoctor2.contains("年 月 日 时 分")) {
+            map.put("分标记医生签名", operateDoctor2.replace("年 月 日 时 分", ""));
         }
     }
 

+ 25 - 16
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyRescueHtmlAnalysis.java

@@ -2,7 +2,9 @@ package com.lantone.qc.trans.yuhangsy.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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Element;
@@ -27,8 +29,12 @@ public class YuhangsyRescueHtmlAnalysis implements YuhangsyHtmlAnalysis {
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
-            Element bigDivElement = Jsoup.parse(html).selectFirst("body").child(0);
-            analysisGeneral(recTitle,bigDivElement, map);
+            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(html);
+            if (StringUtil.isNotBlank(htmlContent)) {
+                YuhangsyCommonAnalysisUtil.extractWardInfo2(recTitle, htmlContent, map);
+            }
+            customMethod(map);
+            YuhangsyCommonAnalysisUtil.signatureTime1("病历日期", map);
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
@@ -36,21 +42,24 @@ public class YuhangsyRescueHtmlAnalysis implements YuhangsyHtmlAnalysis {
         return map;
     }
 
-    private void analysisGeneral(String recTitle,Element bigDivElement, Map<String, String> map) {
-        if (bigDivElement.childNodeSize() == 1) {
-            bigDivElement = bigDivElement.child(0);
+    /**
+     * 医师签名或者记录医师中带有签名日期
+     *
+     * @param map
+     */
+    private void customMethod(Map<String, String> map) {
+        String goCureDoctor = map.get("医师签名");
+        String goCureDoctor2 = map.get("记录医师");
+        if (StringUtil.isNotBlank(goCureDoctor) && goCureDoctor.contains("签名日期:")) {
+            map.put("签名日期", goCureDoctor.substring(goCureDoctor.indexOf("签名日期:") + "签名日期:".length()));
+            map.put("医师签名", goCureDoctor.substring(0, goCureDoctor.indexOf("签名日期")));
         }
-        if (bigDivElement.selectFirst("hr") != null) {
-            bigDivElement.selectFirst("hr").previousElementSiblings().remove();
+        if (StringUtil.isNotBlank(goCureDoctor2)) {
+            String date = YuhangsyCommonAnalysisUtil.extractDate(goCureDoctor2);
+            if (date != null) {
+                map.put("签名日期", goCureDoctor2.substring(goCureDoctor2.indexOf(date)));
+                map.put("记录医师", goCureDoctor2.substring(0, goCureDoctor2.indexOf(date)));
+            }
         }
-        String text = YuhangsyHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
-        CommonAnalysisUtil.extractWardInfo(recTitle,text, map);
-        String bqjlText = "病情记录" + map.get("病情记录");
-        List<String> titles = Lists.newArrayList(
-                "病情记录"
-        );
-        titles = CommonAnalysisUtil.sortTitlesNoColon(titles, bqjlText);
-        CommonAnalysisUtil.cutByTitlesNoColon(bqjlText, titles, 0, map);
     }
-
 }

+ 7 - 20
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyStagesSummaryHtmlAnalysis.java

@@ -2,7 +2,9 @@ package com.lantone.qc.trans.yuhangsy.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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Element;
@@ -27,30 +29,15 @@ public class YuhangsyStagesSummaryHtmlAnalysis implements YuhangsyHtmlAnalysis {
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
-            Element bigDivElement = Jsoup.parse(html).selectFirst("body").child(0);
-            analysisGeneral(recTitle, bigDivElement, map);
+            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(html);
+            if (StringUtil.isNotBlank(htmlContent)) {
+                YuhangsyCommonAnalysisUtil.extractWardInfo2(recTitle, htmlContent, map);
+            }
+            YuhangsyCommonAnalysisUtil.signatureTime1("病历日期", map);
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
         }
         return map;
     }
-
-    private void analysisGeneral(String recTitle, Element bigDivElement, Map<String, String> map) {
-        if (bigDivElement.childNodeSize() == 1) {
-            bigDivElement = bigDivElement.child(0);
-        }
-        if (bigDivElement.selectFirst("hr") != null) {
-            bigDivElement.selectFirst("hr").previousElementSiblings().remove();
-        }
-        String text = YuhangsyHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
-        CommonAnalysisUtil.extractWardInfo(recTitle, text, map);
-        String bqjlText = "病情记录" + map.get("病情记录");
-        List<String> titles = Lists.newArrayList(
-                "病情记录"
-        );
-        titles = CommonAnalysisUtil.sortTitlesNoColon(titles, bqjlText);
-        CommonAnalysisUtil.cutByTitlesNoColon(bqjlText, titles, 0, map);
-    }
-
 }

+ 7 - 10
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyThreeLevelWardHtmlAnalysis.java

@@ -2,7 +2,9 @@ package com.lantone.qc.trans.yuhangsy.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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
@@ -31,17 +33,12 @@ public class YuhangsyThreeLevelWardHtmlAnalysis implements YuhangsyHtmlAnalysis
             String recTitle = args[1];
             String recTypeId = args[2];
             Document doc = Jsoup.parse(html);
-            Element bigDivElement = doc.selectFirst("body").child(0);
-            if (bigDivElement.childNodeSize() == 1) {
-                bigDivElement = bigDivElement.child(0);
+            List<String> titles = Lists.newArrayList("病历记录时间", "病历记录标题", "病程内容", "记录医师");
+            String htmlText = YuhangsyHtmlAnalysisUtil.blockDivToStr2(doc.selectFirst("EMRDoc"), true);
+            if (StringUtil.isNotBlank(htmlText)) {
+                YuhangsyCommonAnalysisUtil.html2StructureMap(titles,htmlText,structureMap);
             }
-            if (bigDivElement.selectFirst("hr") != null) {
-                bigDivElement.selectFirst("hr").previousElementSiblings().remove();
-            }
-            String htmlText = YuhangsyHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
-            htmlText = htmlText.replace("注意:上级医师查房主要记 录:患者病情、诊断、鉴别诊断、当前治疗措施和疗效的分析及下一步诊疗意见等,能反应上级医 师的水平。", "")
-                    .replace("提醒:有创诊疗操作记录内容包括操作名称、时间、步骤、结果及患者的一般情况,记录操作过 程是否顺利,有无不良反应,术后注意事项,操作医师签名、记录时间等。 手术室完成的、治疗性质的及全麻下完成的有创诊疗操作参照手术管理。(包括介入治疗、胃肠镜 下肿瘤切除/粘膜下肿瘤剥除等)", "");
-            CommonAnalysisUtil.extractWardInfo(recTitle, htmlText, structureMap);
+            YuhangsyCommonAnalysisUtil.signatureTime1("病历记录时间",structureMap);
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, structureMap);
         } catch (Exception e) {
             log.error(e.getMessage(), e);

+ 9 - 20
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyTransferIntoHtmlAnalysis.java

@@ -2,9 +2,12 @@ package com.lantone.qc.trans.yuhangsy.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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 
 import java.util.List;
@@ -27,30 +30,16 @@ public class YuhangsyTransferIntoHtmlAnalysis implements YuhangsyHtmlAnalysis {
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
-            Element bigDivElement = Jsoup.parse(html).selectFirst("body").child(0);
-            analysisGeneral(recTitle, bigDivElement, map);
+            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(html);
+            if (StringUtil.isNotBlank(htmlContent)) {
+                YuhangsyCommonAnalysisUtil.extractWardInfo2(recTitle, htmlContent, map);
+            }
+            YuhangsyCommonAnalysisUtil.signatureTime1("病历日期", map);
+            YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
         }
         return map;
     }
-
-    private void analysisGeneral(String recTitle, Element bigDivElement, Map<String, String> map) {
-        if (bigDivElement.childNodeSize() == 1) {
-            bigDivElement = bigDivElement.child(0);
-        }
-        if (bigDivElement.selectFirst("hr") != null) {
-            bigDivElement.selectFirst("hr").previousElementSiblings().remove();
-        }
-        String text = YuhangsyHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
-        CommonAnalysisUtil.extractWardInfo(recTitle, text, map);
-        String bqjlText = "病情记录" + map.get("病情记录");
-        List<String> titles = Lists.newArrayList(
-                "病情记录", "医师签名", "医师签字"
-        );
-        titles = CommonAnalysisUtil.sortTitlesNoColon(titles, bqjlText);
-        CommonAnalysisUtil.cutByTitlesNoColon(bqjlText, titles, 0, map);
-    }
-
 }

+ 8 - 29
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/YuhangsyTransferOutHtmlAnalysis.java

@@ -2,9 +2,12 @@ package com.lantone.qc.trans.yuhangsy.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 com.lantone.qc.trans.yuhangsy.util.comsis.YuhangsyCommonAnalysisUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 
 import java.util.List;
@@ -27,39 +30,15 @@ public class YuhangsyTransferOutHtmlAnalysis implements YuhangsyHtmlAnalysis {
             String html = args[0];
             String recTitle = args[1];
             String recTypeId = args[2];
-            Element bigDivElement = Jsoup.parse(html).selectFirst("body").child(0);
-            analysisGeneral(recTitle, bigDivElement, map);
+            String htmlContent = YuhangsyCommonAnalysisUtil.html2String(html);
+            if (StringUtil.isNotBlank(htmlContent)) {
+                YuhangsyCommonAnalysisUtil.extractWardInfo2(recTitle, htmlContent, map);
+            }
+            YuhangsyCommonAnalysisUtil.signatureTime1("病历日期", map);
             YuhangsyHtmlAnalysisUtil.insertModuleId(modeId, recTypeId, map);
         } catch (Exception e) {
             log.error(e.getMessage(), e);
         }
         return map;
     }
-
-    private void analysisGeneral(String recTitle, Element bigDivElement, Map<String, String> map) {
-        if (bigDivElement.childNodeSize() == 1) {
-            bigDivElement = bigDivElement.child(0);
-        }
-        if (bigDivElement.selectFirst("hr") != null) {
-            bigDivElement.selectFirst("hr").previousElementSiblings().remove();
-        }
-        String text = YuhangsyHtmlAnalysisUtil.blockDivToStr(bigDivElement, true);
-        CommonAnalysisUtil.extractWardInfo(recTitle, text, map);
-        String bqjlText = "病情记录" + map.get("病情记录").replace("年   月   日   时   分 ","");
-        List<String> titles = Lists.newArrayList(
-                "病情记录",
-                "医师签名",
-                "签名时间",
-                "患者签名",
-                "签名时间"
-        );
-        titles = CommonAnalysisUtil.sortTitlesNoColon(titles, bqjlText);
-        CommonAnalysisUtil.cutByTitlesNoColon(bqjlText, titles, 0, map);
-        List<String> tits = Lists.newArrayList(
-                "签名时间",
-                "患者签名"
-        );
-        tits = CommonAnalysisUtil.sortTitlesNoColon(tits, text);
-        CommonAnalysisUtil.cutByTitlesNoColon(text, tits, 0, map);
-    }
 }

+ 641 - 0
trans/src/main/java/com/lantone/qc/trans/yuhangsy/util/comsis/YuhangsyCommonAnalysisUtil.java

@@ -0,0 +1,641 @@
+package com.lantone.qc.trans.yuhangsy.util.comsis;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.util.StringUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.nodes.Node;
+import org.jsoup.select.Elements;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @Description :余杭三院自定义
+ * @Author : HUJING
+ * @Date: 2020/9/10 13:48
+ */
+@Slf4j
+public class YuhangsyCommonAnalysisUtil {
+
+    /**
+     * 取文书中全部文本
+     *
+     * @param html
+     * @return
+     */
+    public static String html2String(String html) {
+        try {
+            Document document = Jsoup.parse(html);
+            Element body = document.select("body").first();
+            List<Node> nodes = body.childNodes();
+            Node node = nodes.get(0);
+            if (" ".equals(node.toString())) {
+                node = nodes.get(1);
+            }
+            String htmlContent = null;
+            if (node instanceof Element) {
+                Element element = (Element) node;
+                htmlContent = element.text();
+            }
+            return htmlContent;
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+            return "";
+        }
+    }
+
+    public static void html2StructureMap(List<String> titles, String htmlText, Map<String, String> structureMap) {
+        List<String> sortTitles = sortTitles(titles, htmlText);
+        cutByTitles(htmlText, sortTitles, 0, structureMap);
+    }
+
+    /**
+     * 将html内容以行为单位存进list,从<hr>之后开始处理
+     *
+     * @param html 原始html内容
+     * @return
+     */
+    public List<String> html2List(String html, boolean existHr) {
+        List<String> htmlText = Lists.newArrayList();
+        Document document = Jsoup.parse(html);
+        Element body = document.select("body").first();
+        List<Node> nodes = body.childNodes();
+        List<Node> subNodes = nodes.get(0).childNodes();
+        boolean findNode = false;
+        for (Node node : subNodes) {
+            if ("hr".equals(node.nodeName())) {
+                findNode = true;
+                continue;
+            }
+            if (findNode || !existHr) {
+                Element element = (Element) node;
+                Elements elements = element.select("div");
+                for (Element e : elements) {
+                    String text = e.text();
+                    if (text.length() > 150) {
+                        continue;
+                    }
+                    htmlText.add(text);
+                }
+            }
+        }
+        if (htmlText.get(0).length() > 200) {
+            htmlText.remove(0);
+        }
+        return htmlText;
+    }
+
+    /**
+     * 将html内容以table的格式存进list
+     *
+     * @param html 原始html内容
+     * @return
+     */
+    public void html2ListByTable(String html, List<String> htmlText) {
+        Elements trs = Jsoup.parse(html).select("table").select("tr");
+        for (int i = 0; i < trs.size(); i++) {
+            Elements tds = trs.get(i).select("td");
+            for (int j = 0; j < tds.size(); j++) {
+                String text = tds.get(j).text();
+                htmlText.add(text);
+            }
+        }
+    }
+
+    /**
+     * 将list中html内容转换成structureMap
+     *
+     * @param titles       文书各标题
+     * @param htmlText     html内容以行的形式存储list
+     * @param structureMap
+     * @return
+     */
+    public void html2StructureMap(List<String> titles, List<String> htmlText, Map<String, String> structureMap) {
+        StringBuffer sb = new StringBuffer();
+        for (String line : htmlText) {
+            String text = line.replaceAll("[   ]", " ");
+            if (text.length() == 0) {
+                continue;
+            }
+            sb.append(text).append("\n");
+        }
+        html2StructureMap(titles, sb.toString(), structureMap);
+    }
+
+    /**
+     * 根据文书各标题截取相应文本,存入structmap中
+     *
+     * @param line         原始文本
+     * @param titles       文书各标题
+     * @param depth        递归深度,也就是titles取值时的下标值
+     * @param structureMap 存储结构化数据
+     */
+    public static void cutByTitles(String line, List<String> titles, int depth, Map<String, String> structureMap) {
+        if (depth > titles.size() || titles.size() == 0) {
+            return;
+        }
+        String beforeTitle = null, title = null, newTitle = null, value = null;
+        beforeTitle = StringUtil.removeBlank(titles.get(Math.max(depth - 1, 0)));
+        title = titles.get(Math.min(depth, titles.size() - 1));
+        if (depth == titles.size()) {
+            /*if (line.contains("\n")) {
+                line = line.split("\n")[0];
+            }
+            */
+            value = line.replace("\n", "");
+            if (StringUtil.isBlank(structureMap.get(beforeTitle))) {
+                structureMap.put(beforeTitle, StringUtil.trim(value));
+            }
+            return;
+        }
+        if (line.contains(title + ":") || line.contains(title + ":")) {
+            if (line.contains(title + ":")) {
+                newTitle = title + ":";
+            } else {
+                newTitle = title + ":";
+            }
+            if (depth > 0) {
+                value = line.substring(0, line.indexOf(newTitle));
+                if (StringUtil.isBlank(structureMap.get(beforeTitle))) {
+                    structureMap.put(beforeTitle, StringUtil.trim(value).replace("\n", ""));
+                }
+            }
+            line = line.substring(line.indexOf(newTitle) + newTitle.length());
+            depth++;
+        } else {
+            titles.remove(depth);
+        }
+        cutByTitles(line, titles, depth, structureMap);
+    }
+
+    /**
+     * 将title根据在文本中的位置排序
+     *
+     * @param titles
+     * @param content
+     * @return
+     */
+    public static List<String> sortTitles(List<String> titles, String content) {
+        Map<Integer, String> titleIndex = new TreeMap<>();
+        int index, index_1, index_2;
+        for (String title : titles) {
+            index_1 = content.indexOf(title + ":");
+            index_2 = content.indexOf(title + ":");
+            index = Math.max(index_1, index_2);
+            if (index != -1) {
+                titleIndex.put(index, title);
+                StringBuffer sb = new StringBuffer(title.length());
+                for (int i = 0; i < title.length(); i++) {
+                    sb.append('*');
+                }
+                content = content.substring(0, index) + sb.toString() + content.substring(index + title.length() + 1);
+                //                content = content.substring(0, index) + content.substring(index + title.length() + 1);
+            }
+        }
+        titles = Lists.newArrayList(titleIndex.values());
+        return titles;
+    }
+
+    /**
+     * 标题没有冒号版本
+     */
+    public static void html2StructureMapNoColon(List<String> titles, String htmlText, Map<String, String> structureMap) {
+        List<String> sortTitlesNoColon = sortTitlesNoColon(titles, htmlText);
+        cutByTitlesNoColon(htmlText, sortTitlesNoColon, 0, structureMap);
+    }
+
+    /**
+     * 标题没有冒号版本
+     */
+    public static void cutByTitlesNoColon(String line, List<String> titles, int depth, Map<String, String> structureMap) {
+        if (depth > titles.size() || titles.size() == 0) {
+            return;
+        }
+        String beforeTitle = null, title = null, newTitle = null, value = null;
+        beforeTitle = StringUtil.removeBlank(titles.get(Math.max(depth - 1, 0)));
+        title = titles.get(Math.min(depth, titles.size() - 1));
+        if (depth == titles.size()) {
+            value = line;
+            value = value.trim();
+            if (value.startsWith(":") || value.startsWith(":")) {
+                value = value.replaceFirst("[::]", "");
+            }
+            if (StringUtil.isBlank(structureMap.get(beforeTitle))) {
+                structureMap.put(beforeTitle, StringUtil.trim(value).replace("\n", ""));
+            }
+            return;
+        }
+        if (line.contains(title)) {
+            newTitle = title;
+            if (depth > 0) {
+                value = line.substring(0, line.indexOf(newTitle));
+                value = value.trim();
+                if (value.startsWith(":") || value.startsWith(":")) {
+                    value = value.replaceFirst("[::]", "");
+                }
+                if (StringUtil.isBlank(structureMap.get(beforeTitle))) {
+                    structureMap.put(beforeTitle, StringUtil.trim(value).replace("\n", ""));
+                }
+            }
+            line = line.substring(line.indexOf(newTitle) + newTitle.length());
+            depth++;
+        } else {
+            titles.remove(depth);
+        }
+        cutByTitlesNoColon(line, titles, depth, structureMap);
+    }
+
+    /**
+     * 标题没有冒号版本
+     */
+    public static List<String> sortTitlesNoColon(List<String> titles, String content) {
+        Map<Integer, String> titleIndex = new TreeMap<>();
+        int index;
+        for (String title : titles) {
+            index = content.indexOf(title);
+            if (index != -1) {
+                titleIndex.put(index, title);
+                content = content.replace(title, "");
+            }
+        }
+        titles = Lists.newArrayList(titleIndex.values());
+        return titles;
+    }
+
+    /**
+     * 抽取文本中的第一个时间(余杭三院)
+     *
+     * @param top
+     * @return
+     */
+    public static String extractDate(String top) {
+        Pattern pattern = Pattern.compile("[0-9]{4}[-][0-9]{1,2}[-][0-9]{1,2}([ ][0-9]{1,2}[:][0-9]{1,2}([:][0-9]{1,2})?)?");
+        Pattern pattern2 = Pattern.compile("[0-9]{4}[年][0-9]{1,2}[月][0-9]{1,2}[日][0-9]{1,2}[时][0-9]{1,2}[分]([0-9]{1,2}[秒])?");
+        Matcher matcher = pattern.matcher(top);
+        Matcher matcher2 = pattern2.matcher(top);
+        if (matcher2.find()) {
+            return matcher2.group(0);
+        } else if (matcher.find()) {
+            return matcher.group(0);
+        } else {
+            Pattern p1 = Pattern.compile("[0-9]{4}年[0-9]+月[0-9]+日[0-9]+时[0-9]+分");
+            Matcher m1 = p1.matcher(top);
+            if (m1.find()) {
+                return m1.group(0);
+            } else {
+                Pattern p2 = Pattern.compile("[0-9]{4}年[0-9]+月[0-9]+日 [0-9]+:[0-9]+ | [0-9]{4}年[0-9]+月[0-9]+日[0-9]+:[0-9]+ ");
+                Matcher m2 = p2.matcher(top);
+                if (m2.find()) {
+                    return m2.group(0);
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 宁波中医院抽取文本中的第一个时间
+     *
+     * @param top
+     * @return
+     */
+    public static String NBZYExtractDate(String top) {
+        Pattern p1 = Pattern.compile("[0-9]{4}年[0-9]+月[0-9]+日");
+        Matcher m1 = p1.matcher(top);
+        if (m1.find()) {
+            return m1.group(0);
+        }
+        return null;
+    }
+
+    /**
+     * 温附一抽取文本中的第一个时间
+     *
+     * @param top
+     * @return
+     */
+    public static String WFYExtractDate(String top) {
+        Pattern p1 = Pattern.compile("[0-9]+月[0-9]+日[0-9]+时[0-9]+分");
+        Matcher m1 = p1.matcher(top);
+        if (m1.find()) {
+            return m1.group(0);
+        }
+        return null;
+    }
+
+    /**
+     * 宁海医院抽取文本中的第一个时间
+     *
+     * @param top
+     * @return
+     */
+    public static String NHExtractDate(String top) {
+        Pattern pattern = Pattern.compile("[0-9]{4}年[0-9]+月[0-9]+日 [0-9]+:[0-9]+ | [0-9]{4}年[0-9]+月[0-9]+日[0-9]+:[0-9]+");
+        Matcher matcher = pattern.matcher(top);
+        if (matcher.find()) {
+            return matcher.group(0);
+        } else {
+            Pattern p1 = Pattern.compile("[0-9]{4}年[0-9]+月[0-9]+日[0-9]+时[0-9]+分");
+            Matcher m1 = p1.matcher(top);
+            if (m1.find()) {
+                return m1.group(0);
+            } else {
+                Pattern p2 = Pattern.compile("[0-9]{4}[-][0-9]{1,2}[-][0-9]{1,2}([ ][0-9]{1,2}[:][0-9]{1,2}([:][0-9]{1,2})?)?");
+                Matcher m2 = p2.matcher(top);
+                if (m2.find()) {
+                    return m2.group(0);
+                }
+            }
+            Pattern pattern3 = Pattern.compile("[0-9]{4}年[0-9]+月[0-9]+日 [0-9]+:[0-9]+|[0-9]{4}年[0-9]+月[0-9]+日[0-9]+:[0-9]+");
+            Matcher matcher3 = pattern3.matcher(top);
+            if (matcher3.find()) {
+                return matcher3.group(0);
+            }
+
+        }
+        return null;
+    }
+
+    /**
+     * 根据title重新存放时间
+     *
+     * @param structmap
+     * @param title
+     */
+    public static void extractDateByTitle(Map<String, String> structmap, String title) {
+        if (structmap.containsKey(title)) {
+            String date = extractDate(structmap.get(title));
+            if (StringUtil.isNotBlank(date)) {
+                structmap.put(title, date);
+            }
+        }
+    }
+
+    /**
+     * 若内容中是包含选择框(会诊类型:     急会诊       普通会诊         请院外会诊),特殊处理
+     *
+     * @param structureMap
+     */
+    public static void processType(Map<String, String> structureMap, String title) {
+        if (structureMap.containsKey(title)) {
+            String type = structureMap.get(title);
+            type = type.replace(" ", "").replace("\uF06F", " \uF06F")
+                    .replace("\uF0FE", " \uF0FE");
+            String[] types = type.split(" ");
+            String s = "";
+            for (String t : types) {
+                if (t.contains("\uF0FE")) {
+                    s += t;
+                }
+            }
+            s = s.replace("\uF0FE", "");
+            structureMap.put(title, s);
+        }
+    }
+
+    /**
+     * 若内容中是包含选择框(会诊类型:     急会诊       普通会诊         请院外会诊),特殊处理
+     *
+     * @param structureMap
+     */
+    public static void processTypeRight(Map<String, String> structureMap, String title) {
+        if (structureMap.containsKey(title)) {
+            String type = structureMap.get(title);
+            String[] types = type.split(" ");
+            String s = "";
+            for (String t : types) {
+                if (t.contains("\uF0FE")) {
+                    s += t;
+                }
+            }
+            s = s.replace("\uF0FE", "");
+            structureMap.put(title, s);
+        }
+    }
+
+    /**
+     * 若list中其中一个元素包含之后第二个、第三个元素的文本,则把这个元素删除
+     *
+     * @param htmlList
+     */
+    public static void removeRepeat(List<String> htmlList) {
+        List<Integer> index = Lists.newArrayList();
+        if (htmlList.size() < 3) {
+            return;
+        }
+        String str1 = null, str2 = null, str3 = null;
+        for (int i = 0; i < htmlList.size() - 2; i++) {
+            str1 = htmlList.get(i);
+            str2 = htmlList.get(i + 1);
+            str3 = htmlList.get(i + 2);
+            if (str1.contains(str2) && str1.contains(str3)) {
+                index.add(i);
+            }
+        }
+
+        for (int i = 0; i < index.size(); i++) {
+            htmlList.remove(index.get(i) - i);
+        }
+    }
+
+    /**
+     * 宁海用抽取自定义病程录信息
+     *
+     * @param htmlText
+     * @param structureMap
+     */
+    public static void NHExtractWardInfo(String recTitle, String htmlText, Map<String, String> structureMap) {
+        if (StringUtil.isNotBlank(htmlText)) {
+            htmlText = htmlText.replaceAll("[   \n]", " ").replace("第1页", "")
+                    .replace("\n", " ");
+            String date = NHExtractDate(htmlText);
+            if (date != null) {
+                structureMap.put("病历日期", date);
+                htmlText = htmlText.replace(date, "").trim();
+            }
+            List<String> titleContent = Lists.newArrayList(htmlText.split(" "));
+            String title = titleContent.get(0);
+            String jointTitle = titleContent.get(1);
+            if (StringUtil.isNotBlank(title) && StringUtil.isNotBlank(jointTitle) && jointTitle.contains("医师查房记录")) {
+                structureMap.put("病历标题", title + jointTitle);
+                titleContent.remove(0);
+                titleContent.remove(0);
+            } else {
+                structureMap.put("病历标题", recTitle);
+                titleContent.remove(0);
+            }
+            StringBuffer sb = new StringBuffer();
+            for (String text : titleContent) {
+                sb.append(text).append(" ");
+            }
+            String content = sb.toString();
+            if (content.contains("<img")) {
+                String[] contentDoctor = content.split("<img");
+                structureMap.put("病情记录", contentDoctor[0]);
+                structureMap.put("记录医生", "<img" + contentDoctor[1]);
+            } else {
+                structureMap.put("病情记录", content);
+            }
+//            if (structureMap.containsKey("病情记录")) {
+//                String info = structureMap.get("病情记录");
+//                if (info.contains("医生签名")) {
+//                    structureMap.put("病情记录", info.substring(0, info.lastIndexOf("医生签名")));
+//                    structureMap.put("记录医生", "");
+//                } else if (info.contains("医师签名")) {
+//                    structureMap.put("病情记录", info.substring(0, info.lastIndexOf("医师签名")));
+//                    structureMap.put("记录医生", "");
+//                }
+//            }
+        }
+    }
+
+    /**
+     * 抽取自定义病程录信息
+     *
+     * @param htmlText
+     * @param structureMap
+     */
+    public static void extractWardInfo(String recTitle, String htmlText, Map<String, String> structureMap) {
+        if (StringUtil.isNotBlank(htmlText)) {
+            htmlText = htmlText.replaceAll("[   \n]", " ").replace("第1页", "")
+                    .replace("\n", " ");
+            String date = extractDate(htmlText);
+            if (date != null) {
+                structureMap.put("病历日期", date);
+                htmlText = htmlText.replace(date, "").trim();
+            }
+            List<String> titleContent = Lists.newArrayList(htmlText.split(" "));
+            String title = titleContent.get(0);
+            if (StringUtil.isNotBlank(title) && title.equals(recTitle)) {
+                structureMap.put("病历标题", title);
+                titleContent.remove(0);
+            } else {
+                structureMap.put("病历标题", recTitle);
+                structureMap.put("文书标题", title);
+                if (titleContent.size() > 2) {
+                    titleContent.remove(0);
+                    titleContent.remove(0);
+                }
+            }
+            StringBuffer sb = new StringBuffer();
+            for (String text : titleContent) {
+                sb.append(text).append(" ");
+            }
+            String content = sb.toString();
+            if (content.contains("<img")) {
+                String[] contentDoctor = content.split("<img");
+                structureMap.put("病情记录", contentDoctor[0]);
+                structureMap.put("记录医生", "<img" + contentDoctor[1]);
+            } else {
+                structureMap.put("病情记录", content);
+            }
+            if (structureMap.containsKey("病情记录")) {
+                String info = structureMap.get("病情记录");
+                if (info.contains("医生签名")) {
+                    structureMap.put("病情记录", info.substring(0, info.lastIndexOf("医生签名")));
+                    structureMap.put("记录医生", "");
+                } else if (info.contains("医师签名")) {
+                    structureMap.put("病情记录", info.substring(0, info.lastIndexOf("医师签名")));
+                    structureMap.put("记录医生", "");
+                }
+            }
+        }
+    }
+
+    /**
+     * 抽取自定义病程录信息(余杭三院)
+     *
+     * @param htmlText
+     * @param structureMap
+     */
+    public static void extractWardInfo2(String recTitle, String htmlText, Map<String, String> structureMap) {
+        if (StringUtil.isNotBlank(htmlText)) {
+            htmlText = htmlText.replaceAll("[   \n]", " ").replace("第1页", "")
+                    .replace("\n", " ");
+            String date = extractDate(htmlText);
+            if (date != null) {
+                structureMap.put("病历日期", date);
+                htmlText = htmlText.replaceFirst(date, "").trim();
+            }
+            List<String> titleContent = Lists.newArrayList(htmlText.split(" "));
+            String title = titleContent.get(0);
+            if (StringUtil.isNotBlank(title) && title.equals(recTitle)) {
+                structureMap.put("病历标题", title);
+                titleContent.remove(0);
+            } else {
+                structureMap.put("病历标题", recTitle);
+                if (title.contains(recTitle)) {
+                    titleContent.set(0, title.substring(title.indexOf(recTitle) + recTitle.length()));
+                }
+            }
+            StringBuffer sb = new StringBuffer();
+            for (String text : titleContent) {
+                sb.append(text).append(" ");
+            }
+            structureMap.put("病情记录", sb.toString());
+            if (structureMap.containsKey("病情记录")) {
+                String info = structureMap.get("病情记录");
+                if (info.contains("记录医师")) {
+                    structureMap.put("病情记录", info.substring(0, info.lastIndexOf("记录医师")));
+                    structureMap.put("记录医师", info.substring(info.lastIndexOf("记录医师") + "记录医师:".length()));
+                } else if (info.contains("医师签名")) {
+                    structureMap.put("病情记录", info.substring(0, info.lastIndexOf("医师签名")));
+                    structureMap.put("医师签名", info.substring(info.lastIndexOf("医师签名") + "医师签名:".length()));
+                }
+            }
+        }
+    }
+
+    /**
+     * 替换值
+     *
+     * @param map
+     * @param key
+     * @param afterKey
+     */
+    public static void repKey(Map<String, String> map, String key, String afterKey) {
+        if (StringUtil.isNotBlank(map.get(key))) {
+            map.put(key, map.get(key).replaceAll(afterKey, ""));
+        }
+    }
+
+    public static void makeEmpty(Map<String, String> structureMap, String... key) {
+        for (String k : key) {
+            if (structureMap.containsKey(k)) {
+                structureMap.put(k, "");
+            }
+        }
+    }
+
+    /**
+     * 格式时间从yyyy年MM月dd日HH时mm分到yyyy-MM-dd HH:mm
+     *
+     * @param map
+     */
+    public static void signatureTime1(String changeCame, Map<String, String> map) {
+        String goCureDoctor = map.get(changeCame);
+        if (StringUtil.isNotBlank(goCureDoctor)) {
+            try {
+                Pattern pattern2 = Pattern.compile("[0-9]{4}[年][0-9]{1,2}[月][0-9]{1,2}[日][0-9]{1,2}[时][0-9]{1,2}[分]");
+                Matcher matcher2 = pattern2.matcher(goCureDoctor);
+                if (!matcher2.find()) {
+                    return;
+                }
+                Date parse = new SimpleDateFormat("yyyy年MM月dd日HH时mm分").parse(goCureDoctor);
+                String format = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(parse);
+                map.put(changeCame, format);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}