001 002package ca.uhn.fhir.model.dstu2.valueset; 003 004import ca.uhn.fhir.model.api.*; 005import java.util.HashMap; 006import java.util.Map; 007 008public enum SubscriptionChannelTypeEnum { 009 010 /** 011 * Display: <b>Rest Hook</b><br> 012 * Code Value: <b>rest-hook</b> 013 * 014 * The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made. 015 */ 016 REST_HOOK("rest-hook", "http://hl7.org/fhir/subscription-channel-type"), 017 018 /** 019 * Display: <b>Websocket</b><br> 020 * Code Value: <b>websocket</b> 021 * 022 * The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL. 023 */ 024 WEBSOCKET("websocket", "http://hl7.org/fhir/subscription-channel-type"), 025 026 /** 027 * Display: <b>Email</b><br> 028 * Code Value: <b>email</b> 029 * 030 * The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:). 031 */ 032 EMAIL("email", "http://hl7.org/fhir/subscription-channel-type"), 033 034 /** 035 * Display: <b>SMS</b><br> 036 * Code Value: <b>sms</b> 037 * 038 * The channel is executed by sending an SMS message to the phone number identified in the URL (tel:). 039 */ 040 SMS("sms", "http://hl7.org/fhir/subscription-channel-type"), 041 042 /** 043 * Display: <b>Message</b><br> 044 * Code Value: <b>message</b> 045 * 046 * The channel is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc.) to the application identified in the URI. 047 */ 048 MESSAGE("message", "http://hl7.org/fhir/subscription-channel-type"), 049 050 ; 051 052 /** 053 * Identifier for this Value Set: 054 * 055 */ 056 public static final String VALUESET_IDENTIFIER = ""; 057 058 /** 059 * Name for this Value Set: 060 * SubscriptionChannelType 061 */ 062 public static final String VALUESET_NAME = "SubscriptionChannelType"; 063 064 private static Map<String, SubscriptionChannelTypeEnum> CODE_TO_ENUM = new HashMap<String, SubscriptionChannelTypeEnum>(); 065 private static Map<String, Map<String, SubscriptionChannelTypeEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, SubscriptionChannelTypeEnum>>(); 066 067 private final String myCode; 068 private final String mySystem; 069 070 static { 071 for (SubscriptionChannelTypeEnum next : SubscriptionChannelTypeEnum.values()) { 072 CODE_TO_ENUM.put(next.getCode(), next); 073 074 if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) { 075 SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, SubscriptionChannelTypeEnum>()); 076 } 077 SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next); 078 } 079 } 080 081 /** 082 * Returns the code associated with this enumerated value 083 */ 084 public String getCode() { 085 return myCode; 086 } 087 088 /** 089 * Returns the code system associated with this enumerated value 090 */ 091 public String getSystem() { 092 return mySystem; 093 } 094 095 /** 096 * Returns the enumerated value associated with this code 097 */ 098 public static SubscriptionChannelTypeEnum forCode(String theCode) { 099 SubscriptionChannelTypeEnum retVal = CODE_TO_ENUM.get(theCode); 100 return retVal; 101 } 102 103 /** 104 * Converts codes to their respective enumerated values 105 */ 106 public static final IValueSetEnumBinder<SubscriptionChannelTypeEnum> VALUESET_BINDER = new IValueSetEnumBinder<SubscriptionChannelTypeEnum>() { 107 @Override 108 public String toCodeString(SubscriptionChannelTypeEnum theEnum) { 109 return theEnum.getCode(); 110 } 111 112 @Override 113 public String toSystemString(SubscriptionChannelTypeEnum theEnum) { 114 return theEnum.getSystem(); 115 } 116 117 @Override 118 public SubscriptionChannelTypeEnum fromCodeString(String theCodeString) { 119 return CODE_TO_ENUM.get(theCodeString); 120 } 121 122 @Override 123 public SubscriptionChannelTypeEnum fromCodeString(String theCodeString, String theSystemString) { 124 Map<String, SubscriptionChannelTypeEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString); 125 if (map == null) { 126 return null; 127 } 128 return map.get(theCodeString); 129 } 130 131 }; 132 133 /** 134 * Constructor 135 */ 136 SubscriptionChannelTypeEnum(String theCode, String theSystem) { 137 myCode = theCode; 138 mySystem = theSystem; 139 } 140 141 142}