001package org.hl7.fhir.dstu3.model; 002 003/*- 004 * #%L 005 * org.hl7.fhir.dstu3 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 Fri, Mar 16, 2018 15:21+1100 for FHIR v3.0.x 054import java.util.ArrayList; 055import java.util.List; 056 057import org.hl7.fhir.exceptions.FHIRException; 058import org.hl7.fhir.instance.model.api.IBaseBackboneElement; 059import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; 060import org.hl7.fhir.utilities.Utilities; 061 062import ca.uhn.fhir.model.api.annotation.Block; 063import ca.uhn.fhir.model.api.annotation.Child; 064import ca.uhn.fhir.model.api.annotation.Description; 065import ca.uhn.fhir.model.api.annotation.ResourceDef; 066/** 067 * A collection of error, warning or information messages that result from a system action. 068 */ 069@ResourceDef(name="OperationOutcome", profile="http://hl7.org/fhir/Profile/OperationOutcome") 070public class OperationOutcome extends DomainResource implements IBaseOperationOutcome { 071 072 public enum IssueSeverity { 073 /** 074 * The issue caused the action to fail, and no further checking could be performed. 075 */ 076 FATAL, 077 /** 078 * The issue is sufficiently important to cause the action to fail. 079 */ 080 ERROR, 081 /** 082 * The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired. 083 */ 084 WARNING, 085 /** 086 * The issue has no relation to the degree of success of the action. 087 */ 088 INFORMATION, 089 /** 090 * added to help the parsers with the generic types 091 */ 092 NULL; 093 public static IssueSeverity fromCode(String codeString) throws FHIRException { 094 if (codeString == null || "".equals(codeString)) 095 return null; 096 if ("fatal".equals(codeString)) 097 return FATAL; 098 if ("error".equals(codeString)) 099 return ERROR; 100 if ("warning".equals(codeString)) 101 return WARNING; 102 if ("information".equals(codeString)) 103 return INFORMATION; 104 if (Configuration.isAcceptInvalidEnums()) 105 return null; 106 else 107 throw new FHIRException("Unknown IssueSeverity code '"+codeString+"'"); 108 } 109 public String toCode() { 110 switch (this) { 111 case FATAL: return "fatal"; 112 case ERROR: return "error"; 113 case WARNING: return "warning"; 114 case INFORMATION: return "information"; 115 default: return "?"; 116 } 117 } 118 public String getSystem() { 119 switch (this) { 120 case FATAL: return "http://hl7.org/fhir/issue-severity"; 121 case ERROR: return "http://hl7.org/fhir/issue-severity"; 122 case WARNING: return "http://hl7.org/fhir/issue-severity"; 123 case INFORMATION: return "http://hl7.org/fhir/issue-severity"; 124 default: return "?"; 125 } 126 } 127 public String getDefinition() { 128 switch (this) { 129 case FATAL: return "The issue caused the action to fail, and no further checking could be performed."; 130 case ERROR: return "The issue is sufficiently important to cause the action to fail."; 131 case WARNING: return "The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired."; 132 case INFORMATION: return "The issue has no relation to the degree of success of the action."; 133 default: return "?"; 134 } 135 } 136 public String getDisplay() { 137 switch (this) { 138 case FATAL: return "Fatal"; 139 case ERROR: return "Error"; 140 case WARNING: return "Warning"; 141 case INFORMATION: return "Information"; 142 default: return "?"; 143 } 144 } 145 } 146 147 public static class IssueSeverityEnumFactory implements EnumFactory<IssueSeverity> { 148 public IssueSeverity fromCode(String codeString) throws IllegalArgumentException { 149 if (codeString == null || "".equals(codeString)) 150 if (codeString == null || "".equals(codeString)) 151 return null; 152 if ("fatal".equals(codeString)) 153 return IssueSeverity.FATAL; 154 if ("error".equals(codeString)) 155 return IssueSeverity.ERROR; 156 if ("warning".equals(codeString)) 157 return IssueSeverity.WARNING; 158 if ("information".equals(codeString)) 159 return IssueSeverity.INFORMATION; 160 throw new IllegalArgumentException("Unknown IssueSeverity code '"+codeString+"'"); 161 } 162 public Enumeration<IssueSeverity> fromType(Base code) throws FHIRException { 163 if (code == null) 164 return null; 165 if (code.isEmpty()) 166 return new Enumeration<IssueSeverity>(this); 167 String codeString = ((PrimitiveType) code).asStringValue(); 168 if (codeString == null || "".equals(codeString)) 169 return null; 170 if ("fatal".equals(codeString)) 171 return new Enumeration<IssueSeverity>(this, IssueSeverity.FATAL); 172 if ("error".equals(codeString)) 173 return new Enumeration<IssueSeverity>(this, IssueSeverity.ERROR); 174 if ("warning".equals(codeString)) 175 return new Enumeration<IssueSeverity>(this, IssueSeverity.WARNING); 176 if ("information".equals(codeString)) 177 return new Enumeration<IssueSeverity>(this, IssueSeverity.INFORMATION); 178 throw new FHIRException("Unknown IssueSeverity code '"+codeString+"'"); 179 } 180 public String toCode(IssueSeverity code) { 181 if (code == IssueSeverity.FATAL) 182 return "fatal"; 183 if (code == IssueSeverity.ERROR) 184 return "error"; 185 if (code == IssueSeverity.WARNING) 186 return "warning"; 187 if (code == IssueSeverity.INFORMATION) 188 return "information"; 189 return "?"; 190 } 191 public String toSystem(IssueSeverity code) { 192 return code.getSystem(); 193 } 194 } 195 196 public enum IssueType { 197 /** 198 * Content invalid against the specification or a profile. 199 */ 200 INVALID, 201 /** 202 * A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax. 203 */ 204 STRUCTURE, 205 /** 206 * A required element is missing. 207 */ 208 REQUIRED, 209 /** 210 * An element value is invalid. 211 */ 212 VALUE, 213 /** 214 * A content validation rule failed - e.g. a schematron rule. 215 */ 216 INVARIANT, 217 /** 218 * An authentication/authorization/permissions issue of some kind. 219 */ 220 SECURITY, 221 /** 222 * The client needs to initiate an authentication process. 223 */ 224 LOGIN, 225 /** 226 * The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable). 227 */ 228 UNKNOWN, 229 /** 230 * User session expired; a login may be required. 231 */ 232 EXPIRED, 233 /** 234 * The user does not have the rights to perform this action. 235 */ 236 FORBIDDEN, 237 /** 238 * 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. 239 */ 240 SUPPRESSED, 241 /** 242 * Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged. 243 */ 244 PROCESSING, 245 /** 246 * The resource or profile is not supported. 247 */ 248 NOTSUPPORTED, 249 /** 250 * An attempt was made to create a duplicate record. 251 */ 252 DUPLICATE, 253 /** 254 * 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. 255 */ 256 NOTFOUND, 257 /** 258 * Provided content is too long (typically, this is a denial of service protection type of error). 259 */ 260 TOOLONG, 261 /** 262 * The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code. 263 */ 264 CODEINVALID, 265 /** 266 * An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not recognized. 267 */ 268 EXTENSION, 269 /** 270 * The operation was stopped to protect server resources; e.g. a request for a value set expansion on all of SNOMED CT. 271 */ 272 TOOCOSTLY, 273 /** 274 * The content/operation failed to pass some business rule, and so could not proceed. 275 */ 276 BUSINESSRULE, 277 /** 278 * 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.) 279 */ 280 CONFLICT, 281 /** 282 * Not all data sources typically accessed could be reached, or responded in time, so the returned information may not be complete. 283 */ 284 INCOMPLETE, 285 /** 286 * Transient processing issues. The system receiving the error may be able to resubmit the same content once an underlying issue is resolved. 287 */ 288 TRANSIENT, 289 /** 290 * A resource/record locking failure (usually in an underlying database). 291 */ 292 LOCKERROR, 293 /** 294 * The persistent store is unavailable; e.g. the database is down for maintenance or similar action. 295 */ 296 NOSTORE, 297 /** 298 * An unexpected internal error has occurred. 299 */ 300 EXCEPTION, 301 /** 302 * An internal timeout has occurred. 303 */ 304 TIMEOUT, 305 /** 306 * The system is not prepared to handle this request due to load management. 307 */ 308 THROTTLED, 309 /** 310 * 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.). 311 */ 312 INFORMATIONAL, 313 /** 314 * added to help the parsers with the generic types 315 */ 316 NULL; 317 public static IssueType fromCode(String codeString) throws FHIRException { 318 if (codeString == null || "".equals(codeString)) 319 return null; 320 if ("invalid".equals(codeString)) 321 return INVALID; 322 if ("structure".equals(codeString)) 323 return STRUCTURE; 324 if ("required".equals(codeString)) 325 return REQUIRED; 326 if ("value".equals(codeString)) 327 return VALUE; 328 if ("invariant".equals(codeString)) 329 return INVARIANT; 330 if ("security".equals(codeString)) 331 return SECURITY; 332 if ("login".equals(codeString)) 333 return LOGIN; 334 if ("unknown".equals(codeString)) 335 return UNKNOWN; 336 if ("expired".equals(codeString)) 337 return EXPIRED; 338 if ("forbidden".equals(codeString)) 339 return FORBIDDEN; 340 if ("suppressed".equals(codeString)) 341 return SUPPRESSED; 342 if ("processing".equals(codeString)) 343 return PROCESSING; 344 if ("not-supported".equals(codeString)) 345 return NOTSUPPORTED; 346 if ("duplicate".equals(codeString)) 347 return DUPLICATE; 348 if ("not-found".equals(codeString)) 349 return NOTFOUND; 350 if ("too-long".equals(codeString)) 351 return TOOLONG; 352 if ("code-invalid".equals(codeString)) 353 return CODEINVALID; 354 if ("extension".equals(codeString)) 355 return EXTENSION; 356 if ("too-costly".equals(codeString)) 357 return TOOCOSTLY; 358 if ("business-rule".equals(codeString)) 359 return BUSINESSRULE; 360 if ("conflict".equals(codeString)) 361 return CONFLICT; 362 if ("incomplete".equals(codeString)) 363 return INCOMPLETE; 364 if ("transient".equals(codeString)) 365 return TRANSIENT; 366 if ("lock-error".equals(codeString)) 367 return LOCKERROR; 368 if ("no-store".equals(codeString)) 369 return NOSTORE; 370 if ("exception".equals(codeString)) 371 return EXCEPTION; 372 if ("timeout".equals(codeString)) 373 return TIMEOUT; 374 if ("throttled".equals(codeString)) 375 return THROTTLED; 376 if ("informational".equals(codeString)) 377 return INFORMATIONAL; 378 if (Configuration.isAcceptInvalidEnums()) 379 return null; 380 else 381 throw new FHIRException("Unknown IssueType code '"+codeString+"'"); 382 } 383 public String toCode() { 384 switch (this) { 385 case INVALID: return "invalid"; 386 case STRUCTURE: return "structure"; 387 case REQUIRED: return "required"; 388 case VALUE: return "value"; 389 case INVARIANT: return "invariant"; 390 case SECURITY: return "security"; 391 case LOGIN: return "login"; 392 case UNKNOWN: return "unknown"; 393 case EXPIRED: return "expired"; 394 case FORBIDDEN: return "forbidden"; 395 case SUPPRESSED: return "suppressed"; 396 case PROCESSING: return "processing"; 397 case NOTSUPPORTED: return "not-supported"; 398 case DUPLICATE: return "duplicate"; 399 case NOTFOUND: return "not-found"; 400 case TOOLONG: return "too-long"; 401 case CODEINVALID: return "code-invalid"; 402 case EXTENSION: return "extension"; 403 case TOOCOSTLY: return "too-costly"; 404 case BUSINESSRULE: return "business-rule"; 405 case CONFLICT: return "conflict"; 406 case INCOMPLETE: return "incomplete"; 407 case TRANSIENT: return "transient"; 408 case LOCKERROR: return "lock-error"; 409 case NOSTORE: return "no-store"; 410 case EXCEPTION: return "exception"; 411 case TIMEOUT: return "timeout"; 412 case THROTTLED: return "throttled"; 413 case INFORMATIONAL: return "informational"; 414 default: return "?"; 415 } 416 } 417 public String getSystem() { 418 switch (this) { 419 case INVALID: return "http://hl7.org/fhir/issue-type"; 420 case STRUCTURE: return "http://hl7.org/fhir/issue-type"; 421 case REQUIRED: return "http://hl7.org/fhir/issue-type"; 422 case VALUE: return "http://hl7.org/fhir/issue-type"; 423 case INVARIANT: return "http://hl7.org/fhir/issue-type"; 424 case SECURITY: return "http://hl7.org/fhir/issue-type"; 425 case LOGIN: return "http://hl7.org/fhir/issue-type"; 426 case UNKNOWN: return "http://hl7.org/fhir/issue-type"; 427 case EXPIRED: return "http://hl7.org/fhir/issue-type"; 428 case FORBIDDEN: return "http://hl7.org/fhir/issue-type"; 429 case SUPPRESSED: return "http://hl7.org/fhir/issue-type"; 430 case PROCESSING: return "http://hl7.org/fhir/issue-type"; 431 case NOTSUPPORTED: return "http://hl7.org/fhir/issue-type"; 432 case DUPLICATE: return "http://hl7.org/fhir/issue-type"; 433 case NOTFOUND: return "http://hl7.org/fhir/issue-type"; 434 case TOOLONG: return "http://hl7.org/fhir/issue-type"; 435 case CODEINVALID: return "http://hl7.org/fhir/issue-type"; 436 case EXTENSION: return "http://hl7.org/fhir/issue-type"; 437 case TOOCOSTLY: return "http://hl7.org/fhir/issue-type"; 438 case BUSINESSRULE: return "http://hl7.org/fhir/issue-type"; 439 case CONFLICT: return "http://hl7.org/fhir/issue-type"; 440 case INCOMPLETE: return "http://hl7.org/fhir/issue-type"; 441 case TRANSIENT: return "http://hl7.org/fhir/issue-type"; 442 case LOCKERROR: return "http://hl7.org/fhir/issue-type"; 443 case NOSTORE: return "http://hl7.org/fhir/issue-type"; 444 case EXCEPTION: return "http://hl7.org/fhir/issue-type"; 445 case TIMEOUT: return "http://hl7.org/fhir/issue-type"; 446 case THROTTLED: return "http://hl7.org/fhir/issue-type"; 447 case INFORMATIONAL: return "http://hl7.org/fhir/issue-type"; 448 default: return "?"; 449 } 450 } 451 public String getDefinition() { 452 switch (this) { 453 case INVALID: return "Content invalid against the specification or a profile."; 454 case STRUCTURE: return "A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax."; 455 case REQUIRED: return "A required element is missing."; 456 case VALUE: return "An element value is invalid."; 457 case INVARIANT: return "A content validation rule failed - e.g. a schematron rule."; 458 case SECURITY: return "An authentication/authorization/permissions issue of some kind."; 459 case LOGIN: return "The client needs to initiate an authentication process."; 460 case UNKNOWN: return "The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable)."; 461 case EXPIRED: return "User session expired; a login may be required."; 462 case FORBIDDEN: return "The user does not have the rights to perform this action."; 463 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."; 464 case PROCESSING: return "Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged."; 465 case NOTSUPPORTED: return "The resource or profile is not supported."; 466 case DUPLICATE: return "An attempt was made to create a duplicate record."; 467 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."; 468 case TOOLONG: return "Provided content is too long (typically, this is a denial of service protection type of error)."; 469 case CODEINVALID: return "The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code."; 470 case EXTENSION: return "An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not recognized."; 471 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."; 472 case BUSINESSRULE: return "The content/operation failed to pass some business rule, and so could not proceed."; 473 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.)"; 474 case INCOMPLETE: return "Not all data sources typically accessed could be reached, or responded in time, so the returned information may not be complete."; 475 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."; 476 case LOCKERROR: return "A resource/record locking failure (usually in an underlying database)."; 477 case NOSTORE: return "The persistent store is unavailable; e.g. the database is down for maintenance or similar action."; 478 case EXCEPTION: return "An unexpected internal error has occurred."; 479 case TIMEOUT: return "An internal timeout has occurred."; 480 case THROTTLED: return "The system is not prepared to handle this request due to load management."; 481 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.)."; 482 default: return "?"; 483 } 484 } 485 public String getDisplay() { 486 switch (this) { 487 case INVALID: return "Invalid Content"; 488 case STRUCTURE: return "Structural Issue"; 489 case REQUIRED: return "Required element missing"; 490 case VALUE: return "Element value invalid"; 491 case INVARIANT: return "Validation rule failed"; 492 case SECURITY: return "Security Problem"; 493 case LOGIN: return "Login Required"; 494 case UNKNOWN: return "Unknown User"; 495 case EXPIRED: return "Session Expired"; 496 case FORBIDDEN: return "Forbidden"; 497 case SUPPRESSED: return "Information Suppressed"; 498 case PROCESSING: return "Processing Failure"; 499 case NOTSUPPORTED: return "Content not supported"; 500 case DUPLICATE: return "Duplicate"; 501 case NOTFOUND: return "Not Found"; 502 case TOOLONG: return "Content Too Long"; 503 case CODEINVALID: return "Invalid Code"; 504 case EXTENSION: return "Unacceptable Extension"; 505 case TOOCOSTLY: return "Operation Too Costly"; 506 case BUSINESSRULE: return "Business Rule Violation"; 507 case CONFLICT: return "Edit Version Conflict"; 508 case INCOMPLETE: return "Incomplete Results"; 509 case TRANSIENT: return "Transient Issue"; 510 case LOCKERROR: return "Lock Error"; 511 case NOSTORE: return "No Store Available"; 512 case EXCEPTION: return "Exception"; 513 case TIMEOUT: return "Timeout"; 514 case THROTTLED: return "Throttled"; 515 case INFORMATIONAL: return "Informational Note"; 516 default: return "?"; 517 } 518 } 519 } 520 521 public static class IssueTypeEnumFactory implements EnumFactory<IssueType> { 522 public IssueType fromCode(String codeString) throws IllegalArgumentException { 523 if (codeString == null || "".equals(codeString)) 524 if (codeString == null || "".equals(codeString)) 525 return null; 526 if ("invalid".equals(codeString)) 527 return IssueType.INVALID; 528 if ("structure".equals(codeString)) 529 return IssueType.STRUCTURE; 530 if ("required".equals(codeString)) 531 return IssueType.REQUIRED; 532 if ("value".equals(codeString)) 533 return IssueType.VALUE; 534 if ("invariant".equals(codeString)) 535 return IssueType.INVARIANT; 536 if ("security".equals(codeString)) 537 return IssueType.SECURITY; 538 if ("login".equals(codeString)) 539 return IssueType.LOGIN; 540 if ("unknown".equals(codeString)) 541 return IssueType.UNKNOWN; 542 if ("expired".equals(codeString)) 543 return IssueType.EXPIRED; 544 if ("forbidden".equals(codeString)) 545 return IssueType.FORBIDDEN; 546 if ("suppressed".equals(codeString)) 547 return IssueType.SUPPRESSED; 548 if ("processing".equals(codeString)) 549 return IssueType.PROCESSING; 550 if ("not-supported".equals(codeString)) 551 return IssueType.NOTSUPPORTED; 552 if ("duplicate".equals(codeString)) 553 return IssueType.DUPLICATE; 554 if ("not-found".equals(codeString)) 555 return IssueType.NOTFOUND; 556 if ("too-long".equals(codeString)) 557 return IssueType.TOOLONG; 558 if ("code-invalid".equals(codeString)) 559 return IssueType.CODEINVALID; 560 if ("extension".equals(codeString)) 561 return IssueType.EXTENSION; 562 if ("too-costly".equals(codeString)) 563 return IssueType.TOOCOSTLY; 564 if ("business-rule".equals(codeString)) 565 return IssueType.BUSINESSRULE; 566 if ("conflict".equals(codeString)) 567 return IssueType.CONFLICT; 568 if ("incomplete".equals(codeString)) 569 return IssueType.INCOMPLETE; 570 if ("transient".equals(codeString)) 571 return IssueType.TRANSIENT; 572 if ("lock-error".equals(codeString)) 573 return IssueType.LOCKERROR; 574 if ("no-store".equals(codeString)) 575 return IssueType.NOSTORE; 576 if ("exception".equals(codeString)) 577 return IssueType.EXCEPTION; 578 if ("timeout".equals(codeString)) 579 return IssueType.TIMEOUT; 580 if ("throttled".equals(codeString)) 581 return IssueType.THROTTLED; 582 if ("informational".equals(codeString)) 583 return IssueType.INFORMATIONAL; 584 throw new IllegalArgumentException("Unknown IssueType code '"+codeString+"'"); 585 } 586 public Enumeration<IssueType> fromType(Base code) throws FHIRException { 587 if (code == null) 588 return null; 589 if (code.isEmpty()) 590 return new Enumeration<IssueType>(this); 591 String codeString = ((PrimitiveType) code).asStringValue(); 592 if (codeString == null || "".equals(codeString)) 593 return null; 594 if ("invalid".equals(codeString)) 595 return new Enumeration<IssueType>(this, IssueType.INVALID); 596 if ("structure".equals(codeString)) 597 return new Enumeration<IssueType>(this, IssueType.STRUCTURE); 598 if ("required".equals(codeString)) 599 return new Enumeration<IssueType>(this, IssueType.REQUIRED); 600 if ("value".equals(codeString)) 601 return new Enumeration<IssueType>(this, IssueType.VALUE); 602 if ("invariant".equals(codeString)) 603 return new Enumeration<IssueType>(this, IssueType.INVARIANT); 604 if ("security".equals(codeString)) 605 return new Enumeration<IssueType>(this, IssueType.SECURITY); 606 if ("login".equals(codeString)) 607 return new Enumeration<IssueType>(this, IssueType.LOGIN); 608 if ("unknown".equals(codeString)) 609 return new Enumeration<IssueType>(this, IssueType.UNKNOWN); 610 if ("expired".equals(codeString)) 611 return new Enumeration<IssueType>(this, IssueType.EXPIRED); 612 if ("forbidden".equals(codeString)) 613 return new Enumeration<IssueType>(this, IssueType.FORBIDDEN); 614 if ("suppressed".equals(codeString)) 615 return new Enumeration<IssueType>(this, IssueType.SUPPRESSED); 616 if ("processing".equals(codeString)) 617 return new Enumeration<IssueType>(this, IssueType.PROCESSING); 618 if ("not-supported".equals(codeString)) 619 return new Enumeration<IssueType>(this, IssueType.NOTSUPPORTED); 620 if ("duplicate".equals(codeString)) 621 return new Enumeration<IssueType>(this, IssueType.DUPLICATE); 622 if ("not-found".equals(codeString)) 623 return new Enumeration<IssueType>(this, IssueType.NOTFOUND); 624 if ("too-long".equals(codeString)) 625 return new Enumeration<IssueType>(this, IssueType.TOOLONG); 626 if ("code-invalid".equals(codeString)) 627 return new Enumeration<IssueType>(this, IssueType.CODEINVALID); 628 if ("extension".equals(codeString)) 629 return new Enumeration<IssueType>(this, IssueType.EXTENSION); 630 if ("too-costly".equals(codeString)) 631 return new Enumeration<IssueType>(this, IssueType.TOOCOSTLY); 632 if ("business-rule".equals(codeString)) 633 return new Enumeration<IssueType>(this, IssueType.BUSINESSRULE); 634 if ("conflict".equals(codeString)) 635 return new Enumeration<IssueType>(this, IssueType.CONFLICT); 636 if ("incomplete".equals(codeString)) 637 return new Enumeration<IssueType>(this, IssueType.INCOMPLETE); 638 if ("transient".equals(codeString)) 639 return new Enumeration<IssueType>(this, IssueType.TRANSIENT); 640 if ("lock-error".equals(codeString)) 641 return new Enumeration<IssueType>(this, IssueType.LOCKERROR); 642 if ("no-store".equals(codeString)) 643 return new Enumeration<IssueType>(this, IssueType.NOSTORE); 644 if ("exception".equals(codeString)) 645 return new Enumeration<IssueType>(this, IssueType.EXCEPTION); 646 if ("timeout".equals(codeString)) 647 return new Enumeration<IssueType>(this, IssueType.TIMEOUT); 648 if ("throttled".equals(codeString)) 649 return new Enumeration<IssueType>(this, IssueType.THROTTLED); 650 if ("informational".equals(codeString)) 651 return new Enumeration<IssueType>(this, IssueType.INFORMATIONAL); 652 throw new FHIRException("Unknown IssueType code '"+codeString+"'"); 653 } 654 public String toCode(IssueType code) { 655 if (code == IssueType.INVALID) 656 return "invalid"; 657 if (code == IssueType.STRUCTURE) 658 return "structure"; 659 if (code == IssueType.REQUIRED) 660 return "required"; 661 if (code == IssueType.VALUE) 662 return "value"; 663 if (code == IssueType.INVARIANT) 664 return "invariant"; 665 if (code == IssueType.SECURITY) 666 return "security"; 667 if (code == IssueType.LOGIN) 668 return "login"; 669 if (code == IssueType.UNKNOWN) 670 return "unknown"; 671 if (code == IssueType.EXPIRED) 672 return "expired"; 673 if (code == IssueType.FORBIDDEN) 674 return "forbidden"; 675 if (code == IssueType.SUPPRESSED) 676 return "suppressed"; 677 if (code == IssueType.PROCESSING) 678 return "processing"; 679 if (code == IssueType.NOTSUPPORTED) 680 return "not-supported"; 681 if (code == IssueType.DUPLICATE) 682 return "duplicate"; 683 if (code == IssueType.NOTFOUND) 684 return "not-found"; 685 if (code == IssueType.TOOLONG) 686 return "too-long"; 687 if (code == IssueType.CODEINVALID) 688 return "code-invalid"; 689 if (code == IssueType.EXTENSION) 690 return "extension"; 691 if (code == IssueType.TOOCOSTLY) 692 return "too-costly"; 693 if (code == IssueType.BUSINESSRULE) 694 return "business-rule"; 695 if (code == IssueType.CONFLICT) 696 return "conflict"; 697 if (code == IssueType.INCOMPLETE) 698 return "incomplete"; 699 if (code == IssueType.TRANSIENT) 700 return "transient"; 701 if (code == IssueType.LOCKERROR) 702 return "lock-error"; 703 if (code == IssueType.NOSTORE) 704 return "no-store"; 705 if (code == IssueType.EXCEPTION) 706 return "exception"; 707 if (code == IssueType.TIMEOUT) 708 return "timeout"; 709 if (code == IssueType.THROTTLED) 710 return "throttled"; 711 if (code == IssueType.INFORMATIONAL) 712 return "informational"; 713 return "?"; 714 } 715 public String toSystem(IssueType code) { 716 return code.getSystem(); 717 } 718 } 719 720 @Block() 721 public static class OperationOutcomeIssueComponent extends BackboneElement implements IBaseBackboneElement { 722 /** 723 * Indicates whether the issue indicates a variation from successful processing. 724 */ 725 @Child(name = "severity", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) 726 @Description(shortDefinition="fatal | error | warning | information", formalDefinition="Indicates whether the issue indicates a variation from successful processing." ) 727 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/issue-severity") 728 protected Enumeration<IssueSeverity> severity; 729 730 /** 731 * Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element. 732 */ 733 @Child(name = "code", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true) 734 @Description(shortDefinition="Error or warning code", formalDefinition="Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element." ) 735 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/issue-type") 736 protected Enumeration<IssueType> code; 737 738 /** 739 * Additional details about the error. This may be a text description of the error, or a system code that identifies the error. 740 */ 741 @Child(name = "details", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) 742 @Description(shortDefinition="Additional details about the error", formalDefinition="Additional details about the error. This may be a text description of the error, or a system code that identifies the error." ) 743 @ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/operation-outcome") 744 protected CodeableConcept details; 745 746 /** 747 * Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue. 748 */ 749 @Child(name = "diagnostics", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) 750 @Description(shortDefinition="Additional diagnostic information about the issue", formalDefinition="Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue." ) 751 protected StringType diagnostics; 752 753 /** 754 * For resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. For HTTP errors, will be "http." + the parameter name. 755 */ 756 @Child(name = "location", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 757 @Description(shortDefinition="Path of element(s) related to issue", formalDefinition="For resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. For HTTP errors, will be \"http.\" + the parameter name." ) 758 protected List<StringType> location; 759 760 /** 761 * A simple FHIRPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. 762 */ 763 @Child(name = "expression", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 764 @Description(shortDefinition="FHIRPath of element(s) related to issue", formalDefinition="A simple FHIRPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised." ) 765 protected List<StringType> expression; 766 767 private static final long serialVersionUID = -1681095438L; 768 769 /** 770 * Constructor 771 */ 772 public OperationOutcomeIssueComponent() { 773 super(); 774 } 775 776 /** 777 * Constructor 778 */ 779 public OperationOutcomeIssueComponent(Enumeration<IssueSeverity> severity, Enumeration<IssueType> code) { 780 super(); 781 this.severity = severity; 782 this.code = code; 783 } 784 785 /** 786 * @return {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value 787 */ 788 public Enumeration<IssueSeverity> getSeverityElement() { 789 if (this.severity == null) 790 if (Configuration.errorOnAutoCreate()) 791 throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.severity"); 792 else if (Configuration.doAutoCreate()) 793 this.severity = new Enumeration<IssueSeverity>(new IssueSeverityEnumFactory()); // bb 794 return this.severity; 795 } 796 797 public boolean hasSeverityElement() { 798 return this.severity != null && !this.severity.isEmpty(); 799 } 800 801 public boolean hasSeverity() { 802 return this.severity != null && !this.severity.isEmpty(); 803 } 804 805 /** 806 * @param value {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value 807 */ 808 public OperationOutcomeIssueComponent setSeverityElement(Enumeration<IssueSeverity> value) { 809 this.severity = value; 810 return this; 811 } 812 813 /** 814 * @return Indicates whether the issue indicates a variation from successful processing. 815 */ 816 public IssueSeverity getSeverity() { 817 return this.severity == null ? null : this.severity.getValue(); 818 } 819 820 /** 821 * @param value Indicates whether the issue indicates a variation from successful processing. 822 */ 823 public OperationOutcomeIssueComponent setSeverity(IssueSeverity value) { 824 if (this.severity == null) 825 this.severity = new Enumeration<IssueSeverity>(new IssueSeverityEnumFactory()); 826 this.severity.setValue(value); 827 return this; 828 } 829 830 /** 831 * @return {@link #code} (Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value 832 */ 833 public Enumeration<IssueType> getCodeElement() { 834 if (this.code == null) 835 if (Configuration.errorOnAutoCreate()) 836 throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.code"); 837 else if (Configuration.doAutoCreate()) 838 this.code = new Enumeration<IssueType>(new IssueTypeEnumFactory()); // bb 839 return this.code; 840 } 841 842 public boolean hasCodeElement() { 843 return this.code != null && !this.code.isEmpty(); 844 } 845 846 public boolean hasCode() { 847 return this.code != null && !this.code.isEmpty(); 848 } 849 850 /** 851 * @param value {@link #code} (Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value 852 */ 853 public OperationOutcomeIssueComponent setCodeElement(Enumeration<IssueType> value) { 854 this.code = value; 855 return this; 856 } 857 858 /** 859 * @return Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element. 860 */ 861 public IssueType getCode() { 862 return this.code == null ? null : this.code.getValue(); 863 } 864 865 /** 866 * @param value Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element. 867 */ 868 public OperationOutcomeIssueComponent setCode(IssueType value) { 869 if (this.code == null) 870 this.code = new Enumeration<IssueType>(new IssueTypeEnumFactory()); 871 this.code.setValue(value); 872 return this; 873 } 874 875 /** 876 * @return {@link #details} (Additional details about the error. This may be a text description of the error, or a system code that identifies the error.) 877 */ 878 public CodeableConcept getDetails() { 879 if (this.details == null) 880 if (Configuration.errorOnAutoCreate()) 881 throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.details"); 882 else if (Configuration.doAutoCreate()) 883 this.details = new CodeableConcept(); // cc 884 return this.details; 885 } 886 887 public boolean hasDetails() { 888 return this.details != null && !this.details.isEmpty(); 889 } 890 891 /** 892 * @param value {@link #details} (Additional details about the error. This may be a text description of the error, or a system code that identifies the error.) 893 */ 894 public OperationOutcomeIssueComponent setDetails(CodeableConcept value) { 895 this.details = value; 896 return this; 897 } 898 899 /** 900 * @return {@link #diagnostics} (Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue.). This is the underlying object with id, value and extensions. The accessor "getDiagnostics" gives direct access to the value 901 */ 902 public StringType getDiagnosticsElement() { 903 if (this.diagnostics == null) 904 if (Configuration.errorOnAutoCreate()) 905 throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.diagnostics"); 906 else if (Configuration.doAutoCreate()) 907 this.diagnostics = new StringType(); // bb 908 return this.diagnostics; 909 } 910 911 public boolean hasDiagnosticsElement() { 912 return this.diagnostics != null && !this.diagnostics.isEmpty(); 913 } 914 915 public boolean hasDiagnostics() { 916 return this.diagnostics != null && !this.diagnostics.isEmpty(); 917 } 918 919 /** 920 * @param value {@link #diagnostics} (Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue.). This is the underlying object with id, value and extensions. The accessor "getDiagnostics" gives direct access to the value 921 */ 922 public OperationOutcomeIssueComponent setDiagnosticsElement(StringType value) { 923 this.diagnostics = value; 924 return this; 925 } 926 927 /** 928 * @return Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue. 929 */ 930 public String getDiagnostics() { 931 return this.diagnostics == null ? null : this.diagnostics.getValue(); 932 } 933 934 /** 935 * @param value Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue. 936 */ 937 public OperationOutcomeIssueComponent setDiagnostics(String value) { 938 if (Utilities.noString(value)) 939 this.diagnostics = null; 940 else { 941 if (this.diagnostics == null) 942 this.diagnostics = new StringType(); 943 this.diagnostics.setValue(value); 944 } 945 return this; 946 } 947 948 /** 949 * @return {@link #location} (For resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. For HTTP errors, will be "http." + the parameter name.) 950 */ 951 public List<StringType> getLocation() { 952 if (this.location == null) 953 this.location = new ArrayList<StringType>(); 954 return this.location; 955 } 956 957 /** 958 * @return Returns a reference to <code>this</code> for easy method chaining 959 */ 960 public OperationOutcomeIssueComponent setLocation(List<StringType> theLocation) { 961 this.location = theLocation; 962 return this; 963 } 964 965 public boolean hasLocation() { 966 if (this.location == null) 967 return false; 968 for (StringType item : this.location) 969 if (!item.isEmpty()) 970 return true; 971 return false; 972 } 973 974 /** 975 * @return {@link #location} (For resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. For HTTP errors, will be "http." + the parameter name.) 976 */ 977 public StringType addLocationElement() {//2 978 StringType t = new StringType(); 979 if (this.location == null) 980 this.location = new ArrayList<StringType>(); 981 this.location.add(t); 982 return t; 983 } 984 985 /** 986 * @param value {@link #location} (For resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. For HTTP errors, will be "http." + the parameter name.) 987 */ 988 public OperationOutcomeIssueComponent addLocation(String value) { //1 989 StringType t = new StringType(); 990 t.setValue(value); 991 if (this.location == null) 992 this.location = new ArrayList<StringType>(); 993 this.location.add(t); 994 return this; 995 } 996 997 /** 998 * @param value {@link #location} (For resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. For HTTP errors, will be "http." + the parameter name.) 999 */ 1000 public boolean hasLocation(String value) { 1001 if (this.location == null) 1002 return false; 1003 for (StringType v : this.location) 1004 if (v.getValue().equals(value)) // string 1005 return true; 1006 return false; 1007 } 1008 1009 /** 1010 * @return {@link #expression} (A simple FHIRPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) 1011 */ 1012 public List<StringType> getExpression() { 1013 if (this.expression == null) 1014 this.expression = new ArrayList<StringType>(); 1015 return this.expression; 1016 } 1017 1018 /** 1019 * @return Returns a reference to <code>this</code> for easy method chaining 1020 */ 1021 public OperationOutcomeIssueComponent setExpression(List<StringType> theExpression) { 1022 this.expression = theExpression; 1023 return this; 1024 } 1025 1026 public boolean hasExpression() { 1027 if (this.expression == null) 1028 return false; 1029 for (StringType item : this.expression) 1030 if (!item.isEmpty()) 1031 return true; 1032 return false; 1033 } 1034 1035 /** 1036 * @return {@link #expression} (A simple FHIRPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) 1037 */ 1038 public StringType addExpressionElement() {//2 1039 StringType t = new StringType(); 1040 if (this.expression == null) 1041 this.expression = new ArrayList<StringType>(); 1042 this.expression.add(t); 1043 return t; 1044 } 1045 1046 /** 1047 * @param value {@link #expression} (A simple FHIRPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) 1048 */ 1049 public OperationOutcomeIssueComponent addExpression(String value) { //1 1050 StringType t = new StringType(); 1051 t.setValue(value); 1052 if (this.expression == null) 1053 this.expression = new ArrayList<StringType>(); 1054 this.expression.add(t); 1055 return this; 1056 } 1057 1058 /** 1059 * @param value {@link #expression} (A simple FHIRPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.) 1060 */ 1061 public boolean hasExpression(String value) { 1062 if (this.expression == null) 1063 return false; 1064 for (StringType v : this.expression) 1065 if (v.getValue().equals(value)) // string 1066 return true; 1067 return false; 1068 } 1069 1070 protected void listChildren(List<Property> children) { 1071 super.listChildren(children); 1072 children.add(new Property("severity", "code", "Indicates whether the issue indicates a variation from successful processing.", 0, 1, severity)); 1073 children.add(new Property("code", "code", "Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.", 0, 1, code)); 1074 children.add(new Property("details", "CodeableConcept", "Additional details about the error. This may be a text description of the error, or a system code that identifies the error.", 0, 1, details)); 1075 children.add(new Property("diagnostics", "string", "Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue.", 0, 1, diagnostics)); 1076 children.add(new Property("location", "string", "For resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. For HTTP errors, will be \"http.\" + the parameter name.", 0, java.lang.Integer.MAX_VALUE, location)); 1077 children.add(new Property("expression", "string", "A simple FHIRPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.", 0, java.lang.Integer.MAX_VALUE, expression)); 1078 } 1079 1080 @Override 1081 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1082 switch (_hash) { 1083 case 1478300413: /*severity*/ return new Property("severity", "code", "Indicates whether the issue indicates a variation from successful processing.", 0, 1, severity); 1084 case 3059181: /*code*/ return new Property("code", "code", "Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.", 0, 1, code); 1085 case 1557721666: /*details*/ return new Property("details", "CodeableConcept", "Additional details about the error. This may be a text description of the error, or a system code that identifies the error.", 0, 1, details); 1086 case -740386388: /*diagnostics*/ return new Property("diagnostics", "string", "Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue.", 0, 1, diagnostics); 1087 case 1901043637: /*location*/ return new Property("location", "string", "For resource issues, this will be a simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. For HTTP errors, will be \"http.\" + the parameter name.", 0, java.lang.Integer.MAX_VALUE, location); 1088 case -1795452264: /*expression*/ return new Property("expression", "string", "A simple FHIRPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised.", 0, java.lang.Integer.MAX_VALUE, expression); 1089 default: return super.getNamedProperty(_hash, _name, _checkValid); 1090 } 1091 1092 } 1093 1094 @Override 1095 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1096 switch (hash) { 1097 case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // Enumeration<IssueSeverity> 1098 case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration<IssueType> 1099 case 1557721666: /*details*/ return this.details == null ? new Base[0] : new Base[] {this.details}; // CodeableConcept 1100 case -740386388: /*diagnostics*/ return this.diagnostics == null ? new Base[0] : new Base[] {this.diagnostics}; // StringType 1101 case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // StringType 1102 case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : this.expression.toArray(new Base[this.expression.size()]); // StringType 1103 default: return super.getProperty(hash, name, checkValid); 1104 } 1105 1106 } 1107 1108 @Override 1109 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1110 switch (hash) { 1111 case 1478300413: // severity 1112 value = new IssueSeverityEnumFactory().fromType(castToCode(value)); 1113 this.severity = (Enumeration) value; // Enumeration<IssueSeverity> 1114 return value; 1115 case 3059181: // code 1116 value = new IssueTypeEnumFactory().fromType(castToCode(value)); 1117 this.code = (Enumeration) value; // Enumeration<IssueType> 1118 return value; 1119 case 1557721666: // details 1120 this.details = castToCodeableConcept(value); // CodeableConcept 1121 return value; 1122 case -740386388: // diagnostics 1123 this.diagnostics = castToString(value); // StringType 1124 return value; 1125 case 1901043637: // location 1126 this.getLocation().add(castToString(value)); // StringType 1127 return value; 1128 case -1795452264: // expression 1129 this.getExpression().add(castToString(value)); // StringType 1130 return value; 1131 default: return super.setProperty(hash, name, value); 1132 } 1133 1134 } 1135 1136 @Override 1137 public Base setProperty(String name, Base value) throws FHIRException { 1138 if (name.equals("severity")) { 1139 value = new IssueSeverityEnumFactory().fromType(castToCode(value)); 1140 this.severity = (Enumeration) value; // Enumeration<IssueSeverity> 1141 } else if (name.equals("code")) { 1142 value = new IssueTypeEnumFactory().fromType(castToCode(value)); 1143 this.code = (Enumeration) value; // Enumeration<IssueType> 1144 } else if (name.equals("details")) { 1145 this.details = castToCodeableConcept(value); // CodeableConcept 1146 } else if (name.equals("diagnostics")) { 1147 this.diagnostics = castToString(value); // StringType 1148 } else if (name.equals("location")) { 1149 this.getLocation().add(castToString(value)); 1150 } else if (name.equals("expression")) { 1151 this.getExpression().add(castToString(value)); 1152 } else 1153 return super.setProperty(name, value); 1154 return value; 1155 } 1156 1157 @Override 1158 public Base makeProperty(int hash, String name) throws FHIRException { 1159 switch (hash) { 1160 case 1478300413: return getSeverityElement(); 1161 case 3059181: return getCodeElement(); 1162 case 1557721666: return getDetails(); 1163 case -740386388: return getDiagnosticsElement(); 1164 case 1901043637: return addLocationElement(); 1165 case -1795452264: return addExpressionElement(); 1166 default: return super.makeProperty(hash, name); 1167 } 1168 1169 } 1170 1171 @Override 1172 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1173 switch (hash) { 1174 case 1478300413: /*severity*/ return new String[] {"code"}; 1175 case 3059181: /*code*/ return new String[] {"code"}; 1176 case 1557721666: /*details*/ return new String[] {"CodeableConcept"}; 1177 case -740386388: /*diagnostics*/ return new String[] {"string"}; 1178 case 1901043637: /*location*/ return new String[] {"string"}; 1179 case -1795452264: /*expression*/ return new String[] {"string"}; 1180 default: return super.getTypesForProperty(hash, name); 1181 } 1182 1183 } 1184 1185 @Override 1186 public Base addChild(String name) throws FHIRException { 1187 if (name.equals("severity")) { 1188 throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.severity"); 1189 } 1190 else if (name.equals("code")) { 1191 throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.code"); 1192 } 1193 else if (name.equals("details")) { 1194 this.details = new CodeableConcept(); 1195 return this.details; 1196 } 1197 else if (name.equals("diagnostics")) { 1198 throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.diagnostics"); 1199 } 1200 else if (name.equals("location")) { 1201 throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.location"); 1202 } 1203 else if (name.equals("expression")) { 1204 throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.expression"); 1205 } 1206 else 1207 return super.addChild(name); 1208 } 1209 1210 public OperationOutcomeIssueComponent copy() { 1211 OperationOutcomeIssueComponent dst = new OperationOutcomeIssueComponent(); 1212 copyValues(dst); 1213 dst.severity = severity == null ? null : severity.copy(); 1214 dst.code = code == null ? null : code.copy(); 1215 dst.details = details == null ? null : details.copy(); 1216 dst.diagnostics = diagnostics == null ? null : diagnostics.copy(); 1217 if (location != null) { 1218 dst.location = new ArrayList<StringType>(); 1219 for (StringType i : location) 1220 dst.location.add(i.copy()); 1221 }; 1222 if (expression != null) { 1223 dst.expression = new ArrayList<StringType>(); 1224 for (StringType i : expression) 1225 dst.expression.add(i.copy()); 1226 }; 1227 return dst; 1228 } 1229 1230 @Override 1231 public boolean equalsDeep(Base other_) { 1232 if (!super.equalsDeep(other_)) 1233 return false; 1234 if (!(other_ instanceof OperationOutcomeIssueComponent)) 1235 return false; 1236 OperationOutcomeIssueComponent o = (OperationOutcomeIssueComponent) other_; 1237 return compareDeep(severity, o.severity, true) && compareDeep(code, o.code, true) && compareDeep(details, o.details, true) 1238 && compareDeep(diagnostics, o.diagnostics, true) && compareDeep(location, o.location, true) && compareDeep(expression, o.expression, true) 1239 ; 1240 } 1241 1242 @Override 1243 public boolean equalsShallow(Base other_) { 1244 if (!super.equalsShallow(other_)) 1245 return false; 1246 if (!(other_ instanceof OperationOutcomeIssueComponent)) 1247 return false; 1248 OperationOutcomeIssueComponent o = (OperationOutcomeIssueComponent) other_; 1249 return compareValues(severity, o.severity, true) && compareValues(code, o.code, true) && compareValues(diagnostics, o.diagnostics, true) 1250 && compareValues(location, o.location, true) && compareValues(expression, o.expression, true); 1251 } 1252 1253 public boolean isEmpty() { 1254 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(severity, code, details 1255 , diagnostics, location, expression); 1256 } 1257 1258 public String fhirType() { 1259 return "OperationOutcome.issue"; 1260 1261 } 1262 1263 } 1264 1265 /** 1266 * An error, warning or information message that results from a system action. 1267 */ 1268 @Child(name = "issue", type = {}, order=0, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) 1269 @Description(shortDefinition="A single issue associated with the action", formalDefinition="An error, warning or information message that results from a system action." ) 1270 protected List<OperationOutcomeIssueComponent> issue; 1271 1272 private static final long serialVersionUID = -152150052L; 1273 1274 /** 1275 * Constructor 1276 */ 1277 public OperationOutcome() { 1278 super(); 1279 } 1280 1281 /** 1282 * @return {@link #issue} (An error, warning or information message that results from a system action.) 1283 */ 1284 public List<OperationOutcomeIssueComponent> getIssue() { 1285 if (this.issue == null) 1286 this.issue = new ArrayList<OperationOutcomeIssueComponent>(); 1287 return this.issue; 1288 } 1289 1290 /** 1291 * @return Returns a reference to <code>this</code> for easy method chaining 1292 */ 1293 public OperationOutcome setIssue(List<OperationOutcomeIssueComponent> theIssue) { 1294 this.issue = theIssue; 1295 return this; 1296 } 1297 1298 public boolean hasIssue() { 1299 if (this.issue == null) 1300 return false; 1301 for (OperationOutcomeIssueComponent item : this.issue) 1302 if (!item.isEmpty()) 1303 return true; 1304 return false; 1305 } 1306 1307 public OperationOutcomeIssueComponent addIssue() { //3 1308 OperationOutcomeIssueComponent t = new OperationOutcomeIssueComponent(); 1309 if (this.issue == null) 1310 this.issue = new ArrayList<OperationOutcomeIssueComponent>(); 1311 this.issue.add(t); 1312 return t; 1313 } 1314 1315 public OperationOutcome addIssue(OperationOutcomeIssueComponent t) { //3 1316 if (t == null) 1317 return this; 1318 if (this.issue == null) 1319 this.issue = new ArrayList<OperationOutcomeIssueComponent>(); 1320 this.issue.add(t); 1321 return this; 1322 } 1323 1324 /** 1325 * @return The first repetition of repeating field {@link #issue}, creating it if it does not already exist 1326 */ 1327 public OperationOutcomeIssueComponent getIssueFirstRep() { 1328 if (getIssue().isEmpty()) { 1329 addIssue(); 1330 } 1331 return getIssue().get(0); 1332 } 1333 1334 protected void listChildren(List<Property> children) { 1335 super.listChildren(children); 1336 children.add(new Property("issue", "", "An error, warning or information message that results from a system action.", 0, java.lang.Integer.MAX_VALUE, issue)); 1337 } 1338 1339 @Override 1340 public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException { 1341 switch (_hash) { 1342 case 100509913: /*issue*/ return new Property("issue", "", "An error, warning or information message that results from a system action.", 0, java.lang.Integer.MAX_VALUE, issue); 1343 default: return super.getNamedProperty(_hash, _name, _checkValid); 1344 } 1345 1346 } 1347 1348 @Override 1349 public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { 1350 switch (hash) { 1351 case 100509913: /*issue*/ return this.issue == null ? new Base[0] : this.issue.toArray(new Base[this.issue.size()]); // OperationOutcomeIssueComponent 1352 default: return super.getProperty(hash, name, checkValid); 1353 } 1354 1355 } 1356 1357 @Override 1358 public Base setProperty(int hash, String name, Base value) throws FHIRException { 1359 switch (hash) { 1360 case 100509913: // issue 1361 this.getIssue().add((OperationOutcomeIssueComponent) value); // OperationOutcomeIssueComponent 1362 return value; 1363 default: return super.setProperty(hash, name, value); 1364 } 1365 1366 } 1367 1368 @Override 1369 public Base setProperty(String name, Base value) throws FHIRException { 1370 if (name.equals("issue")) { 1371 this.getIssue().add((OperationOutcomeIssueComponent) value); 1372 } else 1373 return super.setProperty(name, value); 1374 return value; 1375 } 1376 1377 @Override 1378 public Base makeProperty(int hash, String name) throws FHIRException { 1379 switch (hash) { 1380 case 100509913: return addIssue(); 1381 default: return super.makeProperty(hash, name); 1382 } 1383 1384 } 1385 1386 @Override 1387 public String[] getTypesForProperty(int hash, String name) throws FHIRException { 1388 switch (hash) { 1389 case 100509913: /*issue*/ return new String[] {}; 1390 default: return super.getTypesForProperty(hash, name); 1391 } 1392 1393 } 1394 1395 @Override 1396 public Base addChild(String name) throws FHIRException { 1397 if (name.equals("issue")) { 1398 return addIssue(); 1399 } 1400 else 1401 return super.addChild(name); 1402 } 1403 1404 public String fhirType() { 1405 return "OperationOutcome"; 1406 1407 } 1408 1409 public OperationOutcome copy() { 1410 OperationOutcome dst = new OperationOutcome(); 1411 copyValues(dst); 1412 if (issue != null) { 1413 dst.issue = new ArrayList<OperationOutcomeIssueComponent>(); 1414 for (OperationOutcomeIssueComponent i : issue) 1415 dst.issue.add(i.copy()); 1416 }; 1417 return dst; 1418 } 1419 1420 protected OperationOutcome typedCopy() { 1421 return copy(); 1422 } 1423 1424 @Override 1425 public boolean equalsDeep(Base other_) { 1426 if (!super.equalsDeep(other_)) 1427 return false; 1428 if (!(other_ instanceof OperationOutcome)) 1429 return false; 1430 OperationOutcome o = (OperationOutcome) other_; 1431 return compareDeep(issue, o.issue, true); 1432 } 1433 1434 @Override 1435 public boolean equalsShallow(Base other_) { 1436 if (!super.equalsShallow(other_)) 1437 return false; 1438 if (!(other_ instanceof OperationOutcome)) 1439 return false; 1440 OperationOutcome o = (OperationOutcome) other_; 1441 return true; 1442 } 1443 1444 public boolean isEmpty() { 1445 return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(issue); 1446 } 1447 1448 @Override 1449 public ResourceType getResourceType() { 1450 return ResourceType.OperationOutcome; 1451 } 1452 1453 1454} 1455