package org.diagbot.nlp.feature;

import org.diagbot.nlp.util.Constants;

/**
 * Created by fyeman on 2018/1/31.
 */
public enum FeatureType {
    SYMPTOM(Constants.feature_type_symptom),
    DIAG(Constants.feature_type_diag),
    VITAL(Constants.feature_type_vital),
    LIS(Constants.feature_type_lis),
    PACS(Constants.feature_type_pacs),
    FEATURE(Constants.feature_type_feature),
    TREAT(Constants.feature_type_treat),
    HISTORY(Constants.feature_type_history),
    VITAL_INDEX(Constants.feature_type_vital_index),
    TIME(Constants.feature_type_time),
    NONE(Constants.feature_type_default);

    FeatureType(String value) {
        this.value = value;
    }

    private String value;

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static FeatureType parse(String value) {
        switch (value) {
            case Constants.feature_type_symptom:
                return FeatureType.SYMPTOM;
            case Constants.feature_type_diag:
                return FeatureType.DIAG;
            case Constants.feature_type_vital:
                return FeatureType.VITAL;
            case Constants.feature_type_lis:
                return FeatureType.LIS;
            case Constants.feature_type_pacs:
                return FeatureType.PACS;
            case Constants.feature_type_treat:
                return FeatureType.TREAT;
            case Constants.feature_type_history:
                return FeatureType.HISTORY;
            case Constants.feature_type_feature:
                return FeatureType.FEATURE;
            case Constants.feature_type_vital_index:
                return FeatureType.VITAL;
            case Constants.feature_type_time:
                return FeatureType.TIME;
        }
        return FeatureType.NONE;
    }
}
