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.model.label.PresentLabel;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * @ClassName : BEH0022
 * @Description :  现病史缺少发病以来一般情况描述
 * @Author : 楼辉荣
 * @Date: 2020-03-06 17:28
 */
@Component
public class BEH0022 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        if (inputInfo.getBeHospitalizedDoc() == null) {
            status.set("0");
            return;
        }
        PresentLabel presentLabel = inputInfo.getBeHospitalizedDoc().getPresentLabel();
        if (presentLabel == null) {
            status.set("0");
            return;
        }
        List<GeneralDesc> generals = presentLabel.getGenerals();
        if (generals != null && generals.size() > 0) {
            status.set("0");
            return;
        }
        List<General> gens = inputInfo.getBeHospitalizedDoc().getPresentLabel().getGens();
        if (gens != null && gens.size() > 0) {
            status.set("0");
            return;
        }

    }
}