|
@@ -0,0 +1,62 @@
|
|
|
+package com.lantone.qc.trans.yiwu;
|
|
|
+
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+import com.lantone.qc.dbanaly.facade.shaoyf.ShaoyfXmlUtil;
|
|
|
+import com.lantone.qc.dbanaly.facade.yiwu.YiWuXmlUtil;
|
|
|
+import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
|
|
|
+import com.lantone.qc.pub.model.doc.InvasiveOperationDoc;
|
|
|
+import com.lantone.qc.pub.model.vo.MedrecVo;
|
|
|
+import com.lantone.qc.pub.util.FastJsonUtils;
|
|
|
+import com.lantone.qc.trans.ModelDocTrans;
|
|
|
+import com.lantone.qc.trans.comsis.CommonAnalysisUtil;
|
|
|
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description: 有创操作记录文档生成
|
|
|
+ * @author: rengb
|
|
|
+ * @time: 2020/3/17 13:27
|
|
|
+ */
|
|
|
+public class YiwuInvasiveOperationDocTrans extends ModelDocTrans {
|
|
|
+ private String modeId = "59";
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<InvasiveOperationDoc> extract(MedrecVo medrecVo) {
|
|
|
+ List<InvasiveOperationDoc> retList = Lists.newArrayList();
|
|
|
+ List<Map<String, Object>> contentMaps = (List) medrecVo.getContent().get("content");
|
|
|
+ contentMaps.forEach(contentMap -> {
|
|
|
+ retList.add(getInvasiveOperationDoc(contentMap));
|
|
|
+ });
|
|
|
+ return retList;
|
|
|
+ }
|
|
|
+
|
|
|
+ private InvasiveOperationDoc getInvasiveOperationDoc(Map<String, Object> contentMap) {
|
|
|
+ String content = contentMap.get("xmlText").toString();
|
|
|
+ Map<String, String> structureMap = null;
|
|
|
+ if (contentMap.get("isParsed") != null && "1".equals(contentMap.get("isParsed").toString())) {
|
|
|
+ structureMap = (Map) FastJsonUtils.getJsonToMap(content);
|
|
|
+ } else {
|
|
|
+ Map<String, String> sourceMap = YiWuXmlUtil.xmlToMap(content);
|
|
|
+ List<String> titles = Lists.newArrayList("病历日期");
|
|
|
+ String text = sourceMap.get("原始文本");
|
|
|
+ List<String> sortTitles = CommonAnalysisUtil.sortTitles(titles, text);
|
|
|
+ CommonAnalysisUtil.cutByTitles(text, sortTitles, 0, sourceMap);
|
|
|
+ sourceMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
|
|
|
+ sourceMap.put("mode_id=" + contentMap.get("modeId").toString(), "");
|
|
|
+ sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
|
|
|
+ structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts, modeId);
|
|
|
+ }
|
|
|
+ InvasiveOperationDoc invasiveOperationDoc = new InvasiveOperationDoc();
|
|
|
+ invasiveOperationDoc.setStructureMap(structureMap);
|
|
|
+ invasiveOperationDoc.setPageData((Map) structureMap);
|
|
|
+
|
|
|
+ return invasiveOperationDoc;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<String> keyContrasts = Lists.newArrayList(
|
|
|
+ "病程时间=病历日期",
|
|
|
+ "病程标题=操作名称",
|
|
|
+ "病程时间=操作步骤");
|
|
|
+}
|