|
@@ -3,8 +3,11 @@ package com.lantone.qc.trans.changx;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.lantone.qc.pub.model.doc.DifficultCaseDiscussDoc;
|
|
|
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.changx.util.CxXmlUtil;
|
|
|
import com.lantone.qc.trans.comsis.ModelDocGenerate;
|
|
|
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
|
|
|
import com.lantone.qc.trans.comsis.Preproc;
|
|
|
|
|
|
import java.util.List;
|
|
@@ -28,47 +31,24 @@ public class ChangxDifficultCaseDiscussDocTrans extends ModelDocTrans {
|
|
|
}
|
|
|
|
|
|
private DifficultCaseDiscussDoc getDifficultCaseDiscussDoc(String content) {
|
|
|
- Map<String, String> pageData = Preproc.extract_doc_pub(true, pageDataTitles, content);
|
|
|
- pageData.put("病程记录内容",
|
|
|
- pageData.get("病程记录内容")
|
|
|
- .replace(pageData.get("病程记录时间"), "")
|
|
|
- .replace(pageData.get("病程记录名称"), "")
|
|
|
- );
|
|
|
+ Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue("//DocObjContent//Region", content);
|
|
|
+ Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(xmlNodeValueMap, keyContrasts);
|
|
|
|
|
|
- List<String> targetTitles = Lists.newArrayList();
|
|
|
- sourceTitles.forEach(sourceTitle -> {
|
|
|
- String targetTitle = "";
|
|
|
- for (int index = 0; index < sourceTitle.length(); index++) {
|
|
|
- if (index == sourceTitle.length() - 1) {
|
|
|
- targetTitle += sourceTitle.substring(index, index + 1);
|
|
|
- } else {
|
|
|
- targetTitle += sourceTitle.substring(index, index + 1) + "[\\s\\p{Zs}]*";
|
|
|
- }
|
|
|
- }
|
|
|
- targetTitles.add(targetTitle);
|
|
|
- });
|
|
|
-
|
|
|
- Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
|
|
|
- sourceMap.put("记录时间", sourceMap.get("病程记录时间"));
|
|
|
+ String text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Region/Content_Text");
|
|
|
+ if (StringUtil.isBlank(text)) {
|
|
|
+ text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Region");
|
|
|
+ }
|
|
|
+ Map<String, String> cutWordMap = Preproc.getCutWordMap(true, sourceTitles, text);
|
|
|
+ cutWordMap.putAll(structureMap);
|
|
|
|
|
|
- DifficultCaseDiscussDoc difficultCaseDiscussDoc = ModelDocGenerate.difficultCaseDiscussDocGen(sourceMap);
|
|
|
+ DifficultCaseDiscussDoc difficultCaseDiscussDoc = ModelDocGenerate.difficultCaseDiscussDocGen(cutWordMap);
|
|
|
difficultCaseDiscussDoc.setText(content);
|
|
|
- difficultCaseDiscussDoc.setPageData((Map) pageData);
|
|
|
+ difficultCaseDiscussDoc.setPageData((Map) xmlNodeValueMap);
|
|
|
|
|
|
return difficultCaseDiscussDoc;
|
|
|
}
|
|
|
|
|
|
- private List<String> pageDataTitles = Lists.newArrayList(
|
|
|
- "病程记录时间",
|
|
|
- "病程记录名称",
|
|
|
- "病程记录内容",
|
|
|
- "记录医师"
|
|
|
- );
|
|
|
-
|
|
|
private List<String> sourceTitles = Lists.newArrayList(
|
|
|
- "病程记录时间",
|
|
|
- "病程记录名称",
|
|
|
- "病程记录内容",
|
|
|
"记录时间",
|
|
|
"记录医师",
|
|
|
"入院时间",
|
|
@@ -82,4 +62,6 @@ public class ChangxDifficultCaseDiscussDocTrans extends ModelDocTrans {
|
|
|
"结论"
|
|
|
);
|
|
|
|
|
|
+ private List<String> keyContrasts = Lists.newArrayList();
|
|
|
+
|
|
|
}
|