|
@@ -2,9 +2,8 @@ package com.lantone.qc.trans.changx;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.lantone.qc.pub.model.doc.RescueDoc;
|
|
|
-import com.lantone.qc.pub.model.keys.ModelStandardKeys;
|
|
|
import com.lantone.qc.pub.model.vo.MedrecVo;
|
|
|
-import com.lantone.qc.pub.util.ListUtil;
|
|
|
+import com.lantone.qc.pub.util.MapUtil;
|
|
|
import com.lantone.qc.trans.ModelDocTrans;
|
|
|
import com.lantone.qc.trans.comsis.ModelDocGenerate;
|
|
|
import com.lantone.qc.trans.comsis.Preproc;
|
|
@@ -24,18 +23,60 @@ public class ChangxRescueDocTrans extends ModelDocTrans {
|
|
|
List<RescueDoc> retList = Lists.newArrayList();
|
|
|
List<String> contents = (List) medrecVo.getContent().get("content");
|
|
|
contents.forEach(content -> {
|
|
|
- Map<String, String> structureMap =
|
|
|
- Preproc.extract_doc_pub(
|
|
|
- false,
|
|
|
- ListUtil.isEmpty(medrecVo.getLabel()) ? ModelStandardKeys.rescue : medrecVo.getLabel(),
|
|
|
- content
|
|
|
- );
|
|
|
-
|
|
|
- RescueDoc rescueDoc = ModelDocGenerate.rescueDocGen(structureMap);
|
|
|
- rescueDoc.setText(content);
|
|
|
- retList.add(rescueDoc);
|
|
|
+ retList.add(getRescueDoc(content));
|
|
|
});
|
|
|
return retList;
|
|
|
}
|
|
|
|
|
|
+ private RescueDoc getRescueDoc(String content) {
|
|
|
+ Map<String, String> pageData = Preproc.extract_doc_pub(true, pageDataTitles, content);
|
|
|
+ pageData.put("病程记录内容",
|
|
|
+ pageData.get("病程记录内容")
|
|
|
+ .replace(pageData.get("病程记录时间"), "")
|
|
|
+ .replace(pageData.get("病程记录名称"), "")
|
|
|
+ );
|
|
|
+
|
|
|
+ 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("病程记录时间"));
|
|
|
+ MapUtil.keyAssig(sourceMap, "参与人员", "参加现场抢救的医师及护理人员");
|
|
|
+
|
|
|
+ RescueDoc rescueDoc = ModelDocGenerate.rescueDocGen(sourceMap);
|
|
|
+ rescueDoc.setText(content);
|
|
|
+ rescueDoc.setPageData((Map) pageData);
|
|
|
+
|
|
|
+ return rescueDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<String> pageDataTitles = Lists.newArrayList(
|
|
|
+ "病程记录时间",
|
|
|
+ "病程记录名称",
|
|
|
+ "病程记录内容",
|
|
|
+ "记录医师"
|
|
|
+ );
|
|
|
+
|
|
|
+ private List<String> sourceTitles = Lists.newArrayList(
|
|
|
+ "病程记录时间",
|
|
|
+ "病程记录名称",
|
|
|
+ "病程记录内容",
|
|
|
+ "抢救时间",
|
|
|
+ "记录时间",
|
|
|
+ "记录医师",
|
|
|
+ "抢救过程",
|
|
|
+ "参与人员",
|
|
|
+ "参加现场抢救的医师及护理人员"
|
|
|
+ );
|
|
|
+
|
|
|
}
|