package com.lantone.qc.dbanaly.facade.yiwu.enums;

import lombok.Setter;

public enum BehospitalWayEnum implements AKeyedNamed{
    COMMON("1", "普通"),
    TRANSFER_HOSPITAL("2", "转院"),
    EMERGENCY_TREATMENT("3", "急诊"),
    OBSERVATION("4", "留观"),
    OUTPATIENT("5", "门诊"),
    DAY_SURGERY("18", "日间手术"),
    STIPULATE_ENTITY("12", "规定病种");

    @Setter
    private String key;

    @Setter
    private String name;

    BehospitalWayEnum(String key, String name) {
        this.key = key;
        this.name = name;
    }

    public static BehospitalWayEnum getEnum(String key) {
        for (BehospitalWayEnum item : BehospitalWayEnum.values()) {
            if (key.equals(item.getKey())) {
                return item;
            }
        }
        return null;
    }

    public static String getName(String key) {
        BehospitalWayEnum item = getEnum(key);
        return item != null ? item.name : null;
    }

    @Override
    public String getKey() {
        return key;
    }

    @Override
    public String getName() {
        return name;
    }
}
