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 AllergyIntoleranceCriticalityEnum { 009 010 /** 011 * Display: <b>Low Risk</b><br> 012 * Code Value: <b>CRITL</b> 013 * 014 * The potential clinical impact of a future reaction is estimated as low risk: exposure to substance is unlikely to result in a life threatening or organ system threatening outcome. Future exposure to the Substance is considered a relative contra-indication. 015 */ 016 LOW_RISK("CRITL", "http://hl7.org/fhir/allergy-intolerance-criticality"), 017 018 /** 019 * Display: <b>High Risk</b><br> 020 * Code Value: <b>CRITH</b> 021 * 022 * The potential clinical impact of a future reaction is estimated as high risk: exposure to substance may result in a life threatening or organ system threatening outcome. Future exposure to the Substance may be considered an absolute contra-indication. 023 */ 024 HIGH_RISK("CRITH", "http://hl7.org/fhir/allergy-intolerance-criticality"), 025 026 /** 027 * Display: <b>Unable to determine</b><br> 028 * Code Value: <b>CRITU</b> 029 * 030 * Unable to assess the potential clinical impact with the information available. 031 */ 032 UNABLE_TO_DETERMINE("CRITU", "http://hl7.org/fhir/allergy-intolerance-criticality"), 033 034 ; 035 036 /** 037 * Identifier for this Value Set: 038 * 039 */ 040 public static final String VALUESET_IDENTIFIER = ""; 041 042 /** 043 * Name for this Value Set: 044 * AllergyIntoleranceCriticality 045 */ 046 public static final String VALUESET_NAME = "AllergyIntoleranceCriticality"; 047 048 private static Map<String, AllergyIntoleranceCriticalityEnum> CODE_TO_ENUM = new HashMap<String, AllergyIntoleranceCriticalityEnum>(); 049 private static Map<String, Map<String, AllergyIntoleranceCriticalityEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, AllergyIntoleranceCriticalityEnum>>(); 050 051 private final String myCode; 052 private final String mySystem; 053 054 static { 055 for (AllergyIntoleranceCriticalityEnum next : AllergyIntoleranceCriticalityEnum.values()) { 056 CODE_TO_ENUM.put(next.getCode(), next); 057 058 if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) { 059 SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, AllergyIntoleranceCriticalityEnum>()); 060 } 061 SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next); 062 } 063 } 064 065 /** 066 * Returns the code associated with this enumerated value 067 */ 068 public String getCode() { 069 return myCode; 070 } 071 072 /** 073 * Returns the code system associated with this enumerated value 074 */ 075 public String getSystem() { 076 return mySystem; 077 } 078 079 /** 080 * Returns the enumerated value associated with this code 081 */ 082 public static AllergyIntoleranceCriticalityEnum forCode(String theCode) { 083 AllergyIntoleranceCriticalityEnum retVal = CODE_TO_ENUM.get(theCode); 084 return retVal; 085 } 086 087 /** 088 * Converts codes to their respective enumerated values 089 */ 090 public static final IValueSetEnumBinder<AllergyIntoleranceCriticalityEnum> VALUESET_BINDER = new IValueSetEnumBinder<AllergyIntoleranceCriticalityEnum>() { 091 @Override 092 public String toCodeString(AllergyIntoleranceCriticalityEnum theEnum) { 093 return theEnum.getCode(); 094 } 095 096 @Override 097 public String toSystemString(AllergyIntoleranceCriticalityEnum theEnum) { 098 return theEnum.getSystem(); 099 } 100 101 @Override 102 public AllergyIntoleranceCriticalityEnum fromCodeString(String theCodeString) { 103 return CODE_TO_ENUM.get(theCodeString); 104 } 105 106 @Override 107 public AllergyIntoleranceCriticalityEnum fromCodeString(String theCodeString, String theSystemString) { 108 Map<String, AllergyIntoleranceCriticalityEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString); 109 if (map == null) { 110 return null; 111 } 112 return map.get(theCodeString); 113 } 114 115 }; 116 117 /** 118 * Constructor 119 */ 120 AllergyIntoleranceCriticalityEnum(String theCode, String theSystem) { 121 myCode = theCode; 122 mySystem = theSystem; 123 } 124 125 126}