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

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

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

/**
 * @ClassName : DIF0116
 * @Description : 	疑难病例讨论记录结论未填写
 * @Author : 楼辉荣
 * @Date: 2020-03-06 17:28
 * 什么样的病历是疑难病例
 */
@Component
public class DIF02899 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        List<DifficultCaseDiscussDoc> difficultCaseDiscussDocs = inputInfo.getDifficultCaseDiscussDocs();
        if(ListUtil.isEmpty(difficultCaseDiscussDocs)){
            return;
        }
        if(difficultCaseDiscussDocs != null && difficultCaseDiscussDocs.size()>0){
            for (DifficultCaseDiscussDoc dcdd:difficultCaseDiscussDocs) {
                Map<String, String> dcddStructureMap = dcdd.getStructureMap();
                String diisDate = dcddStructureMap.get("结论");
                if(CatalogueUtil.isEmpty(diisDate)){
                    status.set("-1");
                    break;
                }
            }
        }
    }
}