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

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

import java.util.List;

/**
 * @ClassName : CLI0309
 * @Description : 无输血或使用血液制品后效果评价
 * @Author : 楼辉荣
 * @Date: 2020-03-06 17:28
 */
@Component
public class CLI0309 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        List<ClinicalBloodDoc> clinicalBloodDocs = inputInfo.getClinicalBloodDocs();//输血记录
        List<ClinicBloodEffectDoc> clinicBloodEffectDocs = inputInfo.getClinicBloodEffectDocs();//输血效果评价
        if (ListUtil.isEmpty(clinicalBloodDocs)) {
            return;
        }
        if (clinicalBloodDocs.size() < clinicBloodEffectDocs.size()) {
            return;
        }
        if (clinicalBloodDocs.size() != clinicBloodEffectDocs.size()) {
            status.set("-1");
            info.set("部分输血记录未找到对应输血后效果评价");
        }
        /*
        if (clinicalBloodDocs != null && clinicalBloodDocs.size() > 0) {
            for (ClinicBloodEffectDoc cliB : clinicBloodEffectDocs) {
                Map<String, String> cliBStructureMap = cliB.getStructureMap();
                if (StringUtils.isEmpty(cliBStructureMap.get("输注后效果评价"))) {
                    status.set("-1");
                    break;
                }
            }
        }

         */
    }
}