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 : ANES0672
 * @Description : 麻醉记录无术前诊断
 * @Author : 胡敬
 * @Date: 2020-03-30 10:01
 */
@Component
public class ANES0672 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;
            }
        }
    }
}