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

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

/**
 * @ClassName : CLI0001
 * @Description : 无输血/血制品病程记录     和医嘱比较
 * @Author : 楼辉荣
 * @Date: 2020-03-06 17:28
 */
@Component
public class CLI0299 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        List<DoctorAdviceDoc> doctorAdviceDocs = inputInfo.getDoctorAdviceDocs();
        List<ClinicalBloodDoc> clinicalBloodDocs = inputInfo.getClinicalBloodDocs();
        if(ListUtil.isNotEmpty(doctorAdviceDocs)){
            st:
            for (DoctorAdviceDoc doc:doctorAdviceDocs) {
                Map<String, String> structureMap = doc.getStructureMap();
                if(structureMap.get("医嘱项目名称").contains("输血")){
                    if(ListUtil.isEmpty(clinicalBloodDocs)){
                        status.set("-1");
                        break st;
                    }
                }
            }
        }
    }
}