package com.lantone.qc.kernel.catalogue.beilun.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.springframework.stereotype.Component;

import java.util.Map;


/**
 * @ClassName : BEH0409
 * @Description : 入院记录病史陈述者未填写
 * @Author : 楼辉荣
 * @Date: 2020-03-06 17:28
 */
@Component
public class BEH0409 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        if (inputInfo.getBeHospitalizedDoc() == null) {
            return;
        }
        Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
        if(structureMap != null){
            String name = structureMap.get("关系");
            String historyPresenter = structureMap.get("病史陈述者");
            String historyreporter = structureMap.get("病史提供人");
            String infoSources = structureMap.get("信息来源");

            if(CatalogueUtil.isEmpty(name)
                    && CatalogueUtil.isEmpty(historyPresenter)
                    && CatalogueUtil.isEmpty(historyreporter)
                    && CatalogueUtil.isEmpty(infoSources)){
                status.set("-1");
            }
        }

    }
}