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.model.doc.DeathRecordDoc;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @ClassName : FIRP0186
 * @Description :患者尸检未填写
 * @Author : 胡敬
 * @Date: 2020-03-17 16:50
 */
@Component
public class FIRP0186 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        DeathRecordDoc deathRecordDoc = inputInfo.getDeathRecordDoc();
        if (inputInfo.getFirstPageRecordDoc() == null || deathRecordDoc == null) {
            status.set("0");
            return;
        }
        if (inputInfo.getFirstPageRecordDoc().getStructureMap() != null) {
            Map<String, String> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureMap();
            //String outWay = firstpageStructureMap.get(Content.outWay).toString();
            String deadAutopsy = firstpageStructureMap.get(Content.deadAutopsy);
            if (StringUtils.isBlank(deadAutopsy)) {
                status.set("-1");
            }
        }
    }
}