package thyyxxk.webserver.constants;


import thyyxxk.webserver.utils.StringUtil;

public enum Ysjb {

    RESIDENT_PHYSICIAN("1", "住院医师"),
    ATTENDING_PHYSICIAN("2", "主治医师"),
    DEPUTY_CHIEF_PHYSICIAN("3", "副主任医师"),
    CHIEF_PHYSICIAN("4", "主任医师"),
    TRAINING_PHYSICIAN("5", "进修医师"),
    CHIEF_RESIDENT("6", "总住院医师"),
    INTERN("9", "实习医师");

    private final String code;
    private final String name;

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

    public static String getName(String code) {
        if (StringUtil.isBlank(code)) {
            return "";
        }
        for (Ysjb ysjb : Ysjb.values()) {
            if (code.trim().equals(ysjb.getCode())) {
                return ysjb.getName();
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
