package com.diagbot.enums;

import com.diagbot.core.KeyedNamed;
import lombok.Setter;

/**
 * @author wangfeng
 * @Description: TODO
 * @date 2018年11月21日 下午2:31:42
 */
public enum CheckerRoleEnum implements KeyedNamed {
    DEPT_SUPERVISOR(4, "临床科室监管人员"),
    DEPT_GENERAL(7, "临床科室质控人员"),
    QUAT_SUPERVISOR(5, "质控科监管人员"),
    QUAT_GENERAL(8, "质控科质控人员"),
    HOSP_SUPERVISOR(6, "院级监管人员"),
    HOSP_GENERAL(9, "院级质控人员");

    @Setter
    private int key;

    @Setter
    private String name;

    CheckerRoleEnum(int key, String name) {
        this.key = key;
        this.name = name;
    }

    public static CheckerRoleEnum getEnum(int key) {
        for (CheckerRoleEnum item : CheckerRoleEnum.values()) {
            if (item.key == key) {
                return item;
            }
        }
        return null;
    }

    public static String getName(int key) {
        CheckerRoleEnum item = getEnum(key);
        return item != null ? item.name : null;
    }

    @Override
    public int getKey() {
        return key;
    }

    @Override
    public String getName() {
        return name;
    }
}

