|
@@ -3,8 +3,11 @@ package com.lantone.qc.trans.changx;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.lantone.qc.pub.model.doc.DeathRecordDoc;
|
|
|
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;
|
|
@@ -21,51 +24,57 @@ public class ChangxDeathRecordDocTrans extends ModelDocTrans {
|
|
|
public DeathRecordDoc extract(MedrecVo medrecVo) {
|
|
|
String content = ((List<String>) medrecVo.getContent().get("content")).get(0);
|
|
|
|
|
|
- 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", 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);
|
|
|
- });
|
|
|
+ String text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Content_Text");
|
|
|
+ if (StringUtil.isBlank(text)) {
|
|
|
+ text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent");
|
|
|
+ }
|
|
|
+ Map<String, String> cutWordMap = Preproc.getCutWordMap(true, sourceTitles, text);
|
|
|
+ cutWordMap.putAll(structureMap);
|
|
|
|
|
|
- Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
|
|
|
- sourceMap.put("记录时间", sourceMap.get("病程记录时间"));
|
|
|
- sourceMap.put("死亡原因", sourceMap.get("病程记录内容"));
|
|
|
-
|
|
|
- DeathRecordDoc deathRecordDoc = ModelDocGenerate.deathRecordDocGen(sourceMap);
|
|
|
- deathRecordDoc.setText(content);
|
|
|
- deathRecordDoc.setPageData((Map) pageData);
|
|
|
+ DeathRecordDoc deathRecordDoc = ModelDocGenerate.deathRecordDocGen(cutWordMap);
|
|
|
+ deathRecordDoc.setText(text);
|
|
|
+ deathRecordDoc.setPageData((Map) xmlNodeValueMap);
|
|
|
|
|
|
return deathRecordDoc;
|
|
|
}
|
|
|
|
|
|
- private List<String> pageDataTitles = Lists.newArrayList(
|
|
|
- "病程记录时间",
|
|
|
- "病程记录名称",
|
|
|
- "病程记录内容",
|
|
|
- "记录医师"
|
|
|
- );
|
|
|
-
|
|
|
private List<String> sourceTitles = Lists.newArrayList(
|
|
|
- "病程记录时间",
|
|
|
- "病程记录名称",
|
|
|
- "病程记录内容",
|
|
|
+ "姓名",
|
|
|
+ "性别",
|
|
|
+ "科别",
|
|
|
+ "床号",
|
|
|
+ "病案号",
|
|
|
+ "年龄",
|
|
|
+ "入院时间",
|
|
|
+ "死亡时间",
|
|
|
+ "入院情况",
|
|
|
+ "发病经过",
|
|
|
+ "入院诊断",
|
|
|
+ "诊疗经过",
|
|
|
"死亡原因",
|
|
|
+ "死亡诊断",
|
|
|
"记录医师",
|
|
|
"记录时间"
|
|
|
);
|
|
|
|
|
|
+ private List<String> keyContrasts = Lists.newArrayList(
|
|
|
+ "姓名++++患者姓名=姓名",
|
|
|
+ "性别=",
|
|
|
+ "病区++++病区名称=",
|
|
|
+ "床号=",
|
|
|
+ "病案号++++住院号=病案号",
|
|
|
+ "入院时间=",
|
|
|
+ "死亡时间=",
|
|
|
+ "入院情况=",
|
|
|
+ "入院诊断++++初步诊断=入院诊断",
|
|
|
+ "诊疗经过=",
|
|
|
+ "死亡原因=",
|
|
|
+ "死亡诊断++++初步诊断=死亡诊断",
|
|
|
+ "签名++++=记录医师",
|
|
|
+ "签名时间=记录时间"
|
|
|
+ );
|
|
|
+
|
|
|
}
|