Jelajahi Sumber

规则更新

rengb 5 tahun lalu
induk
melakukan
ff2eb9d25c

+ 10 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0026.java

@@ -3,7 +3,7 @@ package com.lantone.qc.kernel.catalogue.behospitalized;
 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.entity.AllergyFood;
+import com.lantone.qc.pub.model.entity.Allergy;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
@@ -20,9 +20,15 @@ public class BEH0026 extends QCCatalogue {
 
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        List<AllergyFood> allergyFoods = inputInfo.getBeHospitalizedDoc().getPastLabel().getAllergyFoods();
-        if (ListUtil.isNotEmpty(allergyFoods)) {
-            if (allergyFoods.stream().map(i -> i.getName()).filter(i -> StringUtil.isNotBlank(i)).count() > 0) {
+        List<Allergy> allergies = inputInfo.getBeHospitalizedDoc().getPastLabel().getAllergies();
+        if (ListUtil.isNotEmpty(allergies)) {
+            long count = allergies.stream().filter(
+                    i -> i != null
+                            && StringUtil.isNotBlank(i.getName())
+                            && i.getAllergyFood() != null
+                            && StringUtil.isNotBlank(i.getAllergyFood().getName())
+            ).count();
+            if (count > 0) {
                 status = "0";
             }
         }

+ 10 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0027.java

@@ -3,7 +3,7 @@ package com.lantone.qc.kernel.catalogue.behospitalized;
 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.entity.AllergyMedicine;
+import com.lantone.qc.pub.model.entity.Allergy;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
@@ -20,9 +20,15 @@ public class BEH0027 extends QCCatalogue {
 
     @Override
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        List<AllergyMedicine> allergyMedicines = inputInfo.getBeHospitalizedDoc().getPastLabel().getAllergyMedicines();
-        if (ListUtil.isNotEmpty(allergyMedicines)) {
-            if (allergyMedicines.stream().map(i -> i.getName()).filter(i -> StringUtil.isNotBlank(i)).count() > 0) {
+        List<Allergy> allergies = inputInfo.getBeHospitalizedDoc().getPastLabel().getAllergies();
+        if (ListUtil.isNotEmpty(allergies)) {
+            long count = allergies.stream().filter(
+                    i -> i != null
+                            && StringUtil.isNotBlank(i.getName())
+                            && i.getAllergyMedicine() != null
+                            && StringUtil.isNotBlank(i.getAllergyMedicine().getName())
+            ).count();
+            if (count > 0) {
                 status = "0";
             }
         }