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

import com.lantone.qc.kernel.catalogue.QCCatalogue;
import com.lantone.qc.kernel.util.CatalogueUtil;
import com.lantone.qc.pub.model.InputInfo;
import com.lantone.qc.pub.model.OutputInfo;
import com.lantone.qc.pub.model.entity.Clinical;
import com.lantone.qc.pub.model.entity.PD;
import com.lantone.qc.pub.util.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * @ClassName : BEH0003
 * @Description : 主诉字数超过20个字
 * @Author : 楼辉荣
 * @Date: 2020-03-06 17:28
 */
@Component
public class BEH0003 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getBeHospitalizedDoc().getChiefLabel() == null) {
            status.set("0");
            return;
        }
        String chiefText = inputInfo.getBeHospitalizedDoc().getChiefLabel().getText();
        if (StringUtil.isNotBlank(chiefText)) {
            String s = chiefText.trim();
            int chiefTextLength = s.length();
            if (chiefTextLength <= 20) {
                status.set("0");
            }
        } else {
            status.set("0");
        }
    }
}