package cn.hnthyy.thmz.enums;

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

/**
 * 参数类型  0-常用症状  1-常用时间  2-常用标点 3-常用词 4- 诊断 5-现病史 6-既往史 7-体重 8-体温 9-脉搏 10-呼吸 11-血压  12-主诉 13-诊断组
 */
public enum ParamsTypeEnum {
    FEATURE(0,"常用症状"),
    COMMONLY_TIME(1,"常用时间"),
    COMMONLY_PUNCTUATION(2,"常用标点"),
    GENERAL_SERVICE_WORD(3,"常用词"),
    DIAGNOSE(4,"诊断"),
    HISTORY_OF_PRESENT_ILLNESS(5,"现病史"),
    FAMILY_HISTORY(6,"既往史"),
    WEIGHT(7,"体重"),
    ANIMAL_HEAT(8,"体温"),
    PULSE(9,"脉搏"),
    BREATHE(10,"呼吸"),
    BLOOD_PRESSURE(11,"血压"),
    SYMPTOM(12,"主诉"),
    DIAGNOSE_LIST(13,"诊断组");

    public Integer code;
    public String name;

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

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