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.General;
import com.lantone.qc.pub.model.entity.GeneralDesc;
import com.lantone.qc.pub.util.ListUtil;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * @ClassName : BEH0441
 * @Description :  现病史缺少发病以来食欲描述
 * @Author : 楼辉荣
 * @Date: 2020-03-06 17:28
 */
@Component
public class BEH0441 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        if (inputInfo.getBeHospitalizedDoc() == null) {
            status.set("0");
            return;
        }
        List<GeneralDesc> generals = inputInfo.getBeHospitalizedDoc().getPresentLabel().getGenerals();
        if(ListUtil.isNotEmpty(generals)){
            for (GeneralDesc general:generals) {
                if(general.getName().contains("纳")|| general.getName().contains("饮食")
                        || general.getName().contains("进食")|| general.getName().contains("食欲")){
                    status.set("0");
                    break;
                }
            }
        }
        List<General> gens = inputInfo.getBeHospitalizedDoc().getPresentLabel().getGens();
        if(ListUtil.isNotEmpty(gens)){
            for (General general:gens) {
                if(general.getName().contains("纳") || general.getName().contains("饮食") || general.getName().contains("进食")){
                    status.set("0");
                    break;
                }
            }
        }

    }
}