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.Diag;
import com.lantone.qc.pub.model.entity.Family;
import com.lantone.qc.pub.model.label.FamilyLabel;
import com.lantone.qc.pub.util.StringUtil;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassName : BEH0074
 * @Description : 两系三代内是否有肿瘤病史未描述
 * @Author : 胡敬
 * @Date: 2020-03-11 17:05
 */
@Component
public class BEH0074 extends QCCatalogue {
    @Override
    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
        if (inputInfo.getBeHospitalizedDoc() == null) {
            status.set("0");
            return;
        }
        if (inputInfo.getBeHospitalizedDoc().getFamilyLabel() != null) {
            FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
            List<Family> families = familyLabel.getFamilies();
            for (Family family : families) {
                if (family.getTumour() != null) {
                    status.set("0");
                }
            }
        }
    }
}