package thyyxxk.webserver.entity.orderZdMaintain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum SupplyClass {

    口服(1, "口服"),
    输液(2, "输液"),
    出院带药(3, "出院带药"),
    领药临时(4, "领药（临时）"),
    退药(5, "退药"),
    外用(6, "外用"),
    注射(7, "注射"),
    药物治疗(8, "药物治疗"),
    其他(9, "其他");

    private Integer code;
    private String name;

    public static String getNameByCode(Integer code) {
        for (SupplyClass supplyClass : SupplyClass.values()) {
            if (supplyClass.getCode().equals(code)) {
                return supplyClass.getName();
            }
        }
        return "";
    }

}
