package com.lantone.qc.kernel.catalogue.beilun.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.label.TreatPlanLabel;
import com.lantone.qc.pub.util.ListUtil;
import com.lantone.qc.pub.util.StringUtil;
import org.springframework.stereotype.Component;

/**
 * @ClassName : FIRC03087
 * @Description : 治疗措施不具体（缺实验室检查）
 * @Author : wsy
 * @Date: 2021-01-07 13:39
 */
@Component
public class FIRC03087 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
        if (firstCourseRecordDoc == null) {
            status.set("0");
            return;
        }
        TreatPlanLabel treatPlanLabel = firstCourseRecordDoc.getTreatPlanLabel();
        if (treatPlanLabel == null) {
            status.set("0");
            return;
        }
        String text = treatPlanLabel.getText();
        if (StringUtil.isBlank(text)) {
            status.set("0");
            return;
        }
        if (treatPlanLabel.getMedicine() != null || treatPlanLabel.getTreat().size() > 0
                || treatPlanLabel.getPacs().size() > 0) {
            status.set("0");
            return;
        }
        if (ListUtil.isEmpty(treatPlanLabel.getPacs())) {
            status.set("-1");
            return;
        }
    }
}