package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

/**
 * @description: 转院类型
 * @author: DingJie
 * @create: 2021/8/39:45
 */
public enum ReflType {

    IN_SAME_CITY("1", "市内转院"),

    TO_OTHER_CITY("2", "转往省内异地"),

    TO_OTHER_PROVINCE("3", "转往省外异地");

    private final String code;
    private final String name;

    ReflType(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static ReflType get(String code) {
        if (StringUtil.isBlank(code)) {
            return null;
        }
        for (ReflType reflType : ReflType.values()) {
            if (code.trim().equals(reflType.getCode())) {
                return reflType;
            }
        }
        return null;
    }
}
