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;

import java.util.Map;

/**
 * @ClassName : BEH0081
 * @Description : 辅助检查与结果未记录
 * @Author : 胡敬
 * @Date: 2020-03-11 19:29
 */
@Component
public class BEH0081 extends QCCatalogue {
    @Override
    protected void start(InputInfo inputInfo, OutputInfo outputInfo) {
        if (inputInfo.getBeHospitalizedDoc() == null) {
            status.set("0");
            return;
        }
        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
        if (StringUtils.isNotEmpty(structureMap.get("辅助检查结果"))) {
            status.set("0");
            return;
        }

        if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getPacsLabel() != null) {
            if (!CatalogueUtil.isEmpty(inputInfo.getBeHospitalizedDoc().getPacsLabel().getText())) {
                status.set("0");
            }
        }
    }
}