package cn.hnthyy.thmz.enums;

import java.util.Arrays;
import java.util.List;

/**
 * 顾客就诊状态  为了发送mq消息
 */
public enum  OrderStatusEnum {
    REGISTRATION_SUCCESS("0","已挂号"),
    OUTPATIENT("1","已就诊"),
    PRESCRIPTION_TO_BE_PAID("2","处方待缴费"),
    SUCCESSFUL_PRESCRIPTION_PAYMENT("3","缴费成功"),
    MEDICAL_CONFIRMED("4","医技已确认"),
    MEDICAL_REPOR("5","医技报告"),
    DRUG_RECIPIENTS("6","药品领用"),
    REFUND("7","退费");

    public String code;
    public String name;

    OrderStatusEnum(String code, String name){
        this.code=code;
        this.name=name;
    }

    /**
     * 根据编码查询对应的类型
     * @param code
     * @return
     */
    public static OrderStatusEnum getOrderStatusByCode(String code){
        List<OrderStatusEnum> orderStatusEnums= Arrays.asList(values());
        for (OrderStatusEnum orderStatus:orderStatusEnums){
            if(orderStatus.code.equals(code)){
                return orderStatus;
            }
        }
        return null;
    }
}
