Browse Source

规则更新

rengb 5 years atrás
parent
commit
e6fc76f2e6

+ 8 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0035.java

@@ -4,7 +4,7 @@ import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.kernel.util.CatalogueUtil;
 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.model.label.PastLabel;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
@@ -25,12 +25,16 @@ public class BEH0035 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status = "0";
         PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
-        List<AllergyMedicine> allergyMedicines = pastLabel.getAllergyMedicines();
-        if (ListUtil.isEmpty(allergyMedicines)) {
+        List<Allergy> allergies = pastLabel.getAllergies();
+        if (ListUtil.isEmpty(allergies)) {
             return;
         }
+
         List<String> wtAmNames = CatalogueUtil.noInQuotes(
-                allergyMedicines.stream().map(i -> i.getName()).filter(i -> StringUtil.isNotBlank(i)).distinct().collect(Collectors.toList()),
+                allergies.stream().filter(
+                        i -> i != null && StringUtil.isNotBlank(i.getName()) && i.getNegative() == null
+                                && i.getAllergyMedicine() != null && StringUtil.isNotBlank(i.getAllergyMedicine().getName()))
+                        .map(i -> i.getAllergyMedicine().getName()).distinct().collect(Collectors.toList()),
                 pastLabel.getText()
         );
         if (ListUtil.isNotEmpty(wtAmNames)) {