001package org.hl7.fhir.instance.model.valuesets; 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 Thu, Jul 23, 2015 16:50-0400 for FHIR v0.5.0 033 034 035public enum IssueType { 036 037 /** 038 * Content invalid against the Specification or a Profile 039 */ 040 INVALID, 041 /** 042 * A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax 043 */ 044 STRUCTURE, 045 /** 046 * A required element is missing 047 */ 048 REQUIRED, 049 /** 050 * element value invalid 051 */ 052 VALUE, 053 /** 054 * A content validation rule failed - e.g. a schematron rule 055 */ 056 INVARIANT, 057 /** 058 * An authentication/authorization/permissions issueof some kind 059 */ 060 SECURITY, 061 /** 062 * the client needs to initiate an authentication process 063 */ 064 LOGIN, 065 /** 066 * The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable) 067 */ 068 UNKNOWN, 069 /** 070 * User session expired; a login may be required 071 */ 072 EXPIRED, 073 /** 074 * The user does not have the rights to perform this action 075 */ 076 FORBIDDEN, 077 /** 078 * Some information was not or may not have been returned due to business rules, consent or privacy rules, or access permission constraints. This information may be accessible through alternate processes 079 */ 080 SUPPRESSED, 081 /** 082 * Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged 083 */ 084 PROCESSING, 085 /** 086 * The resource or profile is not supported 087 */ 088 NOTSUPPORTED, 089 /** 090 * An attempt was made to create a duplicate record 091 */ 092 DUPLICATE, 093 /** 094 * The reference provided was not found. In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the content is not found further into the application architecture 095 */ 096 NOTFOUND, 097 /** 098 * Provided content is too long (typically, this is a denial of service protection type of error) 099 */ 100 TOOLONG, 101 /** 102 * The code or system could not be understood, or it was not valid in the context of a particular ValueSet 103 */ 104 CODEINVALID, 105 /** 106 * An extension was found that was not acceptable, or that could not be resolved, or a modifierExtension that was not recognised 107 */ 108 EXTENSION, 109 /** 110 * The operation was stopped to protect server resources. E.g. a request for a value set expansion on all of SNOMED CT 111 */ 112 TOOCOSTLY, 113 /** 114 * The content/operation failed to pass some business rule, and so could not proceed 115 */ 116 BUSINESSRULE, 117 /** 118 * content could not be accepted because of an edit conflict (i.e. version aware updates) (In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the conflict is discovered further into the application architecture) 119 */ 120 CONFLICT, 121 /** 122 * Not all data sources typically accessed could be reached, or responded in time, so the returned information may not be complete 123 */ 124 INCOMPLETE, 125 /** 126 * Transient processing issues. The system receiving the error may be able to resubmit the same content once an underlying issue is resolved 127 */ 128 TRANSIENT, 129 /** 130 * A resource/record locking failure (usually in an underlying database) 131 */ 132 LOCKERROR, 133 /** 134 * The persistent store unavailable. E.g. the database is down for maintenance or similar 135 */ 136 NOSTORE, 137 /** 138 * An unexpected internal error 139 */ 140 EXCEPTION, 141 /** 142 * An internal timeout occurred 143 */ 144 TIMEOUT, 145 /** 146 * The system is not prepared to handle this request due to load management 147 */ 148 THROTTLED, 149 /** 150 * A message unrelated to the processing success of the completed operation (Examples of the latter include things like reminders of password expiry, system maintenance times, etc.) 151 */ 152 INFORMATIONAL, 153 /** 154 * added to help the parsers 155 */ 156 NULL; 157 public static IssueType fromCode(String codeString) throws Exception { 158 if (codeString == null || "".equals(codeString)) 159 return null; 160 if ("invalid".equals(codeString)) 161 return INVALID; 162 if ("structure".equals(codeString)) 163 return STRUCTURE; 164 if ("required".equals(codeString)) 165 return REQUIRED; 166 if ("value".equals(codeString)) 167 return VALUE; 168 if ("invariant".equals(codeString)) 169 return INVARIANT; 170 if ("security".equals(codeString)) 171 return SECURITY; 172 if ("login".equals(codeString)) 173 return LOGIN; 174 if ("unknown".equals(codeString)) 175 return UNKNOWN; 176 if ("expired".equals(codeString)) 177 return EXPIRED; 178 if ("forbidden".equals(codeString)) 179 return FORBIDDEN; 180 if ("suppressed".equals(codeString)) 181 return SUPPRESSED; 182 if ("processing".equals(codeString)) 183 return PROCESSING; 184 if ("not-supported".equals(codeString)) 185 return NOTSUPPORTED; 186 if ("duplicate".equals(codeString)) 187 return DUPLICATE; 188 if ("not-found".equals(codeString)) 189 return NOTFOUND; 190 if ("too-long".equals(codeString)) 191 return TOOLONG; 192 if ("code-invalid".equals(codeString)) 193 return CODEINVALID; 194 if ("extension".equals(codeString)) 195 return EXTENSION; 196 if ("too-costly".equals(codeString)) 197 return TOOCOSTLY; 198 if ("business-rule".equals(codeString)) 199 return BUSINESSRULE; 200 if ("conflict".equals(codeString)) 201 return CONFLICT; 202 if ("incomplete".equals(codeString)) 203 return INCOMPLETE; 204 if ("transient".equals(codeString)) 205 return TRANSIENT; 206 if ("lock-error".equals(codeString)) 207 return LOCKERROR; 208 if ("no-store".equals(codeString)) 209 return NOSTORE; 210 if ("exception".equals(codeString)) 211 return EXCEPTION; 212 if ("timeout".equals(codeString)) 213 return TIMEOUT; 214 if ("throttled".equals(codeString)) 215 return THROTTLED; 216 if ("informational".equals(codeString)) 217 return INFORMATIONAL; 218 throw new Exception("Unknown IssueType code '"+codeString+"'"); 219 } 220 public String toCode() { 221 switch (this) { 222 case INVALID: return "invalid"; 223 case STRUCTURE: return "structure"; 224 case REQUIRED: return "required"; 225 case VALUE: return "value"; 226 case INVARIANT: return "invariant"; 227 case SECURITY: return "security"; 228 case LOGIN: return "login"; 229 case UNKNOWN: return "unknown"; 230 case EXPIRED: return "expired"; 231 case FORBIDDEN: return "forbidden"; 232 case SUPPRESSED: return "suppressed"; 233 case PROCESSING: return "processing"; 234 case NOTSUPPORTED: return "not-supported"; 235 case DUPLICATE: return "duplicate"; 236 case NOTFOUND: return "not-found"; 237 case TOOLONG: return "too-long"; 238 case CODEINVALID: return "code-invalid"; 239 case EXTENSION: return "extension"; 240 case TOOCOSTLY: return "too-costly"; 241 case BUSINESSRULE: return "business-rule"; 242 case CONFLICT: return "conflict"; 243 case INCOMPLETE: return "incomplete"; 244 case TRANSIENT: return "transient"; 245 case LOCKERROR: return "lock-error"; 246 case NOSTORE: return "no-store"; 247 case EXCEPTION: return "exception"; 248 case TIMEOUT: return "timeout"; 249 case THROTTLED: return "throttled"; 250 case INFORMATIONAL: return "informational"; 251 default: return "?"; 252 } 253 } 254 public String getSystem() { 255 return "http://hl7.org/fhir/issue-type"; 256 } 257 public String getDefinition() { 258 switch (this) { 259 case INVALID: return "Content invalid against the Specification or a Profile"; 260 case STRUCTURE: return "A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax"; 261 case REQUIRED: return "A required element is missing"; 262 case VALUE: return "element value invalid"; 263 case INVARIANT: return "A content validation rule failed - e.g. a schematron rule"; 264 case SECURITY: return "An authentication/authorization/permissions issueof some kind"; 265 case LOGIN: return "the client needs to initiate an authentication process"; 266 case UNKNOWN: return "The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable)"; 267 case EXPIRED: return "User session expired; a login may be required"; 268 case FORBIDDEN: return "The user does not have the rights to perform this action"; 269 case SUPPRESSED: return "Some information was not or may not have been returned due to business rules, consent or privacy rules, or access permission constraints. This information may be accessible through alternate processes"; 270 case PROCESSING: return "Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged"; 271 case NOTSUPPORTED: return "The resource or profile is not supported"; 272 case DUPLICATE: return "An attempt was made to create a duplicate record"; 273 case NOTFOUND: return "The reference provided was not found. In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the content is not found further into the application architecture"; 274 case TOOLONG: return "Provided content is too long (typically, this is a denial of service protection type of error)"; 275 case CODEINVALID: return "The code or system could not be understood, or it was not valid in the context of a particular ValueSet"; 276 case EXTENSION: return "An extension was found that was not acceptable, or that could not be resolved, or a modifierExtension that was not recognised"; 277 case TOOCOSTLY: return "The operation was stopped to protect server resources. E.g. a request for a value set expansion on all of SNOMED CT"; 278 case BUSINESSRULE: return "The content/operation failed to pass some business rule, and so could not proceed"; 279 case CONFLICT: return "content could not be accepted because of an edit conflict (i.e. version aware updates) (In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the conflict is discovered further into the application architecture)"; 280 case INCOMPLETE: return "Not all data sources typically accessed could be reached, or responded in time, so the returned information may not be complete"; 281 case TRANSIENT: return "Transient processing issues. The system receiving the error may be able to resubmit the same content once an underlying issue is resolved"; 282 case LOCKERROR: return "A resource/record locking failure (usually in an underlying database)"; 283 case NOSTORE: return "The persistent store unavailable. E.g. the database is down for maintenance or similar"; 284 case EXCEPTION: return "An unexpected internal error"; 285 case TIMEOUT: return "An internal timeout occurred"; 286 case THROTTLED: return "The system is not prepared to handle this request due to load management"; 287 case INFORMATIONAL: return "A message unrelated to the processing success of the completed operation (Examples of the latter include things like reminders of password expiry, system maintenance times, etc.)"; 288 default: return "?"; 289 } 290 } 291 public String getDisplay() { 292 switch (this) { 293 case INVALID: return "Invalid Content"; 294 case STRUCTURE: return "Structural Issue"; 295 case REQUIRED: return "Required element missing"; 296 case VALUE: return "Element value invalid"; 297 case INVARIANT: return "Validation rule failed"; 298 case SECURITY: return "Security Problem"; 299 case LOGIN: return "Login Required"; 300 case UNKNOWN: return "Unknown User"; 301 case EXPIRED: return "Session Expired"; 302 case FORBIDDEN: return "Forbidden"; 303 case SUPPRESSED: return "Information Suppressed"; 304 case PROCESSING: return "Processing Failure"; 305 case NOTSUPPORTED: return "Content not supported"; 306 case DUPLICATE: return "Duplicate"; 307 case NOTFOUND: return "Not Found"; 308 case TOOLONG: return "Content Too Long"; 309 case CODEINVALID: return "Invalid Code"; 310 case EXTENSION: return "Unacceptable Extension"; 311 case TOOCOSTLY: return "Operation Too Costly"; 312 case BUSINESSRULE: return "Business Rule Violation"; 313 case CONFLICT: return "Edit Version Conflict"; 314 case INCOMPLETE: return "Incomplete Results"; 315 case TRANSIENT: return "Transient Issue"; 316 case LOCKERROR: return "Lock Error"; 317 case NOSTORE: return "No Store Available"; 318 case EXCEPTION: return "Exception"; 319 case TIMEOUT: return "Timeout"; 320 case THROTTLED: return "Throttled"; 321 case INFORMATIONAL: return "Informational Note"; 322 default: return "?"; 323 } 324 } 325 326 327} 328