package com.lantone.daqe.enums;

import lombok.Getter;
import lombok.Setter;

/**
 * @Description: 表对应的mode信息
 * @author: zhanghang
 * @time: 2022/3/11 16:03
 */
public enum ModeEnum {
    med_home_page("6", "病案首页"),
    med_behospital_info("0", "住院病历信息"),
    str_admission_note("1", "入院记录"),
    str_leave_hospital("5", "出院小结");


    @Getter
    @Setter
    private String key;

    @Getter
    @Setter
    private String name;

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

    public static ModeEnum getEnum(String key) {
        for (ModeEnum item : ModeEnum.values()) {
            if (item.key.equals(key)) {
                return item;
            }
        }
        return null;
    }

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