package cn.hnthyy.thmz.enums;

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

/**
 * 就诊状态
 */
public enum ClinicStatusEnum {
    //挂号未被医生接诊
    REGISTRATION(0,"已挂号"),
    //挂号且已经被医生接诊，此数据为挂号表数据
    REGISTRATION_TO_CLINIC(1,"挂号已接诊"),
    //退号 挂号表数据
    BACK_REGISTRATION(2,"已退号"),
    //暂无  可能无用
    UN_CLINIC(3,"候诊"),
    //新增状态，医生接诊中状态  可能无用
    IN_CLINIC(4,"接诊中"),
    HAD_CLINIC(5,"已接诊未缴费"),
    CHARGED(6,"已缴费"),
    REFUND(7,"已退费");

    public Integer code;
    public String name;

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

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