package com.lantone.enums.med;

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

/**
 * @author wangfeng
 * @Description:
 * @date 2021-06-11 9:28
 */
public enum StandConvertCrfEnum implements KeyedNamed {
    // 类型，疾病: disease，症状: symptom，手术和操作:operation，药品: drug，实验室检查：lis，辅助检查：pacs， 查体：vital
    disease(1, "disease"),
    symptom(2, "symptom"),
    operation(3, "operation"),
    drug(4, "drug"),
    lis(5, "lis"),
    pacs(6, "pacs"),
    vital(7, "vital");
    @Setter
    private int key;

    @Setter
    private String name;

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

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

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

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

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


}
