001package org.hl7.fhir.r4.model.codesystems; 002 003/* 004 Copyright (c) 2011+, HL7, Inc. 005 All rights reserved. 006 007 Redistribution and use in source and binary forms, with or without modification, 008 are permitted provided that the following conditions are met: 009 010 * Redistributions of source code must retain the above copyright notice, this 011 list of conditions and the following disclaimer. 012 * Redistributions in binary form must reproduce the above copyright notice, 013 this list of conditions and the following disclaimer in the documentation 014 and/or other materials provided with the distribution. 015 * Neither the name of HL7 nor the names of its contributors may be used to 016 endorse or promote products derived from this software without specific 017 prior written permission. 018 019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 022 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 023 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 024 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 025 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 026 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 027 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 028 POSSIBILITY OF SUCH DAMAGE. 029 030*/ 031 032// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 033 034import org.hl7.fhir.exceptions.FHIRException; 035 036public enum RequestStatus { 037 038 /** 039 * The request has been created but is not yet complete or ready for action. 040 */ 041 DRAFT, 042 /** 043 * The request is in force and ready to be acted upon. 044 */ 045 ACTIVE, 046 /** 047 * The request (and any implicit authorization to act) has been temporarily 048 * withdrawn but is expected to resume in the future. 049 */ 050 ONHOLD, 051 /** 052 * The request (and any implicit authorization to act) has been terminated prior 053 * to the known full completion of the intended actions. No further activity 054 * should occur. 055 */ 056 REVOKED, 057 /** 058 * The activity described by the request has been fully performed. No further 059 * activity will occur. 060 */ 061 COMPLETED, 062 /** 063 * This request should never have existed and should be considered 'void'. (It 064 * is possible that real-world decisions were based on it. If real-world 065 * activity has occurred, the status should be "cancelled" rather than 066 * "entered-in-error".). 067 */ 068 ENTEREDINERROR, 069 /** 070 * The authoring/source system does not know which of the status values 071 * currently applies for this request. Note: This concept is not to be used for 072 * "other" - one of the listed statuses is presumed to apply, but the 073 * authoring/source system does not know which. 074 */ 075 UNKNOWN, 076 /** 077 * added to help the parsers 078 */ 079 NULL; 080 081 public static RequestStatus fromCode(String codeString) throws FHIRException { 082 if (codeString == null || "".equals(codeString)) 083 return null; 084 if ("draft".equals(codeString)) 085 return DRAFT; 086 if ("active".equals(codeString)) 087 return ACTIVE; 088 if ("on-hold".equals(codeString)) 089 return ONHOLD; 090 if ("revoked".equals(codeString)) 091 return REVOKED; 092 if ("completed".equals(codeString)) 093 return COMPLETED; 094 if ("entered-in-error".equals(codeString)) 095 return ENTEREDINERROR; 096 if ("unknown".equals(codeString)) 097 return UNKNOWN; 098 throw new FHIRException("Unknown RequestStatus code '" + codeString + "'"); 099 } 100 101 public String toCode() { 102 switch (this) { 103 case DRAFT: 104 return "draft"; 105 case ACTIVE: 106 return "active"; 107 case ONHOLD: 108 return "on-hold"; 109 case REVOKED: 110 return "revoked"; 111 case COMPLETED: 112 return "completed"; 113 case ENTEREDINERROR: 114 return "entered-in-error"; 115 case UNKNOWN: 116 return "unknown"; 117 case NULL: 118 return null; 119 default: 120 return "?"; 121 } 122 } 123 124 public String getSystem() { 125 return "http://hl7.org/fhir/request-status"; 126 } 127 128 public String getDefinition() { 129 switch (this) { 130 case DRAFT: 131 return "The request has been created but is not yet complete or ready for action."; 132 case ACTIVE: 133 return "The request is in force and ready to be acted upon."; 134 case ONHOLD: 135 return "The request (and any implicit authorization to act) has been temporarily withdrawn but is expected to resume in the future."; 136 case REVOKED: 137 return "The request (and any implicit authorization to act) has been terminated prior to the known full completion of the intended actions. No further activity should occur."; 138 case COMPLETED: 139 return "The activity described by the request has been fully performed. No further activity will occur."; 140 case ENTEREDINERROR: 141 return "This request should never have existed and should be considered 'void'. (It is possible that real-world decisions were based on it. If real-world activity has occurred, the status should be \"cancelled\" rather than \"entered-in-error\".)."; 142 case UNKNOWN: 143 return "The authoring/source system does not know which of the status values currently applies for this request. Note: This concept is not to be used for \"other\" - one of the listed statuses is presumed to apply, but the authoring/source system does not know which."; 144 case NULL: 145 return null; 146 default: 147 return "?"; 148 } 149 } 150 151 public String getDisplay() { 152 switch (this) { 153 case DRAFT: 154 return "Draft"; 155 case ACTIVE: 156 return "Active"; 157 case ONHOLD: 158 return "On Hold"; 159 case REVOKED: 160 return "Revoked"; 161 case COMPLETED: 162 return "Completed"; 163 case ENTEREDINERROR: 164 return "Entered in Error"; 165 case UNKNOWN: 166 return "Unknown"; 167 case NULL: 168 return null; 169 default: 170 return "?"; 171 } 172 } 173 174}