Переглянути джерело

义乌:病案首页新生儿年龄解析

wangsy 4 роки тому
батько
коміт
02d910ba17

+ 20 - 0
dbanaly/src/main/java/com/lantone/qc/dbanaly/facade/yiwu/YiWuFirstPageRecordXmlUtil.java

@@ -57,6 +57,7 @@ public class YiWuFirstPageRecordXmlUtil {
     public static Map<String, Object> process(String xml) {
         Map<String, String> sourceMap = xmlToMap(xml);
         Map<String, String> structureMap = mapKeyContrast(sourceMap, keyContrasts);
+        newbornAge(structureMap);
         Map<String, Object> structureExtMap = Maps.newHashMap();
         structureExtMap.putAll(structureMap);
         JSONArray leaveDiags = new JSONArray();
@@ -70,6 +71,25 @@ public class YiWuFirstPageRecordXmlUtil {
         return structureExtMap;
     }
 
+    //新生儿年龄处理
+    public static void newbornAge(Map<String, String> structureMap) {
+        if (structureMap != null && structureMap.size() > 0) {
+            String text = structureMap.get("原始文本");
+            if (StringUtil.isNotBlank(text) && text.contains("年龄 Value1") && text.contains("新生儿出生体重克")) {
+                String substring = text.substring(text.indexOf("年龄 Value1"), text.indexOf("新生儿出生体重克"));
+                String[] split = substring.split(",");
+                if (split.length > 1) {
+                    if (split[0].contains("=") && split[0].indexOf("=") + 1 <= split[0].length()) {
+                        structureMap.put("新生儿出生月数", split[0].substring(split[0].indexOf("=") + 1));
+                    }
+                    if (split[1].contains("=") && split[1].indexOf("=") + 1 <= split[1].length()) {
+                        structureMap.put("新生儿出生天数", split[1].substring(split[1].indexOf("=") + 1));
+                    }
+                }
+            }
+        }
+    }
+
     public static Map<String, String> xmlToMap(String xml) {
         Map<String, String> map = Maps.newHashMap();
         try {

+ 0 - 16
trans/src/main/java/com/lantone/qc/trans/yiwu/YiWuFirstPageRecordDocTrans.java

@@ -7,7 +7,6 @@ import com.lantone.qc.dbanaly.util.ModuleMappingUtil;
 import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
 import com.lantone.qc.pub.model.vo.MedrecVo;
 import com.lantone.qc.pub.util.FastJsonUtils;
-import com.lantone.qc.pub.util.StringUtil;
 import com.lantone.qc.trans.ModelDocTrans;
 
 import java.util.List;
@@ -34,21 +33,6 @@ public class YiWuFirstPageRecordDocTrans extends ModelDocTrans {
         } else {
             structureExtMap = YiWuFirstPageRecordXmlUtil.process(content);
             structureExtMap.put("mode_id", ModuleMappingUtil.getDeptModuleId(modeId));
-            if (structureExtMap != null && structureExtMap.size() > 0) {
-                String text = (String) structureExtMap.get("原始文本");
-                if (StringUtil.isNotBlank(text) && text.contains("年龄 Value1") && text.contains("新生儿出生体重克")) {
-                    String substring = text.substring(text.indexOf("年龄 Value1"), text.indexOf("新生儿出生体重克"));
-                    String[] split = substring.split(",");
-                    if (split.length > 1) {
-                        if (split[0].contains("=") && split[0].indexOf("=") + 1 <= split[0].length()) {
-                            structureExtMap.put("新生儿出生月数", split[0].substring(split[0].indexOf("=") + 1));
-                        }
-                        if (split[1].contains("=") && split[1].indexOf("=") + 1 <= split[1].length()) {
-                            structureExtMap.put("新生儿出生天数", split[1].substring(split[1].indexOf("=") + 1));
-                        }
-                    }
-                }
-            }
             firstPageRecordDoc.setStructureExtMap(structureExtMap);
         }
         structureExtMap.forEach((k, v) -> structureMap.put(k, v.toString()));