package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

/**
 * @description: 申报来源
 * @author: DingJie
 * @create: 2021/8/415:34
 */
public enum DclaSouc {

    LOC_INSTITUTION("01", "定点医药机构"),

    CENTRAL("02", "中心经办系统"),

    ONLINE("03", "网上经办系统"),

    APP("04", "APP"),

    INTEGRATED_MACHINE("05", "一体机"),

    OTHERS("99", "其他");

    private final String code;
    private final String name;

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

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static DclaSouc get(String code) {
        if (StringUtil.isBlank(code)) {
            return null;
        }
        for (DclaSouc dclaSouc : DclaSouc.values()) {
            if (code.trim().equals(dclaSouc.getCode())) {
                return dclaSouc;
            }
        }
        return null;
    }
}
