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

import java.util.Map;


/**
 * @ClassName : BEH03092
 * @Description : 现病史未填写
 * @Author : wsy
 * @Date: 2021-01-14 17:28
 */
@Component
public class BEH03092 extends QCCatalogue {

    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
        if (beHospitalizedDoc == null) {
            return;
        }
        PresentLabel presentLabel = beHospitalizedDoc.getPresentLabel();
        if (presentLabel == null || StringUtil.isBlank(presentLabel.getText())) {
            status.set("-1");
            return;
        }
        Map<String, String> beHospitalStructureMap = beHospitalizedDoc.getStructureMap();
        if (StringUtil.isBlank(beHospitalStructureMap.get("现病史"))) {
            status.set("-1");
            return;
        }
    }
}