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.PacsLabel;
import com.lantone.qc.pub.util.StringUtil;
import org.springframework.stereotype.Component;

import java.util.Map;


/**
 * @ClassName : BEH0493
 * @Description : 辅助检查未填写
 * @Author : 胡敬
 * @Date: 2020-03-26 19:54
 */
@Component
public class BEH0493 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        if (inputInfo.getBeHospitalizedDoc() == null) {
            status.set("0");
            return;
        }
        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
        Map<String, String> structureMap = beHospitalizedDoc.getStructureMap();
        String pacs = structureMap.get("辅助检查结果");
        String laboratory = structureMap.get("实验室检查");
        String image = structureMap.get("影像学检查");
        if (StringUtil.isNotBlank(pacs) || StringUtil.isNotBlank(laboratory) || StringUtil.isNotBlank(image)) {
            status.set("0");
            return;
        }
        PacsLabel pacsLabel = inputInfo.getBeHospitalizedDoc().getPacsLabel();
        if (pacsLabel != null && StringUtil.isNotBlank(pacsLabel.getText())) {
            status.set("0");
        }
    }
}