001package org.hl7.fhir.r4.model.codesystems; 002 003/*- 004 * #%L 005 * org.hl7.fhir.r4 006 * %% 007 * Copyright (C) 2014 - 2019 Health Level 7 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023 024/* 025 Copyright (c) 2011+, HL7, Inc. 026 All rights reserved. 027 028 Redistribution and use in source and binary forms, with or without modification, 029 are permitted provided that the following conditions are met: 030 031 * Redistributions of source code must retain the above copyright notice, this 032 list of conditions and the following disclaimer. 033 * Redistributions in binary form must reproduce the above copyright notice, 034 this list of conditions and the following disclaimer in the documentation 035 and/or other materials provided with the distribution. 036 * Neither the name of HL7 nor the names of its contributors may be used to 037 endorse or promote products derived from this software without specific 038 prior written permission. 039 040 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 041 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 042 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 043 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 044 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 045 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 046 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 047 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 048 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 049 POSSIBILITY OF SUCH DAMAGE. 050 051*/ 052 053// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 054 055 056import org.hl7.fhir.exceptions.FHIRException; 057 058public enum IssueType { 059 060 /** 061 * Content invalid against the specification or a profile. 062 */ 063 INVALID, 064 /** 065 * A structural issue in the content such as wrong namespace, unable to parse the content completely, invalid syntax, etc. 066 */ 067 STRUCTURE, 068 /** 069 * A required element is missing. 070 */ 071 REQUIRED, 072 /** 073 * An element or header value is invalid. 074 */ 075 VALUE, 076 /** 077 * A content validation rule failed - e.g. a schematron rule. 078 */ 079 INVARIANT, 080 /** 081 * An authentication/authorization/permissions issue of some kind. 082 */ 083 SECURITY, 084 /** 085 * The client needs to initiate an authentication process. 086 */ 087 LOGIN, 088 /** 089 * The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable). 090 */ 091 UNKNOWN, 092 /** 093 * User session expired; a login may be required. 094 */ 095 EXPIRED, 096 /** 097 * The user does not have the rights to perform this action. 098 */ 099 FORBIDDEN, 100 /** 101 * 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. 102 */ 103 SUPPRESSED, 104 /** 105 * Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged. 106 */ 107 PROCESSING, 108 /** 109 * The interaction, operation, resource or profile is not supported. 110 */ 111 NOTSUPPORTED, 112 /** 113 * An attempt was made to create a duplicate record. 114 */ 115 DUPLICATE, 116 /** 117 * Multiple matching records were found when the operation required only one match. 118 */ 119 MULTIPLEMATCHES, 120 /** 121 * 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. 122 */ 123 NOTFOUND, 124 /** 125 * The reference pointed to content (usually a resource) that has been deleted. 126 */ 127 DELETED, 128 /** 129 * Provided content is too long (typically, this is a denial of service protection type of error). 130 */ 131 TOOLONG, 132 /** 133 * The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code. 134 */ 135 CODEINVALID, 136 /** 137 * An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not recognized. 138 */ 139 EXTENSION, 140 /** 141 * The operation was stopped to protect server resources; e.g. a request for a value set expansion on all of SNOMED CT. 142 */ 143 TOOCOSTLY, 144 /** 145 * The content/operation failed to pass some business rule and so could not proceed. 146 */ 147 BUSINESSRULE, 148 /** 149 * 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 409 error, but this code may be used where the conflict is discovered further into the application architecture.). 150 */ 151 CONFLICT, 152 /** 153 * Transient processing issues. The system receiving the message may be able to resubmit the same content once an underlying issue is resolved. 154 */ 155 TRANSIENT, 156 /** 157 * A resource/record locking failure (usually in an underlying database). 158 */ 159 LOCKERROR, 160 /** 161 * The persistent store is unavailable; e.g. the database is down for maintenance or similar action, and the interaction or operation cannot be processed. 162 */ 163 NOSTORE, 164 /** 165 * y. 166 */ 167 EXCEPTION, 168 /** 169 * An internal timeout has occurred. 170 */ 171 TIMEOUT, 172 /** 173 * Not all data sources typically accessed could be reached or responded in time, so the returned information might not be complete (applies to search interactions and some operations). 174 */ 175 INCOMPLETE, 176 /** 177 * The system is not prepared to handle this request due to load management. 178 */ 179 THROTTLED, 180 /** 181 * 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.). 182 */ 183 INFORMATIONAL, 184 /** 185 * added to help the parsers 186 */ 187 NULL; 188 public static IssueType fromCode(String codeString) throws FHIRException { 189 if (codeString == null || "".equals(codeString)) 190 return null; 191 if ("invalid".equals(codeString)) 192 return INVALID; 193 if ("structure".equals(codeString)) 194 return STRUCTURE; 195 if ("required".equals(codeString)) 196 return REQUIRED; 197 if ("value".equals(codeString)) 198 return VALUE; 199 if ("invariant".equals(codeString)) 200 return INVARIANT; 201 if ("security".equals(codeString)) 202 return SECURITY; 203 if ("login".equals(codeString)) 204 return LOGIN; 205 if ("unknown".equals(codeString)) 206 return UNKNOWN; 207 if ("expired".equals(codeString)) 208 return EXPIRED; 209 if ("forbidden".equals(codeString)) 210 return FORBIDDEN; 211 if ("suppressed".equals(codeString)) 212 return SUPPRESSED; 213 if ("processing".equals(codeString)) 214 return PROCESSING; 215 if ("not-supported".equals(codeString)) 216 return NOTSUPPORTED; 217 if ("duplicate".equals(codeString)) 218 return DUPLICATE; 219 if ("multiple-matches".equals(codeString)) 220 return MULTIPLEMATCHES; 221 if ("not-found".equals(codeString)) 222 return NOTFOUND; 223 if ("deleted".equals(codeString)) 224 return DELETED; 225 if ("too-long".equals(codeString)) 226 return TOOLONG; 227 if ("code-invalid".equals(codeString)) 228 return CODEINVALID; 229 if ("extension".equals(codeString)) 230 return EXTENSION; 231 if ("too-costly".equals(codeString)) 232 return TOOCOSTLY; 233 if ("business-rule".equals(codeString)) 234 return BUSINESSRULE; 235 if ("conflict".equals(codeString)) 236 return CONFLICT; 237 if ("transient".equals(codeString)) 238 return TRANSIENT; 239 if ("lock-error".equals(codeString)) 240 return LOCKERROR; 241 if ("no-store".equals(codeString)) 242 return NOSTORE; 243 if ("exception".equals(codeString)) 244 return EXCEPTION; 245 if ("timeout".equals(codeString)) 246 return TIMEOUT; 247 if ("incomplete".equals(codeString)) 248 return INCOMPLETE; 249 if ("throttled".equals(codeString)) 250 return THROTTLED; 251 if ("informational".equals(codeString)) 252 return INFORMATIONAL; 253 throw new FHIRException("Unknown IssueType code '"+codeString+"'"); 254 } 255 public String toCode() { 256 switch (this) { 257 case INVALID: return "invalid"; 258 case STRUCTURE: return "structure"; 259 case REQUIRED: return "required"; 260 case VALUE: return "value"; 261 case INVARIANT: return "invariant"; 262 case SECURITY: return "security"; 263 case LOGIN: return "login"; 264 case UNKNOWN: return "unknown"; 265 case EXPIRED: return "expired"; 266 case FORBIDDEN: return "forbidden"; 267 case SUPPRESSED: return "suppressed"; 268 case PROCESSING: return "processing"; 269 case NOTSUPPORTED: return "not-supported"; 270 case DUPLICATE: return "duplicate"; 271 case MULTIPLEMATCHES: return "multiple-matches"; 272 case NOTFOUND: return "not-found"; 273 case DELETED: return "deleted"; 274 case TOOLONG: return "too-long"; 275 case CODEINVALID: return "code-invalid"; 276 case EXTENSION: return "extension"; 277 case TOOCOSTLY: return "too-costly"; 278 case BUSINESSRULE: return "business-rule"; 279 case CONFLICT: return "conflict"; 280 case TRANSIENT: return "transient"; 281 case LOCKERROR: return "lock-error"; 282 case NOSTORE: return "no-store"; 283 case EXCEPTION: return "exception"; 284 case TIMEOUT: return "timeout"; 285 case INCOMPLETE: return "incomplete"; 286 case THROTTLED: return "throttled"; 287 case INFORMATIONAL: return "informational"; 288 default: return "?"; 289 } 290 } 291 public String getSystem() { 292 return "http://hl7.org/fhir/issue-type"; 293 } 294 public String getDefinition() { 295 switch (this) { 296 case INVALID: return "Content invalid against the specification or a profile."; 297 case STRUCTURE: return "A structural issue in the content such as wrong namespace, unable to parse the content completely, invalid syntax, etc."; 298 case REQUIRED: return "A required element is missing."; 299 case VALUE: return "An element or header value is invalid."; 300 case INVARIANT: return "A content validation rule failed - e.g. a schematron rule."; 301 case SECURITY: return "An authentication/authorization/permissions issue of some kind."; 302 case LOGIN: return "The client needs to initiate an authentication process."; 303 case UNKNOWN: return "The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable)."; 304 case EXPIRED: return "User session expired; a login may be required."; 305 case FORBIDDEN: return "The user does not have the rights to perform this action."; 306 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."; 307 case PROCESSING: return "Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged."; 308 case NOTSUPPORTED: return "The interaction, operation, resource or profile is not supported."; 309 case DUPLICATE: return "An attempt was made to create a duplicate record."; 310 case MULTIPLEMATCHES: return "Multiple matching records were found when the operation required only one match."; 311 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."; 312 case DELETED: return "The reference pointed to content (usually a resource) that has been deleted."; 313 case TOOLONG: return "Provided content is too long (typically, this is a denial of service protection type of error)."; 314 case CODEINVALID: return "The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code."; 315 case EXTENSION: return "An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not recognized."; 316 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."; 317 case BUSINESSRULE: return "The content/operation failed to pass some business rule and so could not proceed."; 318 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 409 error, but this code may be used where the conflict is discovered further into the application architecture.)."; 319 case TRANSIENT: return "Transient processing issues. The system receiving the message may be able to resubmit the same content once an underlying issue is resolved."; 320 case LOCKERROR: return "A resource/record locking failure (usually in an underlying database)."; 321 case NOSTORE: return "The persistent store is unavailable; e.g. the database is down for maintenance or similar action, and the interaction or operation cannot be processed."; 322 case EXCEPTION: return "y."; 323 case TIMEOUT: return "An internal timeout has occurred."; 324 case INCOMPLETE: return "Not all data sources typically accessed could be reached or responded in time, so the returned information might not be complete (applies to search interactions and some operations)."; 325 case THROTTLED: return "The system is not prepared to handle this request due to load management."; 326 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.)."; 327 default: return "?"; 328 } 329 } 330 public String getDisplay() { 331 switch (this) { 332 case INVALID: return "Invalid Content"; 333 case STRUCTURE: return "Structural Issue"; 334 case REQUIRED: return "Required element missing"; 335 case VALUE: return "Element value invalid"; 336 case INVARIANT: return "Validation rule failed"; 337 case SECURITY: return "Security Problem"; 338 case LOGIN: return "Login Required"; 339 case UNKNOWN: return "Unknown User"; 340 case EXPIRED: return "Session Expired"; 341 case FORBIDDEN: return "Forbidden"; 342 case SUPPRESSED: return "Information Suppressed"; 343 case PROCESSING: return "Processing Failure"; 344 case NOTSUPPORTED: return "Content not supported"; 345 case DUPLICATE: return "Duplicate"; 346 case MULTIPLEMATCHES: return "Multiple Matches"; 347 case NOTFOUND: return "Not Found"; 348 case DELETED: return "Deleted"; 349 case TOOLONG: return "Content Too Long"; 350 case CODEINVALID: return "Invalid Code"; 351 case EXTENSION: return "Unacceptable Extension"; 352 case TOOCOSTLY: return "Operation Too Costly"; 353 case BUSINESSRULE: return "Business Rule Violation"; 354 case CONFLICT: return "Edit Version Conflict"; 355 case TRANSIENT: return "Transient Issue"; 356 case LOCKERROR: return "Lock Error"; 357 case NOSTORE: return "No Store Available"; 358 case EXCEPTION: return "Exception"; 359 case TIMEOUT: return "Timeout"; 360 case INCOMPLETE: return "Incomplete Results"; 361 case THROTTLED: return "Throttled"; 362 case INFORMATIONAL: return "Informational Note"; 363 default: return "?"; 364 } 365 } 366 367 368} 369