package com.diagbot.enums.data;

import lombok.Setter;

public enum DaPrescriptionEnum implements AKeyedNamed {
    PHR_PRESCRIPTION("PHR", "处方医嘱"),
    LAB_PRESCRIPTION("LAB", "化验医嘱"),
    RAD_PRESCRIPTION("RAD", "放射医嘱"),
    M_PRESCRIPTION("M", "卫生材料"),
    Y_PRESCRIPTION("Y", "处方医嘱(中成药)"),
    O_PRESCRIPTION("O", "医嘱"),
    F_PRESCRIPTION("F", "收费项目"),
    Z_PRESCRIPTION("Z", "处方医嘱(中)"),
    D_PRESCRIPTION("D", "处方医嘱(西)"),
    DIS_PRESCRIPTION("DIS", "出院"),
    ADM_PRESCRIPTION("ADM", "入院"),
    FOD_PRESCRIPTION("FOD", "饮食"),
    EXA_PRESCRIPTION("EXA", "检查"),
    ANE_PRESCRIPTION("ANE", "麻醉"),
    OP_PRESCRIPTION("OP", "手术"),
    NSC_PRESCRIPTION("NSC", "治疗处治");

    @Setter
    private String key;

    @Setter
    private String name;

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

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

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

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

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