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

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.FirstCourseRecordDoc;
import com.lantone.qc.pub.model.entity.Diag;
import com.lantone.qc.pub.model.label.DiagLabel;
import com.lantone.qc.pub.util.StringUtil;
import org.springframework.stereotype.Component;

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

/**
 * @ClassName : FIRC0087
 * @Description : 鉴别诊断不全面
 * @Author : 胡敬
 * @Date: 2020-03-06 17:28
 */
@Component
public class FIRC0088 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
        if (firstCourseRecordDoc == null) {
            return;
        }
        Map<String, String> firstCourseStructureMap = firstCourseRecordDoc.getStructureMap();
        String diffDiag = firstCourseStructureMap.get("鉴别诊断");
        if (StringUtil.isBlank(diffDiag) ||
//                diffDiag.contains("诊断明确") || diffDiag.contains("无需鉴别")
//                || diffDiag.contains("明确诊断") || diffDiag.contains("诊断尚明确")
        diffDiag.contains("明确")) {
            return;
        }
        DiagLabel differentialDiagLabel = firstCourseRecordDoc.getDifferentialDiagLabel();
        if (differentialDiagLabel != null) {
            List<Diag> diags = differentialDiagLabel.getDiags();
            if (diags == null || diags.size() < 1) {
                status.set("-1");
            }
        }
    }
}