package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

/**
 * @description: 医院等级
 * @author: DingJie
 * @create: 2021/8/217:22
 */
public enum HospLv {

    THIRD_SPECIAL("01", "三级特等"),

    THIRD_HIGH("02", "三级甲等"),

    THIRD_MID("03", "三级乙等"),

    THIRD_LOW("04", "三级丙等"),

    SECOND_HIGH("05", "二级甲等"),

    SECOND_MID("06", "二级乙等"),

    SECOND_LOW("07", "二级丙等"),

    FIRST_HIGH("08", "一级甲等"),

    FIRST_MID("09", "一级乙等"),

    FIRST_LOW("10", "一级丙等"),

    NO_GRADE("11", "无等级");

    private final String code;
    private final String name;

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

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

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