فهرست منبع

添加非空判断

hujing 5 سال پیش
والد
کامیت
7d9fcb2837

+ 5 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0376.java

@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
 import com.lantone.qc.pub.model.entity.Family;
 import com.lantone.qc.pub.model.label.MaritalLabel;
 import com.lantone.qc.pub.util.ListUtil;
@@ -26,13 +27,14 @@ public class BEH0376 extends QCCatalogue {
 
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        MaritalLabel maritalLabel = beHospitalizedDoc.getMaritalLabel();
         //台州市结构化的
-        Map<String, String> structureMap_beh = inputInfo.getBeHospitalizedDoc().getStructureMap();
-        if(StringUtils.isNotEmpty(structureMap_beh.get("子女健康状况"))){
+        Map<String, String> structureMap_beh = beHospitalizedDoc.getStructureMap();
+        if (StringUtils.isNotEmpty(structureMap_beh.get("子女健康状况"))) {
             status.set("0");
             return;
         }
-        MaritalLabel maritalLabel = inputInfo.getBeHospitalizedDoc().getMaritalLabel();
         if (maritalLabel == null || StringUtils.isEmpty(maritalLabel.getText())) {
             status.set("0");
             return;

+ 4 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC0092.java

@@ -19,7 +19,10 @@ public class FIRC0092 extends QCCatalogue {
         FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
         if (firstCourseRecordDoc != null) {
             TreatPlanLabel treatPlanLabel = firstCourseRecordDoc.getTreatPlanLabel();
-            if (treatPlanLabel != null && treatPlanLabel.getNursingLevel() != null &&
+            if (treatPlanLabel == null){
+                return;
+            }
+            if (treatPlanLabel.getNursingLevel() != null &&
                     (treatPlanLabel.getMedicine() != null || treatPlanLabel.getTreat().size() > 0)) {
                 status.set("0");
             }

+ 14 - 11
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0192.java

@@ -1,4 +1,5 @@
 package com.lantone.qc.kernel.catalogue.firstpagerecord;
+
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
@@ -8,6 +9,7 @@ import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDoc;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
+
 import java.util.List;
 import java.util.Map;
 
@@ -23,21 +25,22 @@ public class FIRP0192 extends QCCatalogue {
         status.set("0");
         FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
         List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
-        if(operationDocs != null&& operationDocs.size()>0){
+        if (operationDocs != null && operationDocs.size() > 0) {
             OperationDoc operationDoc = operationDocs.get(0);
             OperationDiscussionDoc operationDiscussionDoc = operationDoc.getOperationDiscussionDoc();
-            Map<String, String> docStructureMap = operationDiscussionDoc.getStructureMap();
-            Map<String, Object> firstPageRecordDocStructureMap = firstPageRecordDoc.getStructureExtMap();
-            String opertaion = docStructureMap.get("手术方式");
-            List<Map<String, String>> mapList = (List<Map<String, String>>) firstPageRecordDocStructureMap.get(Content.operative_information);
-            if(mapList != null && mapList.size()>0){
-                Map<String, String> op = mapList.get(0);
-                String oName = op.get(Content.operative_name);
-                if(StringUtils.isNotEmpty(opertaion) && !opertaion.equals(oName)){
-                    status.set("-1");
+            if (operationDiscussionDoc != null) {
+                Map<String, String> docStructureMap = operationDiscussionDoc.getStructureMap();
+                Map<String, Object> firstPageRecordDocStructureMap = firstPageRecordDoc.getStructureExtMap();
+                String opertaion = docStructureMap.get("手术方式");
+                List<Map<String, String>> mapList = (List<Map<String, String>>) firstPageRecordDocStructureMap.get(Content.operative_information);
+                if (mapList != null && mapList.size() > 0) {
+                    Map<String, String> op = mapList.get(0);
+                    String oName = op.get(Content.operative_name);
+                    if (StringUtils.isNotEmpty(opertaion) && !opertaion.equals(oName)) {
+                        status.set("-1");
+                    }
                 }
             }
         }
-
     }
 }

+ 17 - 8
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0193.java

@@ -8,6 +8,7 @@ import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDoc;
 import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
@@ -29,25 +30,33 @@ public class FIRP0193 extends QCCatalogue {
         List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
         List<String> operations = new ArrayList<>();
         List<String> operations_first = new ArrayList<>();
-        if(operationDocs != null&& operationDocs.size()>0){
-            for (OperationDoc opd:operationDocs) {
-                operations.add(opd.getOperationDiscussionDoc().getStructureMap().get("手术方式"));
+        if (ListUtil.isNotEmpty(operationDocs)) {
+            for (OperationDoc opd : operationDocs) {
+                OperationDiscussionDoc operationDiscussionDoc = opd.getOperationDiscussionDoc();
+                if (operationDiscussionDoc == null) {
+                    continue;
+                }
+                String operativeMethod = operationDiscussionDoc.getStructureMap().get("手术方式");
+                if (StringUtil.isBlank(operativeMethod)){
+                    continue;
+                }
+                operations.add(operativeMethod);
             }
         }
         Map<String, Object> firstPageRecordDocStructureMap = firstPageRecordDoc.getStructureExtMap();
         List<Map<String, String>> mapList = (List<Map<String, String>>) firstPageRecordDocStructureMap.get(Content.operative_information);
-        if(mapList != null && mapList.size()>0){
-            for (Map<String, String> ds:mapList) {
+        if (mapList != null && mapList.size() > 0) {
+            for (Map<String, String> ds : mapList) {
                 String oName = ds.get(Content.operative_name);
-                if(StringUtils.isNotEmpty(oName)){
+                if (StringUtils.isNotEmpty(oName)) {
                     operations_first.add(oName);
                 }
             }
         }
         boolean equals = ListUtil.equals(operations, operations_first);
-        if(equals){
+        if (equals) {
             status.set("0");
-        }else {
+        } else {
             status.set("-1");
         }
 

+ 18 - 13
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0272.java

@@ -5,7 +5,10 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.FirstPageRecordDoc;
+import com.lantone.qc.pub.model.doc.LeaveHospitalDoc;
 import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.label.DiagLabel;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -14,29 +17,31 @@ import java.util.Map;
 /**
  * @ClassName : FIRP0272
  * @Description : 出院诊断顺序不规范
-    与出院小结里的出院诊断顺序做比较
+ * 与出院小结里的出院诊断顺序做比较
  * @Date: 2020-03-14 16:24
  */
 @Component
 public class FIRP0272 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        if(inputInfo.getLeaveHospitalDoc() != null && inputInfo.getFirstPageRecordDoc() != null){
-            //出院诊断
-            List<Diag> diags = inputInfo.getLeaveHospitalDoc().getLeaveDiagLabel().getDiags();
-            Map<String, Object> firstPageMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
-            if(firstPageMap != null){
-                List<String> outDiags = (List<String>) firstPageMap.get(Content.dischargeDiag);
-                if(outDiags != null && diags != null){
-                    if(outDiags.size() == diags.size()){
-                        if(outDiags.containsAll(diags)){
+        LeaveHospitalDoc leaveHospitalDoc = inputInfo.getLeaveHospitalDoc();
+        FirstPageRecordDoc firstPageRecordDoc = inputInfo.getFirstPageRecordDoc();
+        if (leaveHospitalDoc != null && firstPageRecordDoc != null) {
+            DiagLabel leaveDiagLabel = leaveHospitalDoc.getLeaveDiagLabel();
+            if (leaveDiagLabel != null) {
+                //出院诊断
+                List<Diag> diags = leaveDiagLabel.getDiags();
+                Map<String, Object> firstPageMap = firstPageRecordDoc.getStructureExtMap();
+                if (firstPageMap != null) {
+                    List<String> outDiags = (List<String>) firstPageMap.get(Content.dischargeDiag);
+                    if (outDiags != null && diags != null) {
+                        if (outDiags.size() == diags.size() && outDiags.containsAll(diags)) {
                             status.set("0");
                         }
+                    } else {
+                        status.set("0");
                     }
-                }else {
-                    status.set("0");
                 }
             }
         }
-
     }
 }

+ 15 - 11
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0147.java

@@ -7,6 +7,7 @@ import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.DeathRecordDoc;
 import com.lantone.qc.pub.model.entity.Diag;
+import com.lantone.qc.pub.model.label.DiagLabel;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,18 +31,21 @@ public class LEA0147 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
         DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
-        if(deathRecordDoc == null || deathRecordDoc.getText()==null){
-            List<Diag> diags = inputInfo.getLeaveHospitalDoc().getLeaveDiagLabel().getDiags();
-            Map<String, Map<String, String>> hospitalDiagMap = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DIAG_MAP);
-            if (ListUtil.isNotEmpty(diags) && hospitalDiagMap != null) {
-                long count = diags.stream().filter(i -> {
-                    if (i != null && StringUtil.isNotBlank(i.getHospitalDiagName())) {
-                        return hospitalDiagMap.get(i.getHospitalDiagName()) == null;
+        if (deathRecordDoc == null || deathRecordDoc.getText() == null) {
+            DiagLabel leaveDiagLabel = inputInfo.getLeaveHospitalDoc().getLeaveDiagLabel();
+            if (leaveDiagLabel != null) {
+                List<Diag> diags = leaveDiagLabel.getDiags();
+                Map<String, Map<String, String>> hospitalDiagMap = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DIAG_MAP);
+                if (ListUtil.isNotEmpty(diags) && hospitalDiagMap != null) {
+                    long count = diags.stream().filter(i -> {
+                        if (i != null && StringUtil.isNotBlank(i.getHospitalDiagName())) {
+                            return hospitalDiagMap.get(i.getHospitalDiagName()) == null;
+                        }
+                        return false;
+                    }).count();
+                    if (count > 0) {
+                        status.set("-1");
                     }
-                    return false;
-                }).count();
-                if (count > 0) {
-                    status.set("-1");
                 }
             }
         }