Bladeren bron

分级护理对接添加

rengb 5 jaren geleden
bovenliggende
commit
bac1a4d435
1 gewijzigde bestanden met toevoegingen van 42 en 10 verwijderingen
  1. 42 10
      trans/src/main/java/com/lantone/qc/trans/changx/ChangxNursingSystemDocTrans.java

+ 42 - 10
trans/src/main/java/com/lantone/qc/trans/changx/ChangxNursingSystemDocTrans.java

@@ -1,9 +1,8 @@
 package com.lantone.qc.trans.changx;
 
+import com.google.common.collect.Lists;
 import com.lantone.qc.pub.model.doc.NursingSystemDoc;
-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.trans.ModelDocTrans;
 import com.lantone.qc.trans.comsis.ModelDocGenerate;
 import com.lantone.qc.trans.comsis.Preproc;
@@ -21,17 +20,50 @@ public class ChangxNursingSystemDocTrans extends ModelDocTrans {
     @Override
     public NursingSystemDoc extract(MedrecVo medrecVo) {
         String content = ((List<String>) medrecVo.getContent().get("content")).get(0);
-        Map<String, String> structureMap =
-                Preproc.extract_doc_pub(
-                        false,
-                        ListUtil.isEmpty(medrecVo.getLabel()) ? ModelStandardKeys.nursingSystem : medrecVo.getLabel(),
-                        content
-                );
-
-        NursingSystemDoc nursingSystemDoc = ModelDocGenerate.nursingSystemDocGen(structureMap);
+
+        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("病程记录时间"));
+
+        NursingSystemDoc nursingSystemDoc = ModelDocGenerate.nursingSystemDocGen(sourceMap);
         nursingSystemDoc.setText(content);
+        nursingSystemDoc.setPageData((Map) pageData);
 
         return nursingSystemDoc;
     }
 
+    private List<String> pageDataTitles = Lists.newArrayList(
+            "病程记录时间",
+            "病程记录名称",
+            "病程记录内容",
+            "记录医师"
+    );
+
+    private List<String> sourceTitles = Lists.newArrayList(
+            "病程记录时间",
+            "病程记录名称",
+            "病程记录内容",
+            "记录时间",
+            "记录医师"
+    );
+
 }