|
@@ -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";
|
|
|
}
|
|
|
}
|