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

import com.lantone.qc.kernel.catalogue.QCCatalogue;
import com.lantone.qc.pub.model.InputInfo;
import com.lantone.qc.pub.model.OutputInfo;
import com.lantone.qc.pub.model.doc.operation.OperationDoc;
import com.lantone.qc.pub.util.StringUtil;
import org.springframework.stereotype.Component;

import java.text.ParseException;
import java.util.List;

/**
 * @Description: 术前讨论记录未记录可能意外和防范措施
 * @author: rengb
 * @time: 2020/3/23 15:09
 */
@Component
public class PRE0333 extends QCCatalogue {

    @Override
    protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
        status.set("0");
        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
        if(operationDocs == null || operationDocs.size()== 0){
            return;
        }
        for (OperationDoc operationDoc : operationDocs) {
            if (operationDoc.getPreoperativeDiscussionDoc() != null
                    && StringUtil.isEmpty(operationDoc.getPreoperativeDiscussionDoc().getStructureMap().get("可能意外和防范措施"))) {
                status.set("-1");
            }
        }
    }

}