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

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 : DEAC0102
 * @Description : 死亡病例讨论记录中无诊疗经过
 * @Author : 胡敬
 * @Date: 2020-03-19 09:44
 */
@Component
public class DEAC0102 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        if (inputInfo.getDeathCaseDiscussDoc() != null && inputInfo.getDeathCaseDiscussDoc().getStructureMap() != null) {
            Map<String, String> deathCaseDiscussStructureMap = inputInfo.getDeathCaseDiscussDoc().getStructureMap();
            if (CatalogueUtil.isEmpty(deathCaseDiscussStructureMap.get("讨论内容"))) {
                status.set("-1");
            }
            else {
                String discussionContent = deathCaseDiscussStructureMap.get("讨论内容");
                if (!discussionContent.contains("诊断") || !discussionContent.contains("治疗")) {
                    status.set("-1");
                }
            }
        }
    }
}