Jelajahi Sumber

解决不同医院数据不同可能导致的空指针异常

zhanghang 4 tahun lalu
induk
melakukan
ccbbdaa058
1 mengubah file dengan 20 tambahan dan 9 penghapusan
  1. 20 9
      src/main/java/com/diagbot/facade/ConsoleFacade.java

+ 20 - 9
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -631,19 +631,28 @@ public class ConsoleFacade {
                 String behospitalCode = stringStringMap.get("behospitalCode");
                 //出院code
                 outHospitalCode.add(behospitalCode);
-                if (Double.parseDouble(stringStringMap.get("operationFee")) > 0) {
-                    //手术code
-                    operationCode.add(behospitalCode);
+                String operationFee = stringStringMap.get("operationFee");
+                String pathologyFee = stringStringMap.get("pathologyFee");
+                String antibiosisFee = stringStringMap.get("antibiosisFee");
+                if(StringUtil.isNotEmpty(operationFee)) {
+                    if (Double.parseDouble(operationFee) > 0) {
+                        //手术code
+                        operationCode.add(behospitalCode);
+                    }
                 }
-                if (Double.parseDouble(stringStringMap.get("operationFee")) > 0 && Double.parseDouble(stringStringMap.get("pathologyFee")) > QualityContent.pathologyFee) {
-                    //病理code
-                    operationPathologyCode.add(behospitalCode);
+                if(StringUtil.isNotEmpty(operationFee)) {
+                    if (Double.parseDouble(operationFee) > 0 && Double.parseDouble(pathologyFee) > QualityContent.pathologyFee) {
+                        //病理code
+                        operationPathologyCode.add(behospitalCode);
+                    }
                 }
-                if (Double.parseDouble(stringStringMap.get("antibiosisFee")) > 0) {
+                    if(StringUtil.isNotEmpty(operationFee)) {
+                if (Double.parseDouble(antibiosisFee) > 0) {
                     //抗菌code
                     antibiosisCode.add(behospitalCode);
                 }
             }
+            }
         }
                 if(ListUtil.isNotEmpty(adviceVerify)){
                     for (String code : adviceVerify) {
@@ -1114,6 +1123,8 @@ public class ConsoleFacade {
             }else {
                 mapCode.put("operationPathology",null);
             }
+
+            /****************************/
             if(bacterialCultureCode!=null && bacterialCultureCode.size()>0){
                 mapCode.put("bacterialCulture",bacterialCultureCode);
 
@@ -1125,8 +1136,8 @@ public class ConsoleFacade {
             }else {
                 mapCode.put("antibiosis",null);
             }
-            if(antibiosisBehospitalCode!=null && antibiosisBehospitalCode.size()>0){
-                mapCode.put("chemotherapyMalignantTumors",antibiosisBehospitalCode);
+            if(chemotherapyMalignantTumorsBehospitalCode!=null && chemotherapyMalignantTumorsBehospitalCode.size()>0){
+                mapCode.put("chemotherapyMalignantTumors",chemotherapyMalignantTumorsBehospitalCode);
             }else {
                 mapCode.put("chemotherapyMalignantTumors",null);
             }