Quellcode durchsuchen

北仑trans层修改bug

huj vor 4 Jahren
Ursprung
Commit
c89951a982

+ 21 - 11
trans/src/main/java/com/lantone/qc/trans/beilun/BeiLunFirstCourseRecordDocTrans.java

@@ -2,11 +2,12 @@ package com.lantone.qc.trans.beilun;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
-import com.lantone.qc.dbanaly.facade.changx.CxXmlUtil;
 import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.StringUtil;
 import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.beilun.util.BeiLunFirstCourseRecordHtmlAnalysis;
+import com.lantone.qc.trans.beilun.util.CommonAnalysisUtil;
 import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.OrdinaryAssistant;
 import com.lantone.qc.trans.comsis.Preproc;
@@ -27,24 +28,33 @@ public class BeiLunFirstCourseRecordDocTrans extends ModelDocTrans {
     public FirstCourseRecordDoc extract(MedrecVo medrecVo) {
         Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
         String content = contentMap.get("xmlText").toString();
-        Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue(content);
-        xmlNodeValueMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
-        xmlNodeValueMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
-        Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(xmlNodeValueMap, keyContrasts);
+        String recTypeId = contentMap.get("recTypeId").toString();
+        BeiLunFirstCourseRecordHtmlAnalysis beiLunFirstCourseRecordHtmlAnalysis = new BeiLunFirstCourseRecordHtmlAnalysis();
+        Map<String, String> sourceMap = beiLunFirstCourseRecordHtmlAnalysis.analysis(content, recTypeId);
+        sourceMap = removeSerialNumber(sourceMap);
+        //Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue(content);
+        sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
+        sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
+        Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
 
-        String text = CxXmlUtil.getXmlText(content);
-        Map<String, String> cutWordMap = getCutWordMap(text);
-        cutWordMap.putAll(structureMap);
-
-        FirstCourseRecordDoc firstCourseRecordDoc = ModelDocGenerate.firstCourseRecordDocGen(cutWordMap);
+        String text = CommonAnalysisUtil.html2String(content);
+//        Map<String, String> cutWordMap = getCutWordMap(text);
+//        cutWordMap.putAll(structureMap);
+        FirstCourseRecordDoc firstCourseRecordDoc = ModelDocGenerate.firstCourseRecordDocGen(structureMap);
         firstCourseRecordDoc.setText(text);
-        firstCourseRecordDoc.setPageData((Map) cutWordMap);
+        firstCourseRecordDoc.setPageData((Map) structureMap);
         List<String> keys = Lists.newArrayList("需求评估", "预期目标", "诊疗计划", "治疗监测计划");
         String treatPlanJoin = structureMapJoin(structureMap, keys);
         firstCourseRecordDoc.getTreatPlanLabel().setAiText(treatPlanJoin);
         return firstCourseRecordDoc;
     }
 
+    private Map<String, String> removeSerialNumber(Map<String, String> sourceMap) {
+        Map<String, String> structureMap = Maps.newLinkedHashMap();
+        sourceMap.forEach((key, value) -> structureMap.put(key.replaceAll("[一二三四五六()()]", ""), value));
+        return structureMap;
+    }
+
     private Map<String, String> getCutWordMap(String content) {
         Map<String, String> retMap = Maps.newHashMap();
         if (StringUtil.isBlank(content)) {

+ 1 - 1
trans/src/main/java/com/lantone/qc/trans/beilun/BeiLunDocTrans.java

@@ -18,7 +18,7 @@ import java.util.stream.Collectors;
  * @Author : 楼辉荣
  * @Date: 2020-03-03 19:47
  */
-public class BeiLunDocTrans extends DocTrans {
+public class BeilunDocTrans extends DocTrans {
 
     @Override
     protected InputInfo extract(QueryVo queryVo) {

+ 1 - 1
trans/src/main/java/com/lantone/qc/trans/beilun/util/BeiLunFirstCourseRecordHtmlAnalysis.java

@@ -27,7 +27,7 @@ public class BeiLunFirstCourseRecordHtmlAnalysis implements BeiLunHtmlAnalysis {
             CommonAnalysisUtil.html2StructureMap(titles, htmlContent, structureMap);
         }
         CommonAnalysisUtil.extractDateByTitle(structureMap, "时间");
-        structureMap.put("rec_title=", "107");
+//        structureMap.put("rec_title=", "107");
 
         return structureMap;
     }