package thyyxxk.webserver.constants.frntsheet;

import thyyxxk.webserver.utils.StringUtil;

public enum CaseClassification {
    A("1", "A"),

    B("2", "B"),

    C("3", "C"),

    D("4", "D");


    private final String hisCode;
    private final String wjwCode;

    CaseClassification(String hisCode, String wjwCode) {
        this.hisCode = hisCode;
        this.wjwCode = wjwCode;
    }

    public String getHisCode() {
        return hisCode;
    }

    public String getWjwCode() {
        return wjwCode;
    }

    public static String getWjwCodeByHisCode(String hisCode) {
        if (StringUtil.isBlank(hisCode)) {
            return null;
        }
        for (CaseClassification way : CaseClassification.values()) {
            if (way.getHisCode().equals(hisCode)) {
                return way.getWjwCode();
            }
        }
        return null;
    }
}
