|
@@ -4,6 +4,7 @@ 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.Allergy;
|
|
|
+import com.lantone.qc.pub.model.label.PastLabel;
|
|
|
import com.lantone.qc.pub.util.ListUtil;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -22,7 +23,7 @@ public class BEH0026 extends QCCatalogue {
|
|
|
|
|
|
@Override
|
|
|
public void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
- if(inputInfo.getBeHospitalizedDoc() == null){
|
|
|
+ if (inputInfo.getBeHospitalizedDoc() == null) {
|
|
|
status.set("0");
|
|
|
return;
|
|
|
}
|
|
@@ -31,14 +32,23 @@ public class BEH0026 extends QCCatalogue {
|
|
|
status.set("0");
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- List<Allergy> allergies = inputInfo.getBeHospitalizedDoc().getPastLabel().getAllergies();
|
|
|
+ PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
|
|
|
+ if (pastLabel == null) {
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String pastText = pastLabel.getText();
|
|
|
+ if (StringUtil.isNotBlank(pastText) && pastText.contains("食物过敏史")) {
|
|
|
+ status.set("0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<Allergy> allergies = pastLabel.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())
|
|
|
+ // && i.getAllergyFood() != null
|
|
|
+ // && StringUtil.isNotBlank(i.getAllergyFood().getName())
|
|
|
).count();
|
|
|
if (count > 0) {
|
|
|
status.set("0");
|