package com.ywt.models.enums;

/**
 * 订单状态枚举
 */
public enum OrderTypeEnum {
    /**
     *
     */
    Treatment("远程会诊", 1),
    Transfer("双向转诊", 2),
    Attending("外请会诊", 3),
    Registered("预约挂号", 4),
    Consult("线上咨询", 5),
    FollowUp("随访", 6),
    ADDITIONAL_REGISTRATION("加诊预约", 7),
    OUTPATIENT("门诊缴费订单", 8),
    MARKETING("健康教育", 9),           //医生推广费
    TREATMENT_REPORT("远程会诊报告", 10),
    PRESCRIPTION("处方单", 11),
    MED_FIELD_ARTICLE("医学界文章", 12),
    OFFLINE_CONSULT("线下就诊", 13),
    Deposit("住院押金充值", 14),
    CheckUp("体检缴费", 15),
    NAT("核酸检测", 16),
    MED_EQUIP("医疗设备检查订单", 17),
    GLASSES("眼镜店", 18),
    ;

    private final String displayName;

    private final int value;

    OrderTypeEnum(String displayName, int value) {
        this.displayName = displayName;
        this.value = value;
    }

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }

    public static OrderTypeEnum valueOf(int value) {
        for (OrderTypeEnum orderTypeEnum : OrderTypeEnum.values()) {
            if (orderTypeEnum.getValue() == value) {
                return orderTypeEnum;
            }
        }

        return null;
    }

    /**
     * 获取订单显示名称
     *
     * @param value
     * @return
     */
    public static String getOrderDisplayName(int value) {
        OrderTypeEnum orderTypeEnum = valueOf(value);

        if (orderTypeEnum != null) {
            return orderTypeEnum.getDisplayName();
        }

        return "";
    }
}