Ver código fonte

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

rengb 5 anos atrás
pai
commit
9338e5f026

+ 19 - 0
public/src/main/java/com/lantone/qc/pub/util/MapUtil.java

@@ -123,4 +123,23 @@ public class MapUtil {
         return retMap;
     }
 
+    /**
+     * map key同义词赋值
+     *
+     * @param map
+     * @param sourceKey
+     * @param targetKeys
+     */
+    public static void keyAssig(Map<String, String> map, String sourceKey, String... targetKeys) {
+        if (map == null || StringUtil.isBlank(sourceKey) || targetKeys == null || targetKeys.length == 0 || StringUtil.isNotBlank(map.get(sourceKey))) {
+            return;
+        }
+        for (String targetKey : targetKeys) {
+            if (StringUtil.isNotBlank(map.get(targetKey))) {
+                map.put(sourceKey, map.get(targetKey));
+                break;
+            }
+        }
+    }
+
 }

+ 18 - 17
trans/src/main/java/com/lantone/qc/trans/changx/ChangxDeathCaseDiscussDocTrans.java

@@ -3,7 +3,7 @@ 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.vo.MedrecVo;
-import com.lantone.qc.pub.util.StringUtil;
+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;
@@ -22,7 +22,7 @@ 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);
+        Map<String, String> pageData = Preproc.extract_doc_pub(true, pageDataTitles, content);
         pageData.put("病程记录内容",
                 pageData.get("病程记录内容")
                         .replace(pageData.get("病程记录时间"), "")
@@ -42,20 +42,13 @@ public class ChangxDeathCaseDiscussDocTrans extends ModelDocTrans {
             targetTitles.add(targetTitle);
         });
 
-        Map<String, String> sourceMap = Preproc.extract_doc_pub(false, targetTitles, content);
+        Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
         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("结论"));
-        }
+        MapUtil.keyAssig(sourceMap, "参加讨论人员", "参加讨论人员(包括职称及姓名)");
+        MapUtil.keyAssig(sourceMap, "讨论主持人", "主持人");
+        MapUtil.keyAssig(sourceMap, "死亡时间", "出院时间");
+        MapUtil.keyAssig(sourceMap, "结论", "总结");
+        MapUtil.keyAssig(sourceMap, "死亡原因", "结论");
 
         DeathCaseDiscussDoc deathCaseDiscussDoc = ModelDocGenerate.deathCaseDiscussDocGen(sourceMap);
         deathCaseDiscussDoc.setText(content);
@@ -64,6 +57,13 @@ public class ChangxDeathCaseDiscussDocTrans extends ModelDocTrans {
         return deathCaseDiscussDoc;
     }
 
+    private List<String> pageDataTitles = Lists.newArrayList(
+            "病程记录时间",
+            "病程记录名称",
+            "病程记录内容",
+            "记录医师"
+    );
+
     private List<String> sourceTitles = Lists.newArrayList(
             "病程记录时间",
             "病程记录名称",
@@ -71,9 +71,9 @@ public class ChangxDeathCaseDiscussDocTrans extends ModelDocTrans {
             "记录时间",
             "记录医师",
             "入院时间",
+            "入院诊断",
             "死亡时间",
             "出院时间",
-            "入院诊断",
             "死亡诊断",
             "讨论时间",
             "讨论地点",
@@ -83,7 +83,8 @@ public class ChangxDeathCaseDiscussDocTrans extends ModelDocTrans {
             "讨论主持人",
             "讨论内容",
             "死亡原因",
-            "结论"
+            "结论",
+            "总结"
     );
 
 }

+ 24 - 18
trans/src/main/java/com/lantone/qc/trans/changx/ChangxFirstCourseRecordDocTrans.java

@@ -3,9 +3,8 @@ 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.FirstCourseRecordDoc;
-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;
@@ -25,7 +24,6 @@ public class ChangxFirstCourseRecordDocTrans extends ModelDocTrans {
         String content = ((List<String>) medrecVo.getContent().get("content")).get(0);
 
         List<String> targetTitles = Lists.newArrayList();
-        List<String> sourceTitles = ListUtil.isEmpty(medrecVo.getLabel()) ? ModelStandardKeys.firstCourseRecord : medrecVo.getLabel();
         sourceTitles.forEach(sourceTitle -> {
             String targetTitle = "[一二三四五六七八九十]{0,1}[、.]{0,1}";
             for (int index = 0; index < sourceTitle.length(); index++) {
@@ -38,29 +36,37 @@ public class ChangxFirstCourseRecordDocTrans extends ModelDocTrans {
             targetTitles.add(targetTitle);
         });
 
-        Map<String, String> sourceMap = Preproc.extract_doc_pub(false, targetTitles, content);
-        sourceMap.put("病程记录内容",
-                sourceMap.get("病程记录内容")
-                        .replace(sourceMap.get("病程记录时间"), "")
-                        .replace(sourceMap.get("病程记录名称"), "")
-        );
-
+        Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
         Map<String, String> targetMap = Maps.newHashMap();
-        Map<String, Object> pageData = Maps.newHashMap();
         for (String key : sourceMap.keySet()) {
-            if (key.equals("病程记录时间")) {
-                targetMap.put("记录时间", sourceMap.get(key));
-            } else {
-                targetMap.put(key.replaceAll("[一二三四五六七八九十][、.]", ""), sourceMap.get(key));
-            }
-            pageData.put(key.replaceAll("[一二三四五六七八九十][、.]", ""), sourceMap.get(key));
+            targetMap.put(key.replaceAll("[一二三四五六七八九十][、.]", ""), sourceMap.get(key));
         }
+        targetMap.put("记录时间", sourceMap.get("病程记录时间"));
+        Map<String, String> pageData = MapUtil.copyMap((Map) targetMap);
+        pageData.put("病程记录内容",
+                pageData.get("病程记录内容")
+                        .replace(pageData.get("病程记录时间"), "")
+                        .replace(pageData.get("病程记录名称"), "")
+        );
 
         FirstCourseRecordDoc firstCourseRecordDoc = ModelDocGenerate.firstCourseRecordDocGen(targetMap);
         firstCourseRecordDoc.setText(content);
-        firstCourseRecordDoc.setPageData(pageData);
+        firstCourseRecordDoc.setPageData((Map) pageData);
 
         return firstCourseRecordDoc;
     }
 
+    private List<String> sourceTitles = Lists.newArrayList(
+            "病程记录时间",
+            "病程记录名称",
+            "病程记录内容",
+            "病例特点",
+            "初步诊断",
+            "诊断依据",
+            "鉴别诊断",
+            "诊疗计划",
+            "记录医师",
+            "记录时间"
+    );
+
 }

+ 33 - 16
trans/src/main/java/com/lantone/qc/trans/changx/ChangxThreeLevelWardDocTrans.java

@@ -2,10 +2,7 @@ package com.lantone.qc.trans.changx;
 
 import com.google.common.collect.Lists;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
-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,14 +21,20 @@ public class ChangxThreeLevelWardDocTrans extends ModelDocTrans {
     public List<ThreeLevelWardDoc> extract(MedrecVo medrecVo) {
         List<ThreeLevelWardDoc> retList = Lists.newArrayList();
         List<String> contents = (List) medrecVo.getContent().get("content");
-        List<String> sourceTitles = ListUtil.isEmpty(medrecVo.getLabel()) ? ModelStandardKeys.threeLevelWard : medrecVo.getLabel();
         contents.forEach(content -> {
-            retList.add(getThreeLevelWardDoc(content, sourceTitles));
+            retList.add(getThreeLevelWardDoc(content));
         });
         return retList;
     }
 
-    private ThreeLevelWardDoc getThreeLevelWardDoc(String content, List<String> sourceTitles) {
+    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("病程记录名称"), "")
+        );
+
         List<String> targetTitles = Lists.newArrayList();
         sourceTitles.forEach(sourceTitle -> {
             String targetTitle = "";
@@ -45,20 +48,34 @@ public class ChangxThreeLevelWardDocTrans extends ModelDocTrans {
             targetTitles.add(targetTitle);
         });
 
-        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("病程记录时间");
-        targetMap.put("查房标题", targetMap.get("病程记录名称"));
-        targetMap.remove("病程记录名称");
-        targetMap.put("病情记录", targetMap.get("病程记录内容"));
-        targetMap.remove("病程记录内容");
+        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(targetMap);
+        ThreeLevelWardDoc threeLevelWardDoc = ModelDocGenerate.threeLevelWardDocGen(sourceMap);
         threeLevelWardDoc.setText(content);
-        threeLevelWardDoc.setPageData((Map) sourceMap);
+        threeLevelWardDoc.setPageData((Map) pageData);
 
         return threeLevelWardDoc;
     }
 
+    private List<String> pageDataTitles = Lists.newArrayList(
+            "病程记录时间",
+            "病程记录名称",
+            "病程记录内容",
+            "记录医师"
+    );
+
+    private List<String> sourceTitles = Lists.newArrayList(
+            "病程记录时间",
+            "病程记录名称",
+            "病程记录内容",
+            "查房标题",
+            "病情记录",
+            "查房日期",
+            "记录时间",
+            "记录医师"
+    );
+
 }