package cn.hnthyy.thmz.enums;

import java.util.Arrays;
import java.util.List;

/**
 * 病人身份类型
 */
public enum ResponceTypeEnum {
    SELF_PAYING("01","self_paying","自费"),
    SHENG_YI_BAO("02","sheng_yi_bao","省医保"),
    SHI_CHENG_JU("03","shi_cheng_ju","市城居医保"),
    XIN_NONG_HE("04","xin_nong_he","新农合"),
    NONG_HE_HUI_BEN_DI("05","nong_he_hui_ben_di","农合回本地结算"),
    XIAN_XIN_BING_QUAN_MIAN("06","xian_xin_bing_quan_mian","先心病全免"),
    CHANG_SHA_XIAN("07","chang_sha_xian","省医保-长沙县"),
    YI_BAO_YI_DI("08","yi_bao_yi_di","医保异地"),
    SHI_CHENG_ZHI("09","shi_cheng_zhi","市城职医保"),
    SHENG_YI_DI("10","sheng_yi_di","省医保-异地");

    public String code;
    public String value;
    public String name;

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

    /**
     * 根据编码查询对应的类型
     * @param code
     * @return
     */
    public static ResponceTypeEnum getReportTypeByCode(String code){
      List<ResponceTypeEnum> reportTypeList= Arrays.asList(values());
      for (ResponceTypeEnum reportType:reportTypeList){
          if(reportType.code.equals(code)){
              return reportType;
          }
      }
      return null;
    }
}
