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

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 com.lantone.qc.pub.model.doc.AnesthesiaRelatedDoc;
import com.lantone.qc.pub.util.ListUtil;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @ClassName : ANES0674
 * @Description : 麻醉记录无手术后诊断
 * @Author : 胡敬
 * @Date: 2020-03-30 11:05
 */
@Component
public class ANES0674 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        List<AnesthesiaRelatedDoc> anesthesiaRelatedDocs = inputInfo.getAnesthesiaRelatedDocs();
        if (ListUtil.isEmpty(anesthesiaRelatedDocs)) {
            return;
        }
        for (AnesthesiaRelatedDoc anesthesiaRelatedDoc : anesthesiaRelatedDocs) {
            Map<String, String> anesthesiaRelatedStructureMap = anesthesiaRelatedDoc.getStructureMap();
            if (CatalogueUtil.isEmpty(anesthesiaRelatedStructureMap.get("手术后诊断"))) {
                status.set("-1");
                return;
            }
        }
    }
}