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.util.StringUtil;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @ClassName : BEH02978
 * @Description : 药物过敏史描述与病案首页不一致（结构化数据）
 * @Author : 楼辉荣
 * @Date: 2020-06-20 15:00
 */
@Component
public class BEH02978 extends QCCatalogue {
    @Override
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getFirstPageRecordDoc() == null) {
            return;
        }
        String bhAllergy = inputInfo.getBeHospitalizedDoc().getStructureMap().get("过敏史");
        String fipAllergy = inputInfo.getFirstPageRecordDoc().getStructureMap().get("过敏药物");
        if (StringUtil.isBlank(bhAllergy) || StringUtil.isBlank(fipAllergy)){
            return;
        }

        if (!bhAllergy.equals(fipAllergy)){
            status.set("-1");
        }
    }
}