package thyyxxk.webserver.constants.sidicts;

import thyyxxk.webserver.utils.StringUtil;

/**
 * @description: 医疗收费项目类别
 * @author: DingJie
 * @create: 2021/8/1711:46
 */
public enum MedChrgitmType {

    BED("01", "床位费"),

    CLINIC("02", "诊察费"),

    INSPECTION("03", "检查费"),

    EXAM("04", "化验费"),

    TREAT("05", "治疗费"),

    SURGERY("06", "手术费"),

    NURSING("07", "护理费"),

    MATERIAL("08", "卫生材料费"),

    WEST_MED("09", "西药费"),

    HERBAL("10", "中药饮片费"),

    CHN_PTNT("11", "中成药费"),

    HEAL("12", "一般诊疗费"),

    REG("13", "挂号费"),

    OTH("14", "其他费");

    private final String code;
    private final String name;

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

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

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

    public static String getMedName(String code) {
        MedChrgitmType medChrgitmType = get(code);
        if (medChrgitmType != null) {
            return medChrgitmType.getName();
        }
        return "";
    }


}
