package com.lantone.qc.kernel.catalogue.xiamen.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.label.MaritalLabel;
import com.lantone.qc.pub.util.StringUtil;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @ClassName : BEH03091
 * @Description :  婚育史未填写
 * @Author : wsy
 * @Date: 2020-06-13 15:51
 */
@Component
public class BEH03091 extends QCCatalogue {
    @Override
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        if (inputInfo.getBeHospitalizedDoc() == null) {
            return;
        }
        MaritalLabel maritalLabel = inputInfo.getBeHospitalizedDoc().getMaritalLabel();
        if (maritalLabel == null || StringUtil.isBlank(maritalLabel.getText())) {
            status.set("-1");
            return;
        }
        Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
        if (StringUtil.isBlank(beHospitalStructureMap.get("婚育史"))) {
            status.set("-1");
            return;
        }
    }
}