Sfoglia il codice sorgente

死亡病例讨论记录对接修改

rengb 5 anni fa
parent
commit
1c9e440563

+ 45 - 9
trans/src/main/java/com/lantone/qc/trans/changx/ChangxDeathCaseDiscussDocTrans.java

@@ -2,10 +2,8 @@ package com.lantone.qc.trans.changx;
 
 import com.google.common.collect.Lists;
 import com.lantone.qc.pub.model.doc.DeathCaseDiscussDoc;
-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.pub.util.StringUtil;
 import com.lantone.qc.trans.ModelDocTrans;
 import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.Preproc;
@@ -24,8 +22,14 @@ public class ChangxDeathCaseDiscussDocTrans extends ModelDocTrans {
     public DeathCaseDiscussDoc extract(MedrecVo medrecVo) {
         String content = ((List<String>) medrecVo.getContent().get("content")).get(0);
 
+        Map<String, String> pageData = Preproc.extract_doc_pub(false, medrecVo.getLabel(), content);
+        pageData.put("病程记录内容",
+                pageData.get("病程记录内容")
+                        .replace(pageData.get("病程记录时间"), "")
+                        .replace(pageData.get("病程记录名称"), "")
+        );
+
         List<String> targetTitles = Lists.newArrayList();
-        List<String> sourceTitles = ListUtil.isEmpty(medrecVo.getLabel()) ? ModelStandardKeys.deathCaseDiscuss : medrecVo.getLabel();
         sourceTitles.forEach(sourceTitle -> {
             String targetTitle = "";
             for (int index = 0; index < sourceTitle.length(); index++) {
@@ -39,15 +43,47 @@ public class ChangxDeathCaseDiscussDocTrans extends ModelDocTrans {
         });
 
         Map<String, String> sourceMap = Preproc.extract_doc_pub(false, targetTitles, content);
-        Map<String, String> targetMap = MapUtil.copyMap((Map) sourceMap);
-        targetMap.put("记录时间", targetMap.get("病程记录时间"));
-        targetMap.remove("病程记录时间");
+        sourceMap.put("记录时间", sourceMap.get("病程记录时间"));
+        if (StringUtil.isBlank(sourceMap.get("参加讨论人员"))) {
+            sourceMap.put("参加讨论人员", sourceMap.get("参加讨论人员(包括职称及姓名)"));
+        }
+        if (StringUtil.isBlank(sourceMap.get("讨论主持人"))) {
+            sourceMap.put("讨论主持人", sourceMap.get("主持人"));
+        }
+        if (StringUtil.isBlank(sourceMap.get("死亡时间"))) {
+            sourceMap.put("死亡时间", sourceMap.get("出院时间"));
+        }
+        if (StringUtil.isBlank(sourceMap.get("死亡原因"))) {
+            sourceMap.put("死亡原因", sourceMap.get("结论"));
+        }
 
-        DeathCaseDiscussDoc deathCaseDiscussDoc = ModelDocGenerate.deathCaseDiscussDocGen(targetMap);
+        DeathCaseDiscussDoc deathCaseDiscussDoc = ModelDocGenerate.deathCaseDiscussDocGen(sourceMap);
         deathCaseDiscussDoc.setText(content);
-        deathCaseDiscussDoc.setPageData((Map) sourceMap);
+        deathCaseDiscussDoc.setPageData((Map) pageData);
 
         return deathCaseDiscussDoc;
     }
 
+    private List<String> sourceTitles = Lists.newArrayList(
+            "病程记录时间",
+            "病程记录名称",
+            "病程记录内容",
+            "记录时间",
+            "记录医师",
+            "入院时间",
+            "死亡时间",
+            "出院时间",
+            "入院诊断",
+            "死亡诊断",
+            "讨论时间",
+            "讨论地点",
+            "参加讨论人员(包括职称及姓名)",
+            "参加讨论人员",
+            "主持人",
+            "讨论主持人",
+            "讨论内容",
+            "死亡原因",
+            "结论"
+    );
+
 }