package com.lantone.qc.kernel.catalogue.behospitalized;

import com.lantone.qc.kernel.catalogue.QCCatalogue;
import com.lantone.qc.kernel.util.CatalogueUtil;
import com.lantone.qc.pub.model.InputInfo;
import com.lantone.qc.pub.model.OutputInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

/**
 * @ClassName : BEH0494
 * @Description :  入院记录由非执业医师填写
 * @Author : Mark
 * @Date: 2020-04-07 10:36
 */
@Component
public class BEH0494 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        if (inputInfo.getBeHospitalizedDoc() == null) {
            status.set("0");
            return;
        }
        String doctorName = "";
        if (inputInfo.getBeHospitalizedDoc().getStructureMap() != null) {
            doctorName = inputInfo.getBeHospitalizedDoc().getStructureMap().get("签名");
        }
        if (StringUtils.isNotEmpty(doctorName)) {
            if (CatalogueUtil.isOccup(doctorName)) {
                status.set("0");
                return;
            }
        } else {
            status.set("0");
        }
    }
}