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.model.label.TreatPlanLabel;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

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

/**
 * @ClassName : FIRC0089
 * @Description : 无诊疗计划
 * @Author : 楼辉荣
 * @Date: 2020-03-06 17:28
 */
@Component
public class FIRC0089 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
        if(firstCourseRecordDoc != null){
            TreatPlanLabel treatPlanLabel = firstCourseRecordDoc.getTreatPlanLabel();
            if(treatPlanLabel != null){
                String text = treatPlanLabel.getText();
                if(StringUtils.isBlank(text)){
                    status.set("-1");
                }
            }
            //硬规则匹配
            if (StringUtils.isNotEmpty(firstCourseRecordDoc.getText()) && firstCourseRecordDoc.getText().contains("诊疗计划")) {
                status.set("0");
            }
        }
    }
}