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

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.operation.OperationDiscussionDoc;
import com.lantone.qc.pub.model.doc.operation.OperationDoc;
import org.springframework.stereotype.Component;

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

/**
 * @ClassName : OPE0652
 * @Description : 术后首程无患方签名
 * @Author : 胡敬
 * @Date: 2020-03-30 17:07
 */
@Component
public class OPE0652 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        boolean isOperativePatient = true;//是手术患者(暂时默认是)
//        if (isOperativePatient) {
            List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
            if (operationDocs.size() == 0 || operationDocs == null) {
                return;
            }
            for (OperationDoc operationDoc : operationDocs) {
                OperationDiscussionDoc operationDiscussionDoc = operationDoc.getOperationDiscussionDoc();
                if (operationDiscussionDoc == null) {
                    continue;
                }
                Map<String, String> operationDiscussionStructureMap = operationDiscussionDoc.getStructureMap();
                if (CatalogueUtil.isEmpty(operationDiscussionStructureMap.get("患方签名"))) {
                    status.set("-1");
                    return;
                }
            }
//        }
    }
}