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.util.StringUtil;
import org.springframework.stereotype.Component;

/**
 * @Description: 婚育史未填写
 * @author: rengb
 * @time: 2020/3/10 14:02
 */
@Component
public class BEH0052 extends QCCatalogue {

    @Override
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        if(inputInfo.getBeHospitalizedDoc() == null){
            status.set("0");
            return;
        }
        if(inputInfo.getBeHospitalizedDoc().getStructureMap().get("婚姻") != null
                && inputInfo.getBeHospitalizedDoc().getStructureMap().get("婚姻").contains("未婚")){
            status.set("0");
            return;
        }
        if (inputInfo.getBeHospitalizedDoc().getMaritalLabel() == null
                || StringUtil.isNotBlank(inputInfo.getBeHospitalizedDoc().getMaritalLabel().getText())) {
            status.set("0");
        }
    }

}