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 SupplyrequestStatus { 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 ready to be acted upon. 044 */ 045 ACTIVE, 046 /** 047 * The authorization/request to act has been temporarily withdrawn but is 048 * expected to resume in the future. 049 */ 050 SUSPENDED, 051 /** 052 * The authorization/request to act has been terminated prior to the full 053 * completion of the intended actions. No further activity should occur. 054 */ 055 CANCELLED, 056 /** 057 * Activity against the request has been sufficiently completed to the 058 * satisfaction of the requester. 059 */ 060 COMPLETED, 061 /** 062 * This electronic record should never have existed, though it is possible that 063 * real-world decisions were based on it. (If real-world activity has occurred, 064 * the status should be "cancelled" rather than "entered-in-error".). 065 */ 066 ENTEREDINERROR, 067 /** 068 * The authoring/source system does not know which of the status values 069 * currently applies for this observation. Note: This concept is not to be used 070 * for "other" - one of the listed statuses is presumed to apply, but the 071 * authoring/source system does not know which. 072 */ 073 UNKNOWN, 074 /** 075 * added to help the parsers 076 */ 077 NULL; 078 079 public static SupplyrequestStatus fromCode(String codeString) throws FHIRException { 080 if (codeString == null || "".equals(codeString)) 081 return null; 082 if ("draft".equals(codeString)) 083 return DRAFT; 084 if ("active".equals(codeString)) 085 return ACTIVE; 086 if ("suspended".equals(codeString)) 087 return SUSPENDED; 088 if ("cancelled".equals(codeString)) 089 return CANCELLED; 090 if ("completed".equals(codeString)) 091 return COMPLETED; 092 if ("entered-in-error".equals(codeString)) 093 return ENTEREDINERROR; 094 if ("unknown".equals(codeString)) 095 return UNKNOWN; 096 throw new FHIRException("Unknown SupplyrequestStatus code '" + codeString + "'"); 097 } 098 099 public String toCode() { 100 switch (this) { 101 case DRAFT: 102 return "draft"; 103 case ACTIVE: 104 return "active"; 105 case SUSPENDED: 106 return "suspended"; 107 case CANCELLED: 108 return "cancelled"; 109 case COMPLETED: 110 return "completed"; 111 case ENTEREDINERROR: 112 return "entered-in-error"; 113 case UNKNOWN: 114 return "unknown"; 115 case NULL: 116 return null; 117 default: 118 return "?"; 119 } 120 } 121 122 public String getSystem() { 123 return "http://hl7.org/fhir/supplyrequest-status"; 124 } 125 126 public String getDefinition() { 127 switch (this) { 128 case DRAFT: 129 return "The request has been created but is not yet complete or ready for action."; 130 case ACTIVE: 131 return "The request is ready to be acted upon."; 132 case SUSPENDED: 133 return "The authorization/request to act has been temporarily withdrawn but is expected to resume in the future."; 134 case CANCELLED: 135 return "The authorization/request to act has been terminated prior to the full completion of the intended actions. No further activity should occur."; 136 case COMPLETED: 137 return "Activity against the request has been sufficiently completed to the satisfaction of the requester."; 138 case ENTEREDINERROR: 139 return "This electronic record should never have existed, though 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\".)."; 140 case UNKNOWN: 141 return "The authoring/source system does not know which of the status values currently applies for this observation. 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."; 142 case NULL: 143 return null; 144 default: 145 return "?"; 146 } 147 } 148 149 public String getDisplay() { 150 switch (this) { 151 case DRAFT: 152 return "Draft"; 153 case ACTIVE: 154 return "Active"; 155 case SUSPENDED: 156 return "Suspended"; 157 case CANCELLED: 158 return "Cancelled"; 159 case COMPLETED: 160 return "Completed"; 161 case ENTEREDINERROR: 162 return "Entered in Error"; 163 case UNKNOWN: 164 return "Unknown"; 165 case NULL: 166 return null; 167 default: 168 return "?"; 169 } 170 } 171 172}