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

/**
 * @ClassName : FIRC0705
 * @Description : 诊疗计划中监测生命体征不具体
 * 诊疗计划里如果写了监测生命体征，那里必须写“测血压，心率”
 * @Author : kwz
 * @Date: 2020-04-20 17:28
 */
@Component
public class FIRC0705 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        status.set("0");
        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
        if (firstCourseRecordDoc == null || firstCourseRecordDoc.getTreatPlanLabel() == null) {
            return;
        }
        String text_treatPlan = firstCourseRecordDoc.getTreatPlanLabel().getText();
        if(StringUtils.isNotEmpty(text_treatPlan) && text_treatPlan.contains("监测生命体征")){
            if(!text_treatPlan.contains("测血压")&& !text_treatPlan.contains("心率")){
                status.set("-1");
            }
        }
    }
}