001package org.hl7.fhir.r4.model.codesystems; 002 003/*- 004 * #%L 005 * org.hl7.fhir.r4 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, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 054 055 056import org.hl7.fhir.exceptions.FHIRException; 057 058public enum DataAbsentReason { 059 060 /** 061 * The value is expected to exist but is not known. 062 */ 063 UNKNOWN, 064 /** 065 * The source was asked but does not know the value. 066 */ 067 ASKEDUNKNOWN, 068 /** 069 * There is reason to expect (from the workflow) that the value may become known. 070 */ 071 TEMPUNKNOWN, 072 /** 073 * The workflow didn't lead to this value being known. 074 */ 075 NOTASKED, 076 /** 077 * The source was asked but declined to answer. 078 */ 079 ASKEDDECLINED, 080 /** 081 * The information is not available due to security, privacy or related reasons. 082 */ 083 MASKED, 084 /** 085 * There is no proper value for this element (e.g. last menstrual period for a male). 086 */ 087 NOTAPPLICABLE, 088 /** 089 * The source system wasn't capable of supporting this element. 090 */ 091 UNSUPPORTED, 092 /** 093 * The content of the data is represented in the resource narrative. 094 */ 095 ASTEXT, 096 /** 097 * Some system or workflow process error means that the information is not available. 098 */ 099 ERROR, 100 /** 101 * The numeric value is undefined or unrepresentable due to a floating point processing error. 102 */ 103 NOTANUMBER, 104 /** 105 * The numeric value is excessively low and unrepresentable due to a floating point processing error. 106 */ 107 NEGATIVEINFINITY, 108 /** 109 * The numeric value is excessively high and unrepresentable due to a floating point processing error. 110 */ 111 POSITIVEINFINITY, 112 /** 113 * The value is not available because the observation procedure (test, etc.) was not performed. 114 */ 115 NOTPERFORMED, 116 /** 117 * The value is not permitted in this context (e.g. due to profiles, or the base data types). 118 */ 119 NOTPERMITTED, 120 /** 121 * added to help the parsers 122 */ 123 NULL; 124 public static DataAbsentReason fromCode(String codeString) throws FHIRException { 125 if (codeString == null || "".equals(codeString)) 126 return null; 127 if ("unknown".equals(codeString)) 128 return UNKNOWN; 129 if ("asked-unknown".equals(codeString)) 130 return ASKEDUNKNOWN; 131 if ("temp-unknown".equals(codeString)) 132 return TEMPUNKNOWN; 133 if ("not-asked".equals(codeString)) 134 return NOTASKED; 135 if ("asked-declined".equals(codeString)) 136 return ASKEDDECLINED; 137 if ("masked".equals(codeString)) 138 return MASKED; 139 if ("not-applicable".equals(codeString)) 140 return NOTAPPLICABLE; 141 if ("unsupported".equals(codeString)) 142 return UNSUPPORTED; 143 if ("as-text".equals(codeString)) 144 return ASTEXT; 145 if ("error".equals(codeString)) 146 return ERROR; 147 if ("not-a-number".equals(codeString)) 148 return NOTANUMBER; 149 if ("negative-infinity".equals(codeString)) 150 return NEGATIVEINFINITY; 151 if ("positive-infinity".equals(codeString)) 152 return POSITIVEINFINITY; 153 if ("not-performed".equals(codeString)) 154 return NOTPERFORMED; 155 if ("not-permitted".equals(codeString)) 156 return NOTPERMITTED; 157 throw new FHIRException("Unknown DataAbsentReason code '"+codeString+"'"); 158 } 159 public String toCode() { 160 switch (this) { 161 case UNKNOWN: return "unknown"; 162 case ASKEDUNKNOWN: return "asked-unknown"; 163 case TEMPUNKNOWN: return "temp-unknown"; 164 case NOTASKED: return "not-asked"; 165 case ASKEDDECLINED: return "asked-declined"; 166 case MASKED: return "masked"; 167 case NOTAPPLICABLE: return "not-applicable"; 168 case UNSUPPORTED: return "unsupported"; 169 case ASTEXT: return "as-text"; 170 case ERROR: return "error"; 171 case NOTANUMBER: return "not-a-number"; 172 case NEGATIVEINFINITY: return "negative-infinity"; 173 case POSITIVEINFINITY: return "positive-infinity"; 174 case NOTPERFORMED: return "not-performed"; 175 case NOTPERMITTED: return "not-permitted"; 176 default: return "?"; 177 } 178 } 179 public String getSystem() { 180 return "http://terminology.hl7.org/CodeSystem/data-absent-reason"; 181 } 182 public String getDefinition() { 183 switch (this) { 184 case UNKNOWN: return "The value is expected to exist but is not known."; 185 case ASKEDUNKNOWN: return "The source was asked but does not know the value."; 186 case TEMPUNKNOWN: return "There is reason to expect (from the workflow) that the value may become known."; 187 case NOTASKED: return "The workflow didn't lead to this value being known."; 188 case ASKEDDECLINED: return "The source was asked but declined to answer."; 189 case MASKED: return "The information is not available due to security, privacy or related reasons."; 190 case NOTAPPLICABLE: return "There is no proper value for this element (e.g. last menstrual period for a male)."; 191 case UNSUPPORTED: return "The source system wasn't capable of supporting this element."; 192 case ASTEXT: return "The content of the data is represented in the resource narrative."; 193 case ERROR: return "Some system or workflow process error means that the information is not available."; 194 case NOTANUMBER: return "The numeric value is undefined or unrepresentable due to a floating point processing error."; 195 case NEGATIVEINFINITY: return "The numeric value is excessively low and unrepresentable due to a floating point processing error."; 196 case POSITIVEINFINITY: return "The numeric value is excessively high and unrepresentable due to a floating point processing error."; 197 case NOTPERFORMED: return "The value is not available because the observation procedure (test, etc.) was not performed."; 198 case NOTPERMITTED: return "The value is not permitted in this context (e.g. due to profiles, or the base data types)."; 199 default: return "?"; 200 } 201 } 202 public String getDisplay() { 203 switch (this) { 204 case UNKNOWN: return "Unknown"; 205 case ASKEDUNKNOWN: return "Asked But Unknown"; 206 case TEMPUNKNOWN: return "Temporarily Unknown"; 207 case NOTASKED: return "Not Asked"; 208 case ASKEDDECLINED: return "Asked But Declined"; 209 case MASKED: return "Masked"; 210 case NOTAPPLICABLE: return "Not Applicable"; 211 case UNSUPPORTED: return "Unsupported"; 212 case ASTEXT: return "As Text"; 213 case ERROR: return "Error"; 214 case NOTANUMBER: return "Not a Number (NaN)"; 215 case NEGATIVEINFINITY: return "Negative Infinity (NINF)"; 216 case POSITIVEINFINITY: return "Positive Infinity (PINF)"; 217 case NOTPERFORMED: return "Not Performed"; 218 case NOTPERMITTED: return "Not Permitted"; 219 default: return "?"; 220 } 221 } 222 223 224} 225