|
@@ -2,11 +2,12 @@ package com.lantone.qc.trans.beilun;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Maps;
|
|
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.doc.FirstCourseRecordDoc;
|
|
import com.lantone.qc.pub.model.vo.MedrecVo;
|
|
import com.lantone.qc.pub.model.vo.MedrecVo;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
import com.lantone.qc.trans.ModelDocTrans;
|
|
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.ModelDocGenerate;
|
|
import com.lantone.qc.trans.comsis.OrdinaryAssistant;
|
|
import com.lantone.qc.trans.comsis.OrdinaryAssistant;
|
|
import com.lantone.qc.trans.comsis.Preproc;
|
|
import com.lantone.qc.trans.comsis.Preproc;
|
|
@@ -27,24 +28,33 @@ public class BeiLunFirstCourseRecordDocTrans extends ModelDocTrans {
|
|
public FirstCourseRecordDoc extract(MedrecVo medrecVo) {
|
|
public FirstCourseRecordDoc extract(MedrecVo medrecVo) {
|
|
Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
|
|
Map<String, Object> contentMap = ((List<Map>) medrecVo.getContent().get("content")).get(0);
|
|
String content = contentMap.get("xmlText").toString();
|
|
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.setText(text);
|
|
- firstCourseRecordDoc.setPageData((Map) cutWordMap);
|
|
|
|
|
|
+ firstCourseRecordDoc.setPageData((Map) structureMap);
|
|
List<String> keys = Lists.newArrayList("需求评估", "预期目标", "诊疗计划", "治疗监测计划");
|
|
List<String> keys = Lists.newArrayList("需求评估", "预期目标", "诊疗计划", "治疗监测计划");
|
|
String treatPlanJoin = structureMapJoin(structureMap, keys);
|
|
String treatPlanJoin = structureMapJoin(structureMap, keys);
|
|
firstCourseRecordDoc.getTreatPlanLabel().setAiText(treatPlanJoin);
|
|
firstCourseRecordDoc.getTreatPlanLabel().setAiText(treatPlanJoin);
|
|
return firstCourseRecordDoc;
|
|
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) {
|
|
private Map<String, String> getCutWordMap(String content) {
|
|
Map<String, String> retMap = Maps.newHashMap();
|
|
Map<String, String> retMap = Maps.newHashMap();
|
|
if (StringUtil.isBlank(content)) {
|
|
if (StringUtil.isBlank(content)) {
|