package com.hs.api.common.enums;

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

public enum ProjectType {
    HOSPITALIZED(2,"住院"),
    OUTPATIENT(1,"门诊"),
    SUMMARY(3,"汇总");

    private int value;
    private String desc;

    ProjectType(int value,String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static List<Map<String,Object>> all() {
        List<Map<String,Object>> list = new ArrayList<>();
        for(ProjectType projectType : values()){
            Map<String,Object> map = new HashMap<String,Object>() {
                {
                    put("value",projectType.getValue());
                    put("description",projectType.getDesc());
                }
            };
            list.add(map);
        }
        return list;
    }
}
