package thyyxxk.webserver.entity.outpatient.thmz;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description: 优惠类别
 * @Author:lihong
 * @Date: 2024/1/12
 */
public enum DiscountEnum {
    AUDIT_CODE("audit_code","按大类(如CT,B超)"),
    CHARGE_CODE("charge_code","单项"),
    TC_NO("tc_no","门诊套餐"),
    TEMPLATE_ID("template_id","组合套餐(如检查,检验和诊疗项目自由组合)"),
    JY_JC_CODE("jy_jc_code","检验/检查项目"),
    GH("gh","挂号")
    ;
    private String code;
    private String name;

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

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static List<Map<String,Object>> listDiscount(){
        List<DiscountEnum> discountEnums= Arrays.asList(values());
        List<Map<String, Object>> result = new ArrayList<>();
        for(DiscountEnum discountEnum: discountEnums){
            Map<String, Object> map = new HashMap<>();
            map.put("code", discountEnum.getCode());
            map.put("name", discountEnum.getName());
            result.add(map);
        }
        return result;
    }

}
