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

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 org.springframework.stereotype.Component;

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

/**
 * @Description: 手术患者缺术前讨论或术前小结
 * @author: 胡敬
 * @time: 2020/3/26 10:23
 */
@Component
public class OPE0370 extends QCCatalogue {
    @Override
    protected void start(InputInfo inputInfo, OutputInfo outputInfo) throws ParseException {
        status.set("0");
        //医嘱
        //        List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
        //        if (ListUtil.isEmpty(doctorAdviceDocs)) {
        //            return;
        //        }
        //        boolean isOperativePatient = CatalogueUtil.isOperativePatients(doctorAdviceDocs);
        boolean isOperativePatient = true;//是手术患者(暂时默认是)
        List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
        if (operationDocs == null || operationDocs.size() < 1) {
            return;
        }
        for (OperationDoc operationDoc : operationDocs) {
            if (operationDoc.getPreoperativeDiscussionDoc() == null) {
                status.set("-1");
                return;
            }
        }
        //            OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
        //            if (operationRecordDoc == null) {
        //                continue;
        //            }
        //            Map<String, String> operationRecordStructureMap = operationRecordDoc.getStructureMap();
        //            String preoperativeDiscussion = operationRecordStructureMap.get("术前讨论");
        //            if (CatalogueUtil.isEmpty(preoperativeDiscussion)) {
        //                status.set("-1");
        //                return;
        //            }
    }
}