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