package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

/**
 * @description: 出入院诊断类别
 * @author: DingJie
 * @create: 2021/7/2917:35
 */
public enum InoutDiagType {
    ADM_DIAGNOSE("1", "入院诊断"),

    DSC_DIAGNOSE("2", "出院诊断");

    private final String code;
    private final String name;

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

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

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