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 AssertionOperatorTypeEnum { 009 010 /** 011 * Display: <b>equals</b><br> 012 * Code Value: <b>equals</b> 013 * 014 * Default value. Equals comparison. 015 */ 016 EQUALS("equals", "http://hl7.org/fhir/assert-operator-codes"), 017 018 /** 019 * Display: <b>notEquals</b><br> 020 * Code Value: <b>notEquals</b> 021 * 022 * Not equals comparison. 023 */ 024 NOTEQUALS("notEquals", "http://hl7.org/fhir/assert-operator-codes"), 025 026 /** 027 * Display: <b>in</b><br> 028 * Code Value: <b>in</b> 029 * 030 * Compare value within a known set of values. 031 */ 032 IN("in", "http://hl7.org/fhir/assert-operator-codes"), 033 034 /** 035 * Display: <b>notIn</b><br> 036 * Code Value: <b>notIn</b> 037 * 038 * Compare value not within a known set of values. 039 */ 040 NOTIN("notIn", "http://hl7.org/fhir/assert-operator-codes"), 041 042 /** 043 * Display: <b>greaterThan</b><br> 044 * Code Value: <b>greaterThan</b> 045 * 046 * Compare value to be greater than a known value. 047 */ 048 GREATERTHAN("greaterThan", "http://hl7.org/fhir/assert-operator-codes"), 049 050 /** 051 * Display: <b>lessThan</b><br> 052 * Code Value: <b>lessThan</b> 053 * 054 * Compare value to be less than a known value. 055 */ 056 LESSTHAN("lessThan", "http://hl7.org/fhir/assert-operator-codes"), 057 058 /** 059 * Display: <b>empty</b><br> 060 * Code Value: <b>empty</b> 061 * 062 * Compare value is empty. 063 */ 064 EMPTY("empty", "http://hl7.org/fhir/assert-operator-codes"), 065 066 /** 067 * Display: <b>notEmpty</b><br> 068 * Code Value: <b>notEmpty</b> 069 * 070 * Compare value is not empty. 071 */ 072 NOTEMPTY("notEmpty", "http://hl7.org/fhir/assert-operator-codes"), 073 074 /** 075 * Display: <b>contains</b><br> 076 * Code Value: <b>contains</b> 077 * 078 * Compare value string contains a known value. 079 */ 080 CONTAINS("contains", "http://hl7.org/fhir/assert-operator-codes"), 081 082 /** 083 * Display: <b>notContains</b><br> 084 * Code Value: <b>notContains</b> 085 * 086 * Compare value string does not contain a known value. 087 */ 088 NOTCONTAINS("notContains", "http://hl7.org/fhir/assert-operator-codes"), 089 090 ; 091 092 /** 093 * Identifier for this Value Set: 094 * 095 */ 096 public static final String VALUESET_IDENTIFIER = ""; 097 098 /** 099 * Name for this Value Set: 100 * AssertionOperatorType 101 */ 102 public static final String VALUESET_NAME = "AssertionOperatorType"; 103 104 private static Map<String, AssertionOperatorTypeEnum> CODE_TO_ENUM = new HashMap<String, AssertionOperatorTypeEnum>(); 105 private static Map<String, Map<String, AssertionOperatorTypeEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, AssertionOperatorTypeEnum>>(); 106 107 private final String myCode; 108 private final String mySystem; 109 110 static { 111 for (AssertionOperatorTypeEnum next : AssertionOperatorTypeEnum.values()) { 112 CODE_TO_ENUM.put(next.getCode(), next); 113 114 if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) { 115 SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, AssertionOperatorTypeEnum>()); 116 } 117 SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next); 118 } 119 } 120 121 /** 122 * Returns the code associated with this enumerated value 123 */ 124 public String getCode() { 125 return myCode; 126 } 127 128 /** 129 * Returns the code system associated with this enumerated value 130 */ 131 public String getSystem() { 132 return mySystem; 133 } 134 135 /** 136 * Returns the enumerated value associated with this code 137 */ 138 public static AssertionOperatorTypeEnum forCode(String theCode) { 139 AssertionOperatorTypeEnum retVal = CODE_TO_ENUM.get(theCode); 140 return retVal; 141 } 142 143 /** 144 * Converts codes to their respective enumerated values 145 */ 146 public static final IValueSetEnumBinder<AssertionOperatorTypeEnum> VALUESET_BINDER = new IValueSetEnumBinder<AssertionOperatorTypeEnum>() { 147 @Override 148 public String toCodeString(AssertionOperatorTypeEnum theEnum) { 149 return theEnum.getCode(); 150 } 151 152 @Override 153 public String toSystemString(AssertionOperatorTypeEnum theEnum) { 154 return theEnum.getSystem(); 155 } 156 157 @Override 158 public AssertionOperatorTypeEnum fromCodeString(String theCodeString) { 159 return CODE_TO_ENUM.get(theCodeString); 160 } 161 162 @Override 163 public AssertionOperatorTypeEnum fromCodeString(String theCodeString, String theSystemString) { 164 Map<String, AssertionOperatorTypeEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString); 165 if (map == null) { 166 return null; 167 } 168 return map.get(theCodeString); 169 } 170 171 }; 172 173 /** 174 * Constructor 175 */ 176 AssertionOperatorTypeEnum(String theCode, String theSystem) { 177 myCode = theCode; 178 mySystem = theSystem; 179 } 180 181 182}