Bläddra i källkod

入院记录对接修改

rengb 5 år sedan
förälder
incheckning
5d4b551375
1 ändrade filer med 8 tillägg och 4 borttagningar
  1. 8 4
      trans/src/main/java/com/lantone/qc/trans/comsis/Preproc.java

+ 8 - 4
trans/src/main/java/com/lantone/qc/trans/comsis/Preproc.java

@@ -1,6 +1,7 @@
 package com.lantone.qc.trans.comsis;
 
 import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import com.lantone.qc.pub.model.keys.ModelStandardKeys;
 import com.lantone.qc.pub.util.FileUtil;
 import com.lantone.qc.pub.util.ListUtil;
@@ -44,13 +45,11 @@ public class Preproc {
         Map<String, String> sections = new HashMap<>();
         Map<String, Integer> sorted = new HashMap<>();
 
-        String key_ = null;
         for (String key : title) {
             Pattern pattern = Pattern.compile(key);
             Matcher matcher=pattern.matcher(line);
             while(matcher.find()){
                 key = matcher.group(0);
-                key_ = key.replaceAll("\\s\\p{Zs}","");
             }
 
             pos = 0;
@@ -60,7 +59,7 @@ public class Preproc {
                 if (isProgress) {
                     pos += key.length();
                     if (null == sorted.get(key)) {
-                        sorted.put(key_, pos);
+                        sorted.put(key, pos);
                     }
                 } else {
                     pos_newln = line.substring(0, pos).lastIndexOf(newline);
@@ -69,7 +68,7 @@ public class Preproc {
 
                     if (ln_pos == -1 || line.substring(ln_pos + tab.length(), pos).trim().length() == 0) {
                         pos += key.length();
-                        sorted.put(key_, pos);
+                        sorted.put(key, pos);
                     } else {
                         pos += 1;
                     }
@@ -105,6 +104,11 @@ public class Preproc {
         }
         sections.put(lbl, item);
 
+        Map<String,String> sectionsNew = Maps.newHashMap();
+        sections.keySet().forEach(key->{
+            sectionsNew.put(key.replaceAll("\\s\\p{Zs}",""),sections.get(key));
+        });
+
         return sections;
     }