package cn.hnthyy.thmz.enums;

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

/**
 * 分诊状态
 */
public enum MzfzStatusEnum {
    //未分诊
    UN_TRIAGE(0,"未分诊"),
    //已分诊
    TRIAGE(1,"已分诊"),
    //新系统不使用
    NOTIFICATION(2,"可通知"),
    //已通知
    HAD_NOTIFICATION(3,"已通知"),
    //就诊中
    IN_CLINIC(8,"就诊中"),
    //已就诊
    CLINIC(9,"已就诊");

    public Integer code;
    public String name;

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

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