|
@@ -1,10 +1,14 @@
|
|
|
package com.lantone.qc.trans.changx;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import com.google.common.collect.Maps;
|
|
|
import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
|
|
|
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,13 +32,33 @@ public class ChangxThreeLevelWardDocTrans extends ModelDocTrans {
|
|
|
}
|
|
|
|
|
|
private ThreeLevelWardDoc getThreeLevelWardDoc(String content) {
|
|
|
- Map<String, String> pageData = Preproc.extract_doc_pub(true, pageDataTitles, content);
|
|
|
- pageData.put("病程记录内容",
|
|
|
- pageData.get("病程记录内容")
|
|
|
- .replace(pageData.get("病程记录时间"), "")
|
|
|
- .replace(pageData.get("病程记录名称"), "")
|
|
|
- );
|
|
|
+ String text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Region/Content_Text");
|
|
|
+ if (StringUtil.isBlank(text)) {
|
|
|
+ text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Region");
|
|
|
+ }
|
|
|
+ Map<String, String> cutWordMap = getCutWordMap(text);
|
|
|
+ Map<String, String> xmlNodeValueMap = CxXmlUtil.firstLevelNodeValue("//DocObjContent//Region", content);
|
|
|
+ cutWordMap.putAll(xmlNodeValueMap);
|
|
|
+ Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(cutWordMap, keyContrasts);
|
|
|
+ structureMap.put("记录时间", structureMap.get("记录日期"));
|
|
|
+ structureMap.put("查房日期", structureMap.get("记录日期"));
|
|
|
+ structureMap.put("病情记录", text);
|
|
|
+ int endIndex = text.indexOf("查房记录");
|
|
|
+ if (endIndex > 0) {
|
|
|
+ String title = text.substring(0, endIndex);
|
|
|
+ title = title.substring(title.lastIndexOf(" ") + 1) + "查房记录";
|
|
|
+ structureMap.put("查房标题", title);
|
|
|
+ }
|
|
|
+ ThreeLevelWardDoc threeLevelWardDoc = ModelDocGenerate.threeLevelWardDocGen(structureMap);
|
|
|
+ threeLevelWardDoc.setText(text);
|
|
|
+ threeLevelWardDoc.setPageData((Map) xmlNodeValueMap);
|
|
|
+ return threeLevelWardDoc;
|
|
|
+ }
|
|
|
|
|
|
+ private Map<String, String> getCutWordMap(String content) {
|
|
|
+ if (StringUtil.isBlank(content)) {
|
|
|
+ return Maps.newHashMap();
|
|
|
+ }
|
|
|
List<String> targetTitles = Lists.newArrayList();
|
|
|
sourceTitles.forEach(sourceTitle -> {
|
|
|
String targetTitle = "";
|
|
@@ -47,35 +71,15 @@ public class ChangxThreeLevelWardDocTrans extends ModelDocTrans {
|
|
|
}
|
|
|
targetTitles.add(targetTitle);
|
|
|
});
|
|
|
-
|
|
|
- Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
|
|
|
- sourceMap.put("记录时间", sourceMap.get("病程记录时间"));
|
|
|
- sourceMap.put("查房标题", sourceMap.get("病程记录名称"));
|
|
|
- sourceMap.put("病情记录", sourceMap.get("病程记录内容"));
|
|
|
-
|
|
|
- ThreeLevelWardDoc threeLevelWardDoc = ModelDocGenerate.threeLevelWardDocGen(sourceMap);
|
|
|
- threeLevelWardDoc.setText(content);
|
|
|
- threeLevelWardDoc.setPageData((Map) pageData);
|
|
|
-
|
|
|
- return threeLevelWardDoc;
|
|
|
+ return Preproc.extract_doc_pub(true, targetTitles, content);
|
|
|
}
|
|
|
|
|
|
- private List<String> pageDataTitles = Lists.newArrayList(
|
|
|
- "病程记录时间",
|
|
|
- "病程记录名称",
|
|
|
- "病程记录内容",
|
|
|
- "记录医师"
|
|
|
+ private List<String> sourceTitles = Lists.newArrayList(
|
|
|
+ "记录医生"
|
|
|
);
|
|
|
|
|
|
- private List<String> sourceTitles = Lists.newArrayList(
|
|
|
- "病程记录时间",
|
|
|
- "病程记录名称",
|
|
|
- "病程记录内容",
|
|
|
- "查房标题",
|
|
|
- "病情记录",
|
|
|
- "查房日期",
|
|
|
- "记录时间",
|
|
|
- "记录医师"
|
|
|
+ private List<String> keyContrasts = Lists.newArrayList(
|
|
|
+ "记录医生=记录医师"
|
|
|
);
|
|
|
|
|
|
}
|