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