package cn.hnthyy.thmz.enums;

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

/**
 * 皮试结果:1.阳性2.阴性3.脱敏
 */
public enum GongnksEnum {
    POSITIVE(1,"阳性"),
    FEMININE(2,"阴性"),
    DESENSITIZATION(3,"脱敏");
    public Integer code;
    public String name;

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

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