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

import com.lantone.qc.kernel.catalogue.QCCatalogue;
import com.lantone.qc.pub.Content;
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 : FIRP0196
 * @Description :颅脑损伤患者昏迷时间未填写
 * @Author : 胡敬
 * @Date: 2020-03-17 16:28
 */
@Component
public class FIRP0196 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
            String brainInjuryComaBeforeDays = firstpageStructureMap.get(Content.brainInjuryComaBeforeDays);
            String brainInjuryComaBeforeHours = firstpageStructureMap.get(Content.brainInjuryComaBeforeHours);
            String brainInjuryComaBeforeMins = firstpageStructureMap.get(Content.brainInjuryComaBeforeMins);
            String brainInjuryComaAfterDays = firstpageStructureMap.get(Content.brainInjuryComaAfterDays);
            String brainInjuryComaAfterHours = firstpageStructureMap.get(Content.brainInjuryComaAfterHours);
            String brainInjuryComaAfterMins = firstpageStructureMap.get(Content.brainInjuryComaAfterMins);
            if (StringUtil.isBlank(brainInjuryComaBeforeDays)
                    || StringUtil.isBlank(brainInjuryComaBeforeHours)
                    || StringUtil.isBlank(brainInjuryComaBeforeMins)
                    || StringUtil.isBlank(brainInjuryComaAfterDays)
                    || StringUtil.isBlank(brainInjuryComaAfterHours)
                    || StringUtil.isBlank(brainInjuryComaAfterMins)
            ) {
                status.set("-1");
            }
        }
    }
}