package com.lantone.qc.kernel.catalogue.deathrecord;

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 : DEAR0340
 * @Description : 死亡记录无入院情况
 * @Author : 胡敬
 * @Date: 2020-03-18 17:14
 */
@Component
public class DEAR0340 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        if (inputInfo.getDeathRecordDoc() != null && inputInfo.getDeathRecordDoc().getStructureMap() != null) {
            Map<String, String> deathRecordStructureMap = inputInfo.getDeathRecordDoc().getStructureMap();
            // 与任燕青确认，统一只需要判断入院情况，
            // if(StringUtils.isBlank(deathRecordStructureMap.get("主诉"))){
            //     status.set("-1");
            //     return;
            // }
            if (CatalogueUtil.isEmpty(deathRecordStructureMap.get("入院情况"))) {
                status.set("-1");
            }
        }
    }
}