|
@@ -6,6 +6,7 @@ import com.lantone.qc.pub.model.OutputInfo;
|
|
|
import com.lantone.qc.pub.model.entity.Dead;
|
|
|
import com.lantone.qc.pub.model.entity.Family;
|
|
|
import com.lantone.qc.pub.model.label.FamilyLabel;
|
|
|
+import com.lantone.qc.pub.util.ListUtil;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -21,24 +22,28 @@ import java.util.List;
|
|
|
public class BEH0072 extends QCCatalogue {
|
|
|
@Override
|
|
|
protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
|
|
|
+ status.set("0");
|
|
|
if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getFamilyLabel() != null) {
|
|
|
FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
|
|
|
List<Family> families = familyLabel.getFamilies();
|
|
|
+ if (ListUtil.isEmpty(families)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
int deadObjectNum = 0;
|
|
|
for (Family family : families) {
|
|
|
if (family.getDead() == null) {
|
|
|
deadObjectNum++;
|
|
|
} else {
|
|
|
Dead dead = family.getDead();
|
|
|
- if ((dead.getDeadReason() != null && StringUtil.isNotBlank(dead.getDeadReason().getName())
|
|
|
- || (dead.getUnknow() != null && StringUtil.isNotBlank(dead.getUnknow().getName())))) {
|
|
|
- status.set("0");
|
|
|
+ if (dead.getDeadReason() != null && StringUtil.isBlank(dead.getDeadReason().getName())
|
|
|
+ && dead.getUnknow() != null && StringUtil.isBlank(dead.getUnknow().getName())) {
|
|
|
+ status.set("-1");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (deadObjectNum == families.size()){
|
|
|
- status.set("0");
|
|
|
+ if (deadObjectNum != families.size()) {
|
|
|
+ status.set("-1");
|
|
|
}
|
|
|
}
|
|
|
}
|