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

import com.lantone.qc.kernel.catalogue.QCCatalogue;
import com.lantone.qc.kernel.util.CatalogueUtil;
import com.lantone.qc.pub.Content;
import com.lantone.qc.pub.model.InputInfo;
import com.lantone.qc.pub.model.OutputInfo;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @ClassName : FIRP0246
 * @Description : 伤口愈合等级填写的与出院小结不一致
 * @Author : 楼辉荣
 * @Date: 2020-03-06 17:28ss
 */
@Component
public class FIRP0246 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        if (inputInfo.getFirstPageRecordDoc() != null && inputInfo.getFirstPageRecordDoc().getStructureExtMap() != null) {
            Map<String, Object> firstpageStructureMap = inputInfo.getFirstPageRecordDoc().getStructureExtMap();
            List<Map<String, String>> operative_information = (List<Map<String, String>>) firstpageStructureMap.get(Content.operative_information);
            if (operative_information != null && operative_information.size() > 0) {
                for (Map<String, String> opInfo : operative_information) {
                    if (!CatalogueUtil.isEmpty(opInfo.get(Content.operative_name)) && CatalogueUtil.isEmpty(opInfo.get(Content.healing_level))) {
                        status.set("-1");
                        break;
                    }
                }
            }

        }
    }
}