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

import java.util.Map;


/**
 * @ClassName : BEH0458
 * @Description :  既往史缺成瘾药物用药情况
 * @Author : 楼辉荣
 * @Date: 2020-03-06 17:28
 */
@Component
public class BEH0458 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        if (inputInfo.getBeHospitalizedDoc() == null) {
            return;
        }
        Map<String, String> bhMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
        if (bhMap != null) {
            String birthDate = bhMap.get("长期用药情况\\(包括可能成瘾的药物\\)");
            String addictiveDrugs = bhMap.get("成瘾药物");
            if (StringUtil.isBlank(birthDate) && StringUtil.isBlank(addictiveDrugs)) {
                status.set("-1");
            }
        }

    }
}