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

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

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

/**
 * @ClassName : INVA0621
 * @Description : 操作医师未签名
 * @Author : 胡敬
 * @Date: 2020-03-30 13:29
 */
@Component
public class INVA0621 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        List<InvasiveOperationDoc> invasiveOperationDocs = inputInfo.getInvasiveOperationDocs();
        if (ListUtil.isEmpty(invasiveOperationDocs)) {
            return;
        }
        for (InvasiveOperationDoc invasiveOperationDoc : invasiveOperationDocs) {
            Map<String, String> invasiveOperationStructureMap = invasiveOperationDoc.getStructureMap();
            if (CatalogueUtil.isEmpty(invasiveOperationStructureMap.get("操作医师签名"))) {
                status.set("-1");
                return;
            }
        }
    }
}