001package org.hl7.fhir.dstu3.model.codesystems; 002 003 004 005 006/* 007 Copyright (c) 2011+, HL7, Inc. 008 All rights reserved. 009 010 Redistribution and use in source and binary forms, with or without modification, 011 are permitted provided that the following conditions are met: 012 013 * Redistributions of source code must retain the above copyright notice, this 014 list of conditions and the following disclaimer. 015 * Redistributions in binary form must reproduce the above copyright notice, 016 this list of conditions and the following disclaimer in the documentation 017 and/or other materials provided with the distribution. 018 * Neither the name of HL7 nor the names of its contributors may be used to 019 endorse or promote products derived from this software without specific 020 prior written permission. 021 022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 023 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 024 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 025 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 026 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 027 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 028 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 029 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 030 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 031 POSSIBILITY OF SUCH DAMAGE. 032 033*/ 034 035// Generated on Sat, Mar 25, 2017 21:03-0400 for FHIR v3.0.0 036 037 038import org.hl7.fhir.exceptions.FHIRException; 039 040public enum OperationOutcome { 041 042 /** 043 * null 044 */ 045 MSGAUTHREQUIRED, 046 /** 047 * null 048 */ 049 MSGBADFORMAT, 050 /** 051 * null 052 */ 053 MSGBADSYNTAX, 054 /** 055 * null 056 */ 057 MSGCANTPARSECONTENT, 058 /** 059 * null 060 */ 061 MSGCANTPARSEROOT, 062 /** 063 * null 064 */ 065 MSGCREATED, 066 /** 067 * null 068 */ 069 MSGDATEFORMAT, 070 /** 071 * null 072 */ 073 MSGDELETED, 074 /** 075 * null 076 */ 077 MSGDELETEDDONE, 078 /** 079 * null 080 */ 081 MSGDELETEDID, 082 /** 083 * null 084 */ 085 MSGDUPLICATEID, 086 /** 087 * null 088 */ 089 MSGERRORPARSING, 090 /** 091 * null 092 */ 093 MSGIDINVALID, 094 /** 095 * null 096 */ 097 MSGIDTOOLONG, 098 /** 099 * null 100 */ 101 MSGINVALIDID, 102 /** 103 * null 104 */ 105 MSGJSONOBJECT, 106 /** 107 * null 108 */ 109 MSGLOCALFAIL, 110 /** 111 * null 112 */ 113 MSGNOMATCH, 114 /** 115 * null 116 */ 117 MSGNOEXIST, 118 /** 119 * null 120 */ 121 MSGNOMODULE, 122 /** 123 * null 124 */ 125 MSGNOSUMMARY, 126 /** 127 * null 128 */ 129 MSGOPNOTALLOWED, 130 /** 131 * null 132 */ 133 MSGPARAMCHAINED, 134 /** 135 * null 136 */ 137 MSGPARAMNOREPEAT, 138 /** 139 * null 140 */ 141 MSGPARAMUNKNOWN, 142 /** 143 * null 144 */ 145 MSGPARAMINVALID, 146 /** 147 * null 148 */ 149 MSGPARAMMODIFIERINVALID, 150 /** 151 * null 152 */ 153 MSGRESOURCEEXAMPLEPROTECTED, 154 /** 155 * null 156 */ 157 MSGRESOURCEIDFAIL, 158 /** 159 * null 160 */ 161 MSGRESOURCENOTALLOWED, 162 /** 163 * null 164 */ 165 MSGRESOURCEREQUIRED, 166 /** 167 * null 168 */ 169 MSGRESOURCEIDMISMATCH, 170 /** 171 * null 172 */ 173 MSGRESOURCEIDMISSING, 174 /** 175 * null 176 */ 177 MSGRESOURCETYPEMISMATCH, 178 /** 179 * null 180 */ 181 MSGSORTUNKNOWN, 182 /** 183 * null 184 */ 185 MSGTRANSACTIONDUPLICATEID, 186 /** 187 * null 188 */ 189 MSGTRANSACTIONMISSINGID, 190 /** 191 * null 192 */ 193 MSGUNHANDLEDNODETYPE, 194 /** 195 * null 196 */ 197 MSGUNKNOWNCONTENT, 198 /** 199 * null 200 */ 201 MSGUNKNOWNOPERATION, 202 /** 203 * null 204 */ 205 MSGUNKNOWNTYPE, 206 /** 207 * null 208 */ 209 MSGUPDATED, 210 /** 211 * null 212 */ 213 MSGVERSIONAWARE, 214 /** 215 * null 216 */ 217 MSGVERSIONAWARECONFLICT, 218 /** 219 * null 220 */ 221 MSGVERSIONAWAREURL, 222 /** 223 * null 224 */ 225 MSGWRONGNS, 226 /** 227 * null 228 */ 229 SEARCHMULTIPLE, 230 /** 231 * null 232 */ 233 UPDATEMULTIPLEMATCHES, 234 /** 235 * null 236 */ 237 DELETEMULTIPLEMATCHES, 238 /** 239 * null 240 */ 241 SEARCHNONE, 242 /** 243 * added to help the parsers 244 */ 245 NULL; 246 public static OperationOutcome fromCode(String codeString) throws FHIRException { 247 if (codeString == null || "".equals(codeString)) 248 return null; 249 if ("MSG_AUTH_REQUIRED".equals(codeString)) 250 return MSGAUTHREQUIRED; 251 if ("MSG_BAD_FORMAT".equals(codeString)) 252 return MSGBADFORMAT; 253 if ("MSG_BAD_SYNTAX".equals(codeString)) 254 return MSGBADSYNTAX; 255 if ("MSG_CANT_PARSE_CONTENT".equals(codeString)) 256 return MSGCANTPARSECONTENT; 257 if ("MSG_CANT_PARSE_ROOT".equals(codeString)) 258 return MSGCANTPARSEROOT; 259 if ("MSG_CREATED".equals(codeString)) 260 return MSGCREATED; 261 if ("MSG_DATE_FORMAT".equals(codeString)) 262 return MSGDATEFORMAT; 263 if ("MSG_DELETED".equals(codeString)) 264 return MSGDELETED; 265 if ("MSG_DELETED_DONE".equals(codeString)) 266 return MSGDELETEDDONE; 267 if ("MSG_DELETED_ID".equals(codeString)) 268 return MSGDELETEDID; 269 if ("MSG_DUPLICATE_ID".equals(codeString)) 270 return MSGDUPLICATEID; 271 if ("MSG_ERROR_PARSING".equals(codeString)) 272 return MSGERRORPARSING; 273 if ("MSG_ID_INVALID".equals(codeString)) 274 return MSGIDINVALID; 275 if ("MSG_ID_TOO_LONG".equals(codeString)) 276 return MSGIDTOOLONG; 277 if ("MSG_INVALID_ID".equals(codeString)) 278 return MSGINVALIDID; 279 if ("MSG_JSON_OBJECT".equals(codeString)) 280 return MSGJSONOBJECT; 281 if ("MSG_LOCAL_FAIL".equals(codeString)) 282 return MSGLOCALFAIL; 283 if ("MSG_NO_MATCH".equals(codeString)) 284 return MSGNOMATCH; 285 if ("MSG_NO_EXIST".equals(codeString)) 286 return MSGNOEXIST; 287 if ("MSG_NO_MODULE".equals(codeString)) 288 return MSGNOMODULE; 289 if ("MSG_NO_SUMMARY".equals(codeString)) 290 return MSGNOSUMMARY; 291 if ("MSG_OP_NOT_ALLOWED".equals(codeString)) 292 return MSGOPNOTALLOWED; 293 if ("MSG_PARAM_CHAINED".equals(codeString)) 294 return MSGPARAMCHAINED; 295 if ("MSG_PARAM_NO_REPEAT".equals(codeString)) 296 return MSGPARAMNOREPEAT; 297 if ("MSG_PARAM_UNKNOWN".equals(codeString)) 298 return MSGPARAMUNKNOWN; 299 if ("MSG_PARAM_INVALID".equals(codeString)) 300 return MSGPARAMINVALID; 301 if ("MSG_PARAM_MODIFIER_INVALID".equals(codeString)) 302 return MSGPARAMMODIFIERINVALID; 303 if ("MSG_RESOURCE_EXAMPLE_PROTECTED".equals(codeString)) 304 return MSGRESOURCEEXAMPLEPROTECTED; 305 if ("MSG_RESOURCE_ID_FAIL".equals(codeString)) 306 return MSGRESOURCEIDFAIL; 307 if ("MSG_RESOURCE_NOT_ALLOWED".equals(codeString)) 308 return MSGRESOURCENOTALLOWED; 309 if ("MSG_RESOURCE_REQUIRED".equals(codeString)) 310 return MSGRESOURCEREQUIRED; 311 if ("MSG_RESOURCE_ID_MISMATCH".equals(codeString)) 312 return MSGRESOURCEIDMISMATCH; 313 if ("MSG_RESOURCE_ID_MISSING".equals(codeString)) 314 return MSGRESOURCEIDMISSING; 315 if ("MSG_RESOURCE_TYPE_MISMATCH".equals(codeString)) 316 return MSGRESOURCETYPEMISMATCH; 317 if ("MSG_SORT_UNKNOWN".equals(codeString)) 318 return MSGSORTUNKNOWN; 319 if ("MSG_TRANSACTION_DUPLICATE_ID".equals(codeString)) 320 return MSGTRANSACTIONDUPLICATEID; 321 if ("MSG_TRANSACTION_MISSING_ID".equals(codeString)) 322 return MSGTRANSACTIONMISSINGID; 323 if ("MSG_UNHANDLED_NODE_TYPE".equals(codeString)) 324 return MSGUNHANDLEDNODETYPE; 325 if ("MSG_UNKNOWN_CONTENT".equals(codeString)) 326 return MSGUNKNOWNCONTENT; 327 if ("MSG_UNKNOWN_OPERATION".equals(codeString)) 328 return MSGUNKNOWNOPERATION; 329 if ("MSG_UNKNOWN_TYPE".equals(codeString)) 330 return MSGUNKNOWNTYPE; 331 if ("MSG_UPDATED".equals(codeString)) 332 return MSGUPDATED; 333 if ("MSG_VERSION_AWARE".equals(codeString)) 334 return MSGVERSIONAWARE; 335 if ("MSG_VERSION_AWARE_CONFLICT".equals(codeString)) 336 return MSGVERSIONAWARECONFLICT; 337 if ("MSG_VERSION_AWARE_URL".equals(codeString)) 338 return MSGVERSIONAWAREURL; 339 if ("MSG_WRONG_NS".equals(codeString)) 340 return MSGWRONGNS; 341 if ("SEARCH_MULTIPLE".equals(codeString)) 342 return SEARCHMULTIPLE; 343 if ("UPDATE_MULTIPLE_MATCHES".equals(codeString)) 344 return UPDATEMULTIPLEMATCHES; 345 if ("DELETE_MULTIPLE_MATCHES".equals(codeString)) 346 return DELETEMULTIPLEMATCHES; 347 if ("SEARCH_NONE".equals(codeString)) 348 return SEARCHNONE; 349 throw new FHIRException("Unknown OperationOutcome code '"+codeString+"'"); 350 } 351 public String toCode() { 352 switch (this) { 353 case MSGAUTHREQUIRED: return "MSG_AUTH_REQUIRED"; 354 case MSGBADFORMAT: return "MSG_BAD_FORMAT"; 355 case MSGBADSYNTAX: return "MSG_BAD_SYNTAX"; 356 case MSGCANTPARSECONTENT: return "MSG_CANT_PARSE_CONTENT"; 357 case MSGCANTPARSEROOT: return "MSG_CANT_PARSE_ROOT"; 358 case MSGCREATED: return "MSG_CREATED"; 359 case MSGDATEFORMAT: return "MSG_DATE_FORMAT"; 360 case MSGDELETED: return "MSG_DELETED"; 361 case MSGDELETEDDONE: return "MSG_DELETED_DONE"; 362 case MSGDELETEDID: return "MSG_DELETED_ID"; 363 case MSGDUPLICATEID: return "MSG_DUPLICATE_ID"; 364 case MSGERRORPARSING: return "MSG_ERROR_PARSING"; 365 case MSGIDINVALID: return "MSG_ID_INVALID"; 366 case MSGIDTOOLONG: return "MSG_ID_TOO_LONG"; 367 case MSGINVALIDID: return "MSG_INVALID_ID"; 368 case MSGJSONOBJECT: return "MSG_JSON_OBJECT"; 369 case MSGLOCALFAIL: return "MSG_LOCAL_FAIL"; 370 case MSGNOMATCH: return "MSG_NO_MATCH"; 371 case MSGNOEXIST: return "MSG_NO_EXIST"; 372 case MSGNOMODULE: return "MSG_NO_MODULE"; 373 case MSGNOSUMMARY: return "MSG_NO_SUMMARY"; 374 case MSGOPNOTALLOWED: return "MSG_OP_NOT_ALLOWED"; 375 case MSGPARAMCHAINED: return "MSG_PARAM_CHAINED"; 376 case MSGPARAMNOREPEAT: return "MSG_PARAM_NO_REPEAT"; 377 case MSGPARAMUNKNOWN: return "MSG_PARAM_UNKNOWN"; 378 case MSGPARAMINVALID: return "MSG_PARAM_INVALID"; 379 case MSGPARAMMODIFIERINVALID: return "MSG_PARAM_MODIFIER_INVALID"; 380 case MSGRESOURCEEXAMPLEPROTECTED: return "MSG_RESOURCE_EXAMPLE_PROTECTED"; 381 case MSGRESOURCEIDFAIL: return "MSG_RESOURCE_ID_FAIL"; 382 case MSGRESOURCENOTALLOWED: return "MSG_RESOURCE_NOT_ALLOWED"; 383 case MSGRESOURCEREQUIRED: return "MSG_RESOURCE_REQUIRED"; 384 case MSGRESOURCEIDMISMATCH: return "MSG_RESOURCE_ID_MISMATCH"; 385 case MSGRESOURCEIDMISSING: return "MSG_RESOURCE_ID_MISSING"; 386 case MSGRESOURCETYPEMISMATCH: return "MSG_RESOURCE_TYPE_MISMATCH"; 387 case MSGSORTUNKNOWN: return "MSG_SORT_UNKNOWN"; 388 case MSGTRANSACTIONDUPLICATEID: return "MSG_TRANSACTION_DUPLICATE_ID"; 389 case MSGTRANSACTIONMISSINGID: return "MSG_TRANSACTION_MISSING_ID"; 390 case MSGUNHANDLEDNODETYPE: return "MSG_UNHANDLED_NODE_TYPE"; 391 case MSGUNKNOWNCONTENT: return "MSG_UNKNOWN_CONTENT"; 392 case MSGUNKNOWNOPERATION: return "MSG_UNKNOWN_OPERATION"; 393 case MSGUNKNOWNTYPE: return "MSG_UNKNOWN_TYPE"; 394 case MSGUPDATED: return "MSG_UPDATED"; 395 case MSGVERSIONAWARE: return "MSG_VERSION_AWARE"; 396 case MSGVERSIONAWARECONFLICT: return "MSG_VERSION_AWARE_CONFLICT"; 397 case MSGVERSIONAWAREURL: return "MSG_VERSION_AWARE_URL"; 398 case MSGWRONGNS: return "MSG_WRONG_NS"; 399 case SEARCHMULTIPLE: return "SEARCH_MULTIPLE"; 400 case UPDATEMULTIPLEMATCHES: return "UPDATE_MULTIPLE_MATCHES"; 401 case DELETEMULTIPLEMATCHES: return "DELETE_MULTIPLE_MATCHES"; 402 case SEARCHNONE: return "SEARCH_NONE"; 403 case NULL: return null; 404 default: return "?"; 405 } 406 } 407 public String getSystem() { 408 return "http://hl7.org/fhir/operation-outcome"; 409 } 410 public String getDefinition() { 411 switch (this) { 412 case MSGAUTHREQUIRED: return ""; 413 case MSGBADFORMAT: return ""; 414 case MSGBADSYNTAX: return ""; 415 case MSGCANTPARSECONTENT: return ""; 416 case MSGCANTPARSEROOT: return ""; 417 case MSGCREATED: return ""; 418 case MSGDATEFORMAT: return ""; 419 case MSGDELETED: return ""; 420 case MSGDELETEDDONE: return ""; 421 case MSGDELETEDID: return ""; 422 case MSGDUPLICATEID: return ""; 423 case MSGERRORPARSING: return ""; 424 case MSGIDINVALID: return ""; 425 case MSGIDTOOLONG: return ""; 426 case MSGINVALIDID: return ""; 427 case MSGJSONOBJECT: return ""; 428 case MSGLOCALFAIL: return ""; 429 case MSGNOMATCH: return ""; 430 case MSGNOEXIST: return ""; 431 case MSGNOMODULE: return ""; 432 case MSGNOSUMMARY: return ""; 433 case MSGOPNOTALLOWED: return ""; 434 case MSGPARAMCHAINED: return ""; 435 case MSGPARAMNOREPEAT: return ""; 436 case MSGPARAMUNKNOWN: return ""; 437 case MSGPARAMINVALID: return ""; 438 case MSGPARAMMODIFIERINVALID: return ""; 439 case MSGRESOURCEEXAMPLEPROTECTED: return ""; 440 case MSGRESOURCEIDFAIL: return ""; 441 case MSGRESOURCENOTALLOWED: return ""; 442 case MSGRESOURCEREQUIRED: return ""; 443 case MSGRESOURCEIDMISMATCH: return ""; 444 case MSGRESOURCEIDMISSING: return ""; 445 case MSGRESOURCETYPEMISMATCH: return ""; 446 case MSGSORTUNKNOWN: return ""; 447 case MSGTRANSACTIONDUPLICATEID: return ""; 448 case MSGTRANSACTIONMISSINGID: return ""; 449 case MSGUNHANDLEDNODETYPE: return ""; 450 case MSGUNKNOWNCONTENT: return ""; 451 case MSGUNKNOWNOPERATION: return ""; 452 case MSGUNKNOWNTYPE: return ""; 453 case MSGUPDATED: return ""; 454 case MSGVERSIONAWARE: return ""; 455 case MSGVERSIONAWARECONFLICT: return ""; 456 case MSGVERSIONAWAREURL: return ""; 457 case MSGWRONGNS: return ""; 458 case SEARCHMULTIPLE: return ""; 459 case UPDATEMULTIPLEMATCHES: return ""; 460 case DELETEMULTIPLEMATCHES: return ""; 461 case SEARCHNONE: return ""; 462 case NULL: return null; 463 default: return "?"; 464 } 465 } 466 public String getDisplay() { 467 switch (this) { 468 case MSGAUTHREQUIRED: return "You must authenticate before you can use this service"; 469 case MSGBADFORMAT: return "Bad Syntax: \"%s\" must be a %s'"; 470 case MSGBADSYNTAX: return "Bad Syntax in %s"; 471 case MSGCANTPARSECONTENT: return "Unable to parse feed (entry content type = \"%s\")"; 472 case MSGCANTPARSEROOT: return "Unable to parse feed (root element name = \"%s\")"; 473 case MSGCREATED: return "New resource created"; 474 case MSGDATEFORMAT: return "The Date value %s is not in the correct format (Xml Date Format required)"; 475 case MSGDELETED: return "This resource has been deleted"; 476 case MSGDELETEDDONE: return "Resource deleted"; 477 case MSGDELETEDID: return "The resource \"%s\" has been deleted"; 478 case MSGDUPLICATEID: return "Duplicate Id %s for resource type %s"; 479 case MSGERRORPARSING: return "Error parsing resource Xml (%s)"; 480 case MSGIDINVALID: return "Id \"%s\" has an invalid character \"%s\""; 481 case MSGIDTOOLONG: return "Id \"%s\" too long (length limit 36)"; 482 case MSGINVALIDID: return "Id not accepted"; 483 case MSGJSONOBJECT: return "Json Source for a resource should start with an object"; 484 case MSGLOCALFAIL: return "Unable to resolve local reference to resource %s"; 485 case MSGNOMATCH: return "No Resource found matching the query \"%s\""; 486 case MSGNOEXIST: return "Resource Id \"%s\" does not exist"; 487 case MSGNOMODULE: return "No module could be found to handle the request \"%s\""; 488 case MSGNOSUMMARY: return "No Summary for this resource"; 489 case MSGOPNOTALLOWED: return "Operation %s not allowed for resource %s (due to local configuration)"; 490 case MSGPARAMCHAINED: return "Unknown chained parameter name \"%s\""; 491 case MSGPARAMNOREPEAT: return "Parameter \"%s\" is not allowed to repeat"; 492 case MSGPARAMUNKNOWN: return "Parameter \"%s\" not understood"; 493 case MSGPARAMINVALID: return "Parameter \"%s\" content is invalid"; 494 case MSGPARAMMODIFIERINVALID: return "Parameter \"%s\" modifier is invalid"; 495 case MSGRESOURCEEXAMPLEPROTECTED: return "Resources with identity \"example\" cannot be deleted (for testing/training purposes)"; 496 case MSGRESOURCEIDFAIL: return "unable to allocate resource id"; 497 case MSGRESOURCENOTALLOWED: return "Not allowed to submit a resource for this operation"; 498 case MSGRESOURCEREQUIRED: return "A resource is required"; 499 case MSGRESOURCEIDMISMATCH: return "Resource Id Mismatch"; 500 case MSGRESOURCEIDMISSING: return "Resource Id Missing"; 501 case MSGRESOURCETYPEMISMATCH: return "Resource Type Mismatch"; 502 case MSGSORTUNKNOWN: return "Unknown sort parameter name \"%s\""; 503 case MSGTRANSACTIONDUPLICATEID: return "Duplicate Identifier in transaction: %s"; 504 case MSGTRANSACTIONMISSINGID: return "Missing Identifier in transaction - an entry.id must be provided"; 505 case MSGUNHANDLEDNODETYPE: return "Unhandled xml node type \"%s\""; 506 case MSGUNKNOWNCONTENT: return "Unknown Content (%s) at %s"; 507 case MSGUNKNOWNOPERATION: return "unknown FHIR http operation"; 508 case MSGUNKNOWNTYPE: return "Resource Type \"%s\" not recognised"; 509 case MSGUPDATED: return "existing resource updated"; 510 case MSGVERSIONAWARE: return "Version aware updates are required for this resource"; 511 case MSGVERSIONAWARECONFLICT: return "Update Conflict (server current version = \"%s\", client version referenced = \"%s\")"; 512 case MSGVERSIONAWAREURL: return "Version specific URL not recognised"; 513 case MSGWRONGNS: return "This does not appear to be a FHIR element or resource (wrong namespace \"%s\")"; 514 case SEARCHMULTIPLE: return "Error: Multiple matches exist for %s search parameters \"%s\""; 515 case UPDATEMULTIPLEMATCHES: return "Error: Multiple matches exist for the conditional update"; 516 case DELETEMULTIPLEMATCHES: return "Error: Multiple matches exist for the conditional delete"; 517 case SEARCHNONE: return "Error: no processable search found for %s search parameters \"%s\""; 518 case NULL: return null; 519 default: return "?"; 520 } 521 } 522 523 524}