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