Browse Source

义乌入院记录之前写的代码优化修改

fangqw 4 years ago
parent
commit
b9883b8e93

+ 10 - 10
trans/src/main/java/com/lantone/qc/trans/yiwu/YiWuBeHospitalizedDocTrans.java

@@ -80,12 +80,12 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
             sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
             sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
 
 
             //新生儿科姓名+姓名问题解决
             //新生儿科姓名+姓名问题解决
-            if (sourceMap.containsKey("姓名")) {
+            if (StringUtils.isNotEmpty(sourceMap.get("姓名"))) {
                 String value = sourceMap.get("姓名").split(" ")[0];
                 String value = sourceMap.get("姓名").split(" ")[0];
                 sourceMap.put("姓名", value);
                 sourceMap.put("姓名", value);
             }
             }
             //产科孕产次
             //产科孕产次
-            if (sourceMap.containsKey("入院记录")) {
+            if (StringUtils.isNotEmpty(sourceMap.get("入院记录"))) {
                 String value = sourceMap.get("入院记录").split(" ")[0];
                 String value = sourceMap.get("入院记录").split(" ")[0];
                 sourceMap.put("孕产次", value);
                 sourceMap.put("孕产次", value);
             }
             }
@@ -93,8 +93,8 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
             List<String> diagnosetitles = Lists.newArrayList("修正诊断",
             List<String> diagnosetitles = Lists.newArrayList("修正诊断",
                     "诊断和诊断修正", "补充诊断");
                     "诊断和诊断修正", "补充诊断");
             for (String diagnose : diagnosetitles) {
             for (String diagnose : diagnosetitles) {
-                if (sourceMap.containsKey(diagnose)) {
-                    String value = sourceMap.get(diagnose).replaceAll("医师签名", "")
+                if (StringUtils.isNotEmpty(sourceMap.get(diagnose))){
+                     String value = sourceMap.get(diagnose).replaceAll("医师签名", "")
                             .replaceAll(":|日    期|■|补充诊断|修正诊断|\"|:|日期|医生签名|签名时间", "")
                             .replaceAll(":|日    期|■|补充诊断|修正诊断|\"|:|日期|医生签名|签名时间", "")
                             .replaceAll("[0-9]{4}-[0-9]{2}-[0-9]{2}", "")
                             .replaceAll("[0-9]{4}-[0-9]{2}-[0-9]{2}", "")
                             .replace("--", "");
                             .replace("--", "");
@@ -102,22 +102,22 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
                 }
                 }
             }
             }
 
 
-            if (sourceMap.containsKey("初步诊断医师签名")) {
+            if (StringUtils.isNotEmpty(sourceMap.get("初步诊断医师签名"))) {
                 String value = sourceMap.get("初步诊断").replaceAll("日期|:|医师签名", "");
                 String value = sourceMap.get("初步诊断").replaceAll("日期|:|医师签名", "");
                 sourceMap.put("初步诊断", value);
                 sourceMap.put("初步诊断", value);
             }
             }
-            if (sourceMap.containsKey("医师签名")) {
+            if (StringUtils.isNotEmpty(sourceMap.get("医师签名"))) {
                 String value = sourceMap.get("医师签名").replaceAll("日期|:|医师签名|--|", "")
                 String value = sourceMap.get("医师签名").replaceAll("日期|:|医师签名|--|", "")
                         .replaceAll("\\d", "");
                         .replaceAll("\\d", "");
                 sourceMap.put("医师签名", value);
                 sourceMap.put("医师签名", value);
             }
             }
-            if (sourceMap.containsKey("医生签名")) {
+            if (StringUtils.isNotEmpty(sourceMap.get("医生签名"))) {
                 String value = sourceMap.get("医生签名").replaceAll("日期|:|医生签名|签名时间|--", "")
                 String value = sourceMap.get("医生签名").replaceAll("日期|:|医生签名|签名时间|--", "")
                         .replaceAll("\\d", "");
                         .replaceAll("\\d", "");
                 sourceMap.put("医生签名", value);
                 sourceMap.put("医生签名", value);
             }
             }
             //产科入院记录个人史处理
             //产科入院记录个人史处理
-            if (sourceMap.containsKey("个人史")) {
+            if (StringUtils.isNotEmpty(sourceMap.get("个人史"))) {
                 String value = sourceMap.get("个人史").split("月经史")[0];
                 String value = sourceMap.get("个人史").split("月经史")[0];
                 sourceMap.put("个人史", value);
                 sourceMap.put("个人史", value);
             }
             }
@@ -128,11 +128,11 @@ public class YiWuBeHospitalizedDocTrans extends ModelDocTrans {
                     "婚  姻", "民  族", "民    族", "供 史 者", "性      别", "婚    姻", "婚姻状况", "病史提供者");
                     "婚  姻", "民  族", "民    族", "供 史 者", "性      别", "婚    姻", "婚姻状况", "病史提供者");
             for (String str : titletitles) {
             for (String str : titletitles) {
                 String str1 = str.replaceAll("[  ]", "");
                 String str1 = str.replaceAll("[  ]", "");
-                if (sourceMap.containsKey(str)) {
+                if (StringUtils.isNotEmpty(sourceMap.get(str))) {
                     String value = (sourceMap.get(str).split(" ")[0]).split("\\\\n")[0];
                     String value = (sourceMap.get(str).split(" ")[0]).split("\\\\n")[0];
                     sourceMap.put(str1, value);
                     sourceMap.put(str1, value);
                 }
                 }
-                if (sourceMap.containsKey(str1)) {
+                if (StringUtils.isNotEmpty(sourceMap.get(str1))) {
                     String value = (sourceMap.get(str1).split(" ")[0]).split("\\\\n")[0];
                     String value = (sourceMap.get(str1).split(" ")[0]).split("\\\\n")[0];
                     sourceMap.put(str1, value);
                     sourceMap.put(str1, value);
                 }
                 }