Browse Source

Merge branch 'dev-template' into dev

rengb 5 năm trước cách đây
mục cha
commit
a84f1c1b58

+ 15 - 33
trans/src/main/java/com/lantone/qc/trans/changx/ChangxDifficultCaseDiscussDocTrans.java

@@ -3,8 +3,11 @@ package com.lantone.qc.trans.changx;
 import com.google.common.collect.Lists;
 import com.lantone.qc.pub.model.doc.DifficultCaseDiscussDoc;
 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;
@@ -28,47 +31,24 @@ public class ChangxDifficultCaseDiscussDocTrans extends ModelDocTrans {
     }
 
     private DifficultCaseDiscussDoc getDifficultCaseDiscussDoc(String content) {
-        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//Region", 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);
-        });
-
-        Map<String, String> sourceMap = Preproc.extract_doc_pub(true, targetTitles, content);
-        sourceMap.put("记录时间", sourceMap.get("病程记录时间"));
+        String text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Region/Content_Text");
+        if (StringUtil.isBlank(text)) {
+            text = CxXmlUtil.getTextByNodePath(content, "//DocObjContent/Region");
+        }
+        Map<String, String> cutWordMap = Preproc.getCutWordMap(true, sourceTitles, text);
+        cutWordMap.putAll(structureMap);
 
-        DifficultCaseDiscussDoc difficultCaseDiscussDoc = ModelDocGenerate.difficultCaseDiscussDocGen(sourceMap);
+        DifficultCaseDiscussDoc difficultCaseDiscussDoc = ModelDocGenerate.difficultCaseDiscussDocGen(cutWordMap);
         difficultCaseDiscussDoc.setText(content);
-        difficultCaseDiscussDoc.setPageData((Map) pageData);
+        difficultCaseDiscussDoc.setPageData((Map) xmlNodeValueMap);
 
         return difficultCaseDiscussDoc;
     }
 
-    private List<String> pageDataTitles = Lists.newArrayList(
-            "病程记录时间",
-            "病程记录名称",
-            "病程记录内容",
-            "记录医师"
-    );
-
     private List<String> sourceTitles = Lists.newArrayList(
-            "病程记录时间",
-            "病程记录名称",
-            "病程记录内容",
             "记录时间",
             "记录医师",
             "入院时间",
@@ -82,4 +62,6 @@ public class ChangxDifficultCaseDiscussDocTrans extends ModelDocTrans {
             "结论"
     );
 
+    private List<String> keyContrasts = Lists.newArrayList();
+
 }

+ 16 - 9
trans/src/main/java/com/lantone/qc/trans/changx/ChangxDocTrans.java

@@ -61,10 +61,10 @@ public class ChangxDocTrans extends DocTrans {
                 ChangxDeathRecordDocTrans deathRecordDocTrans = new ChangxDeathRecordDocTrans();
                 inputInfo.setDeathRecordDoc(deathRecordDocTrans.extract(i));
             }
-            //            if (i.getTitle().equals("疑难病例讨论记录")) {
-            //                ChangxDifficultCaseDiscussDocTrans difficultCaseDiscussDocTrans = new ChangxDifficultCaseDiscussDocTrans();
-            //                inputInfo.setDifficultCaseDiscussDocs(difficultCaseDiscussDocTrans.extract(i));
-            //            }
+            if (i.getTitle().equals("疑难病例讨论记录")) {
+                ChangxDifficultCaseDiscussDocTrans difficultCaseDiscussDocTrans = new ChangxDifficultCaseDiscussDocTrans();
+                inputInfo.setDifficultCaseDiscussDocs(difficultCaseDiscussDocTrans.extract(i));
+            }
             if (i.getTitle().equals("医嘱信息")) {
                 ChangxDoctorAdviceDocTrans doctorAdviceDocTrans = new ChangxDoctorAdviceDocTrans();
                 inputInfo.setDoctorAdviceDocs(doctorAdviceDocTrans.extract(i));
@@ -109,6 +109,10 @@ public class ChangxDocTrans extends DocTrans {
                 ChangxThreeLevelWardDocTrans threeLevelWardDocTrans = new ChangxThreeLevelWardDocTrans();
                 inputInfo.setThreeLevelWardDocs(threeLevelWardDocTrans.extract(i));
             }
+            if (i.getTitle().equals("病理检验送检单")) {
+                ChangxPathologyShipDocTrans pathologyShipDocTrans = new ChangxPathologyShipDocTrans();
+                inputInfo.setPathologyShipDocs(pathologyShipDocTrans.extract(i));
+            }
             //            if (i.getTitle().equals("知情同意书")) {
             //                ChangxInformedConsentDocTrans informedConsentDocTrans = new ChangxInformedConsentDocTrans();
             //                inputInfo.setInformedConsentDoc(informedConsentDocTrans.extract(i));
@@ -154,12 +158,12 @@ public class ChangxDocTrans extends DocTrans {
         if (ListUtil.isNotEmpty(inputInfo.getCriticallyIllNoticeDocs())) {
             inputInfo.getPageData().put("病危通知书", inputInfo.getCriticallyIllNoticeDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
         }
-        //        if (ListUtil.isNotEmpty(inputInfo.getDifficultCaseDiscussDocs())) {
-        //            inputInfo.getPageData().put("疑难病例讨论记录", inputInfo.getDifficultCaseDiscussDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
-        //        }
-        if (ListUtil.isNotEmpty(inputInfo.getDoctorAdviceDocs())) {
-            inputInfo.getPageData().put("医嘱信息", inputInfo.getDoctorAdviceDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
+        if (ListUtil.isNotEmpty(inputInfo.getDifficultCaseDiscussDocs())) {
+            inputInfo.getPageData().put("疑难病例讨论记录", inputInfo.getDifficultCaseDiscussDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
         }
+        //        if (ListUtil.isNotEmpty(inputInfo.getDoctorAdviceDocs())) {
+        //            inputInfo.getPageData().put("医嘱信息", inputInfo.getDoctorAdviceDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
+        //        }
         //        if (ListUtil.isNotEmpty(inputInfo.getDutyShiftSystemDocs())) {
         //            inputInfo.getPageData().put("值班交接制度", inputInfo.getDutyShiftSystemDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
         //        }
@@ -175,6 +179,9 @@ public class ChangxDocTrans extends DocTrans {
         if (ListUtil.isNotEmpty(inputInfo.getThreeLevelWardDocs())) {
             inputInfo.getPageData().put("查房记录", inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
         }
+        if (ListUtil.isNotEmpty(inputInfo.getPathologyShipDocs())) {
+            inputInfo.getPageData().put("病理检验送检单", inputInfo.getPathologyShipDocs().stream().map(i -> i.getPageData()).collect(Collectors.toList()));
+        }
 
         if (ListUtil.isNotEmpty(inputInfo.getConsultationDocs())) {
             inputInfo.getPageData().put(

+ 42 - 0
trans/src/main/java/com/lantone/qc/trans/changx/ChangxPathologyShipDocTrans.java

@@ -0,0 +1,42 @@
+package com.lantone.qc.trans.changx;
+
+import com.google.common.collect.Lists;
+import com.lantone.qc.pub.model.doc.PathologyShipDoc;
+import com.lantone.qc.pub.model.vo.MedrecVo;
+import com.lantone.qc.trans.ModelDocTrans;
+import com.lantone.qc.trans.changx.util.CxXmlUtil;
+import com.lantone.qc.trans.comsis.OrdinaryAssistant;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : PathologyShipDocTrans
+ * @Description : 病理检验送检单
+ * @Author : 楼辉荣
+ * @Date: 2020-04-19 17:49
+ */
+public class ChangxPathologyShipDocTrans extends ModelDocTrans {
+    @Override
+    public List<PathologyShipDoc> extract(MedrecVo medrecVo) {
+        List<PathologyShipDoc> retList = Lists.newArrayList();
+        List<String> contents = (List) medrecVo.getContent().get("content");
+        contents.forEach(content -> {
+            retList.add(getPathologyShipDoc(content));
+        });
+        return retList;
+    }
+
+    private PathologyShipDoc getPathologyShipDoc(String content) {
+        Map<String, String> sourceMap = CxXmlUtil.firstLevelNodeValue("//DocObjContent//Region", content);
+        Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
+
+        PathologyShipDoc pathologyShipDoc = new PathologyShipDoc();
+        pathologyShipDoc.setStructureMap(structureMap);
+        pathologyShipDoc.setPageData((Map) structureMap);
+        return pathologyShipDoc;
+    }
+
+    private List<String> keyContrasts = Lists.newArrayList();
+
+}