001package org.hl7.fhir.r4.model.codesystems; 002 003/* 004 Copyright (c) 2011+, HL7, Inc. 005 All rights reserved. 006 007 Redistribution and use in source and binary forms, with or without modification, 008 are permitted provided that the following conditions are met: 009 010 * Redistributions of source code must retain the above copyright notice, this 011 list of conditions and the following disclaimer. 012 * Redistributions in binary form must reproduce the above copyright notice, 013 this list of conditions and the following disclaimer in the documentation 014 and/or other materials provided with the distribution. 015 * Neither the name of HL7 nor the names of its contributors may be used to 016 endorse or promote products derived from this software without specific 017 prior written permission. 018 019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 022 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 023 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 024 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 025 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 026 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 027 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 028 POSSIBILITY OF SUCH DAMAGE. 029 030*/ 031 032// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 033 034import org.hl7.fhir.exceptions.FHIRException; 035 036public enum AssertOperatorCodes { 037 038 /** 039 * Default value. Equals comparison. 040 */ 041 EQUALS, 042 /** 043 * Not equals comparison. 044 */ 045 NOTEQUALS, 046 /** 047 * Compare value within a known set of values. 048 */ 049 IN, 050 /** 051 * Compare value not within a known set of values. 052 */ 053 NOTIN, 054 /** 055 * Compare value to be greater than a known value. 056 */ 057 GREATERTHAN, 058 /** 059 * Compare value to be less than a known value. 060 */ 061 LESSTHAN, 062 /** 063 * Compare value is empty. 064 */ 065 EMPTY, 066 /** 067 * Compare value is not empty. 068 */ 069 NOTEMPTY, 070 /** 071 * Compare value string contains a known value. 072 */ 073 CONTAINS, 074 /** 075 * Compare value string does not contain a known value. 076 */ 077 NOTCONTAINS, 078 /** 079 * Evaluate the FHIRPath expression as a boolean condition. 080 */ 081 EVAL, 082 /** 083 * added to help the parsers 084 */ 085 NULL; 086 087 public static AssertOperatorCodes fromCode(String codeString) throws FHIRException { 088 if (codeString == null || "".equals(codeString)) 089 return null; 090 if ("equals".equals(codeString)) 091 return EQUALS; 092 if ("notEquals".equals(codeString)) 093 return NOTEQUALS; 094 if ("in".equals(codeString)) 095 return IN; 096 if ("notIn".equals(codeString)) 097 return NOTIN; 098 if ("greaterThan".equals(codeString)) 099 return GREATERTHAN; 100 if ("lessThan".equals(codeString)) 101 return LESSTHAN; 102 if ("empty".equals(codeString)) 103 return EMPTY; 104 if ("notEmpty".equals(codeString)) 105 return NOTEMPTY; 106 if ("contains".equals(codeString)) 107 return CONTAINS; 108 if ("notContains".equals(codeString)) 109 return NOTCONTAINS; 110 if ("eval".equals(codeString)) 111 return EVAL; 112 throw new FHIRException("Unknown AssertOperatorCodes code '" + codeString + "'"); 113 } 114 115 public String toCode() { 116 switch (this) { 117 case EQUALS: 118 return "equals"; 119 case NOTEQUALS: 120 return "notEquals"; 121 case IN: 122 return "in"; 123 case NOTIN: 124 return "notIn"; 125 case GREATERTHAN: 126 return "greaterThan"; 127 case LESSTHAN: 128 return "lessThan"; 129 case EMPTY: 130 return "empty"; 131 case NOTEMPTY: 132 return "notEmpty"; 133 case CONTAINS: 134 return "contains"; 135 case NOTCONTAINS: 136 return "notContains"; 137 case EVAL: 138 return "eval"; 139 case NULL: 140 return null; 141 default: 142 return "?"; 143 } 144 } 145 146 public String getSystem() { 147 return "http://hl7.org/fhir/assert-operator-codes"; 148 } 149 150 public String getDefinition() { 151 switch (this) { 152 case EQUALS: 153 return "Default value. Equals comparison."; 154 case NOTEQUALS: 155 return "Not equals comparison."; 156 case IN: 157 return "Compare value within a known set of values."; 158 case NOTIN: 159 return "Compare value not within a known set of values."; 160 case GREATERTHAN: 161 return "Compare value to be greater than a known value."; 162 case LESSTHAN: 163 return "Compare value to be less than a known value."; 164 case EMPTY: 165 return "Compare value is empty."; 166 case NOTEMPTY: 167 return "Compare value is not empty."; 168 case CONTAINS: 169 return "Compare value string contains a known value."; 170 case NOTCONTAINS: 171 return "Compare value string does not contain a known value."; 172 case EVAL: 173 return "Evaluate the FHIRPath expression as a boolean condition."; 174 case NULL: 175 return null; 176 default: 177 return "?"; 178 } 179 } 180 181 public String getDisplay() { 182 switch (this) { 183 case EQUALS: 184 return "equals"; 185 case NOTEQUALS: 186 return "notEquals"; 187 case IN: 188 return "in"; 189 case NOTIN: 190 return "notIn"; 191 case GREATERTHAN: 192 return "greaterThan"; 193 case LESSTHAN: 194 return "lessThan"; 195 case EMPTY: 196 return "empty"; 197 case NOTEMPTY: 198 return "notEmpty"; 199 case CONTAINS: 200 return "contains"; 201 case NOTCONTAINS: 202 return "notContains"; 203 case EVAL: 204 return "evaluate"; 205 case NULL: 206 return null; 207 default: 208 return "?"; 209 } 210 } 211 212}