package thyyxxk.webserver.entity.zhuyuanyisheng.emr;

import com.alibaba.fastjson.JSON;
import lombok.Data;
import thyyxxk.webserver.entity.zhuyuanyisheng.emrcontrolrule.EmrRuleV2;
import thyyxxk.webserver.utils.StringUtil;

@Data
public class EmrRuleData {
    private Integer id;
    private String ruleData;
    private Integer type;

    public EmrRuleV2 getRule() {
        if (type == 4) return null;
        if (StringUtil.notBlank(ruleData)) {
            return JSON.parseObject(ruleData, EmrRuleV2.class);
        }
        return null;
    }

}
