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

/**
 * @Description: 特殊嗜好未描述
 * @author: rengb
 * @time: 2020/3/10 14:02
 */
@Component
public class BEH0049 extends QCCatalogue {

    @Override
    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
        if(inputInfo.getBeHospitalizedDoc() == null){
            status.set("0");
            return;
        }
        PersonalLabel personalLabel = inputInfo.getBeHospitalizedDoc().getPersonalLabel();
        if (personalLabel == null || StringUtil.isBlank(personalLabel.getText())) {
            status.set("0");
            return;
        }
        String personalText = personalLabel.getText();
        if (personalText.contains("详见原病历") || personalText.contains("特殊嗜好")) {
            status.set("0");
            return;
        }
        SpecialHobby specialHobby = personalLabel.getSpecialHobby();
        if (specialHobby != null && StringUtil.isNotEmpty(specialHobby.getName())) {
            status.set("0");
        }
    }

}