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

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.entity.Diag;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassName : BEH0496
 * @Description :  待查诊断未列出可能性较大诊断
 * @Author : Mark
 * @Date: 2020-04-05 13:33
 */
@Component
public class BEH0496 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        if (inputInfo.getBeHospitalizedDoc() == null) {
            return;
        }
        List<Diag> diags = inputInfo.getBeHospitalizedDoc().getInitialDiagLabel().getDiags();
        if (diags != null && diags.size() > 0) {
            String todo = "待查";
            int idx = 0;
            for (Diag diag : diags) {
                if (diag.getHospitalDiagName().contains(todo)) {
                    idx = diags.indexOf(diag);
                    break;
                }
            }

            if (idx == diags.size() - 1) {
                status.set("-1");
            }
        }
    }
}