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.doc.BeHospitalizedDoc;
import com.lantone.qc.pub.model.label.ChiefLabel;
import com.lantone.qc.pub.model.label.PastLabel;
import com.lantone.qc.pub.model.label.PresentLabel;
import com.lantone.qc.pub.util.StringUtil;
import org.springframework.stereotype.Component;

/**
 * @ClassName : BEH02988
 * @Description :  主诉未填写
 * @Author : 胡敬
 * @Date: 2020-06-23 19:35
 */
@Component
public class BEH02988 extends QCCatalogue {
    @Override
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
        //主诉
        ChiefLabel chiefLabel = beHospitalizedDoc.getChiefLabel();
        //现病史
        PresentLabel presentLabel = beHospitalizedDoc.getPresentLabel();
        //既往史
        PastLabel pastLabel = beHospitalizedDoc.getPastLabel();
        if (beHospitalizedDoc == null) {
            return;
        }
        if (StringUtil.isBlank(chiefLabel.getText()) && StringUtil.isNotBlank(presentLabel.getText()) ||
                StringUtil.isNotBlank(pastLabel.getText())) {
            status.set("-1");
            return;
        }
        if (chiefLabel == null && StringUtil.isBlank(chiefLabel.getText())) {
            status.set("-1");
        }
    }
}