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.Clinical;
import com.lantone.qc.pub.model.label.ChiefLabel;
import com.lantone.qc.pub.util.StringUtil;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * @ClassName : BEH0008
 * @Description :主诉症状超过3个
 * @Author : 楼辉荣
 * @Date: 2020-03-06 17:28
 */
@Component
public class BEH0008 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        if (inputInfo.getBeHospitalizedDoc() == null) {
            status.set("0");
            return;
        }
        ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
        if (chiefLabel == null || StringUtil.isBlank(chiefLabel.getText())) {
            status.set("0");
            return;
        }
        List<Clinical> clinicals = chiefLabel.getClinicals();
        if (clinicals != null && clinicals.size() <= 3) {
            status.set("0");
        }

    }
}