|
@@ -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 {
|