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.entity.Modification;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;


/**
 * @ClassName : BEH0020
 * @Description :  现病史症状缺少缓解情况
 * crf模型中只标注趋势，需要用词库去配出哪些是缓解情况。
 * @Author : 楼辉荣
 * @Date: 2020-03-06 17:28
 */
@Component
public class BEH0020 extends QCCatalogue {
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        if(inputInfo.getBeHospitalizedDoc() == null){
            status.set("0");
            return;
        }
        List<Clinical> clinicals = inputInfo.getBeHospitalizedDoc().getPresentLabel().getClinicals();
        if(clinicals.size()>0){
            Clinical clinical = clinicals.get(0);
            Modification modification = clinical.getModification();
            if(modification == null || !modification.getName().contains("缓")){
                info.set(clinical.getName());
            }else {
                status.set("0");
            }
        }
    }
}