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 V3NullFlavor {
059
060        /**
061         * Description:The value is exceptional (missing, omitted, incomplete, improper). No information as to the reason for being an exceptional value is provided. This is the most general exceptional value. It is also the default exceptional value.
062         */
063        NI, 
064        /**
065         * Description:The value as represented in the instance is not a member of the set of permitted data values in the constrained value domain of a variable.
066         */
067        INV, 
068        /**
069         * Description:An actual value may exist, but it must be derived from the provided information (usually an EXPR generic data type extension will be used to convey the derivation expressionexpression .
070         */
071        DER, 
072        /**
073         * Description:The actual value is not a member of the set of permitted data values in the constrained value domain of a variable. (e.g., concept not provided by required code system).
074
075                        
076                           Usage Notes: This flavor and its specializations are most commonly used with the CD datatype and its flavors.  However, it may apply to *any* datatype where the constraints of the type are tighter than can be conveyed.  For example, a PQ that is for a true measured amount whose units are not supported in UCUM, a need to convey a REAL when the type has been constrained to INT, etc.
077
078                        With coded datatypes, this null flavor may only be used if the vocabulary binding has a coding strength of CNE.  By definition, all local codes and original text are part of the value set if the coding strength is CWE.
079         */
080        OTH, 
081        /**
082         * Negative infinity of numbers.
083         */
084        NINF, 
085        /**
086         * Positive infinity of numbers.
087         */
088        PINF, 
089        /**
090         * Description: The actual value has not yet been encoded within the approved value domain.
091
092                        
093                           Example: Original text or a local code has been specified but translation or encoding to the approved value set has not yet occurred due to limitations of the sending system.  Original text has been captured for a PQ, but not attempt has been made to split the value and unit or to encode the unit in UCUM.
094
095                        
096                           Usage Notes: If it is known that it is not possible to encode the concept, OTH should be used instead.  However, use of UNC does not necessarily guarantee the concept will be encodable, only that encoding has not been attempted.
097
098                        Data type properties such as original text and translations may be present when this null flavor is included.
099         */
100        UNC, 
101        /**
102         * There is information on this item available but it has not been provided by the sender due to security, privacy or other reasons. There may be an alternate mechanism for gaining access to this information.
103
104                        Note: using this null flavor does provide information that may be a breach of confidentiality, even though no detail data is provided.  Its primary purpose is for those circumstances where it is necessary to inform the receiver that the information does exist without providing any detail.
105         */
106        MSK, 
107        /**
108         * Known to have no proper value (e.g., last menstrual period for a male).
109         */
110        NA, 
111        /**
112         * Description:A proper value is applicable, but not known.
113
114                        
115                           Usage Notes: This means the actual value is not known.  If the only thing that is unknown is how to properly express the value in the necessary constraints (value set, datatype, etc.), then the OTH or UNC flavor should be used.  No properties should be included for a datatype with this property unless:
116
117                        
118                           Those properties themselves directly translate to a semantic of "unknown".  (E.g. a local code sent as a translation that conveys 'unknown')
119                           Those properties further qualify the nature of what is unknown.  (E.g. specifying a use code of "H" and a URL prefix of "tel:" to convey that it is the home phone number that is unknown.)
120         */
121        UNK, 
122        /**
123         * Information was sought but not found (e.g., patient was asked but didn't know)
124         */
125        ASKU, 
126        /**
127         * Information is not available at this time but it is expected that it will be available later.
128         */
129        NAV, 
130        /**
131         * This information has not been sought (e.g., patient was not asked)
132         */
133        NASK, 
134        /**
135         * Information is not available at this time (with no expectation regarding whether it will or will not be available in the future).
136         */
137        NAVU, 
138        /**
139         * Description:The specific quantity is not known, but is known to be non-zero and is not specified because it makes up the bulk of the material. e.g. 'Add 10mg of ingredient X, 50mg of ingredient Y, and sufficient quantity of water to 100mL.' The null flavor would be used to express the quantity of water.
140         */
141        QS, 
142        /**
143         * The content is greater than zero, but too small to be quantified.
144         */
145        TRC, 
146        /**
147         * Value is not present in a message.  This is only defined in messages, never in application data!  All values not present in the message must be replaced by the applicable default, or no-information (NI) as the default of all defaults.
148         */
149        NP, 
150        /**
151         * added to help the parsers
152         */
153        NULL;
154        public static V3NullFlavor fromCode(String codeString) throws FHIRException {
155            if (codeString == null || "".equals(codeString))
156                return null;
157        if ("NI".equals(codeString))
158          return NI;
159        if ("INV".equals(codeString))
160          return INV;
161        if ("DER".equals(codeString))
162          return DER;
163        if ("OTH".equals(codeString))
164          return OTH;
165        if ("NINF".equals(codeString))
166          return NINF;
167        if ("PINF".equals(codeString))
168          return PINF;
169        if ("UNC".equals(codeString))
170          return UNC;
171        if ("MSK".equals(codeString))
172          return MSK;
173        if ("NA".equals(codeString))
174          return NA;
175        if ("UNK".equals(codeString))
176          return UNK;
177        if ("ASKU".equals(codeString))
178          return ASKU;
179        if ("NAV".equals(codeString))
180          return NAV;
181        if ("NASK".equals(codeString))
182          return NASK;
183        if ("NAVU".equals(codeString))
184          return NAVU;
185        if ("QS".equals(codeString))
186          return QS;
187        if ("TRC".equals(codeString))
188          return TRC;
189        if ("NP".equals(codeString))
190          return NP;
191        throw new FHIRException("Unknown V3NullFlavor code '"+codeString+"'");
192        }
193        public String toCode() {
194          switch (this) {
195            case NI: return "NI";
196            case INV: return "INV";
197            case DER: return "DER";
198            case OTH: return "OTH";
199            case NINF: return "NINF";
200            case PINF: return "PINF";
201            case UNC: return "UNC";
202            case MSK: return "MSK";
203            case NA: return "NA";
204            case UNK: return "UNK";
205            case ASKU: return "ASKU";
206            case NAV: return "NAV";
207            case NASK: return "NASK";
208            case NAVU: return "NAVU";
209            case QS: return "QS";
210            case TRC: return "TRC";
211            case NP: return "NP";
212            default: return "?";
213          }
214        }
215        public String getSystem() {
216          return "http://terminology.hl7.org/CodeSystem/v3-NullFlavor";
217        }
218        public String getDefinition() {
219          switch (this) {
220            case NI: return "Description:The value is exceptional (missing, omitted, incomplete, improper). No information as to the reason for being an exceptional value is provided. This is the most general exceptional value. It is also the default exceptional value.";
221            case INV: return "Description:The value as represented in the instance is not a member of the set of permitted data values in the constrained value domain of a variable.";
222            case DER: return "Description:An actual value may exist, but it must be derived from the provided information (usually an EXPR generic data type extension will be used to convey the derivation expressionexpression .";
223            case OTH: return "Description:The actual value is not a member of the set of permitted data values in the constrained value domain of a variable. (e.g., concept not provided by required code system).\r\n\n                        \n                           Usage Notes: This flavor and its specializations are most commonly used with the CD datatype and its flavors.  However, it may apply to *any* datatype where the constraints of the type are tighter than can be conveyed.  For example, a PQ that is for a true measured amount whose units are not supported in UCUM, a need to convey a REAL when the type has been constrained to INT, etc.\r\n\n                        With coded datatypes, this null flavor may only be used if the vocabulary binding has a coding strength of CNE.  By definition, all local codes and original text are part of the value set if the coding strength is CWE.";
224            case NINF: return "Negative infinity of numbers.";
225            case PINF: return "Positive infinity of numbers.";
226            case UNC: return "Description: The actual value has not yet been encoded within the approved value domain.\r\n\n                        \n                           Example: Original text or a local code has been specified but translation or encoding to the approved value set has not yet occurred due to limitations of the sending system.  Original text has been captured for a PQ, but not attempt has been made to split the value and unit or to encode the unit in UCUM.\r\n\n                        \n                           Usage Notes: If it is known that it is not possible to encode the concept, OTH should be used instead.  However, use of UNC does not necessarily guarantee the concept will be encodable, only that encoding has not been attempted.\r\n\n                        Data type properties such as original text and translations may be present when this null flavor is included.";
227            case MSK: return "There is information on this item available but it has not been provided by the sender due to security, privacy or other reasons. There may be an alternate mechanism for gaining access to this information.\r\n\n                        Note: using this null flavor does provide information that may be a breach of confidentiality, even though no detail data is provided.  Its primary purpose is for those circumstances where it is necessary to inform the receiver that the information does exist without providing any detail.";
228            case NA: return "Known to have no proper value (e.g., last menstrual period for a male).";
229            case UNK: return "Description:A proper value is applicable, but not known.\r\n\n                        \n                           Usage Notes: This means the actual value is not known.  If the only thing that is unknown is how to properly express the value in the necessary constraints (value set, datatype, etc.), then the OTH or UNC flavor should be used.  No properties should be included for a datatype with this property unless:\r\n\n                        \n                           Those properties themselves directly translate to a semantic of \"unknown\".  (E.g. a local code sent as a translation that conveys 'unknown')\n                           Those properties further qualify the nature of what is unknown.  (E.g. specifying a use code of \"H\" and a URL prefix of \"tel:\" to convey that it is the home phone number that is unknown.)";
230            case ASKU: return "Information was sought but not found (e.g., patient was asked but didn't know)";
231            case NAV: return "Information is not available at this time but it is expected that it will be available later.";
232            case NASK: return "This information has not been sought (e.g., patient was not asked)";
233            case NAVU: return "Information is not available at this time (with no expectation regarding whether it will or will not be available in the future).";
234            case QS: return "Description:The specific quantity is not known, but is known to be non-zero and is not specified because it makes up the bulk of the material. e.g. 'Add 10mg of ingredient X, 50mg of ingredient Y, and sufficient quantity of water to 100mL.' The null flavor would be used to express the quantity of water.";
235            case TRC: return "The content is greater than zero, but too small to be quantified.";
236            case NP: return "Value is not present in a message.  This is only defined in messages, never in application data!  All values not present in the message must be replaced by the applicable default, or no-information (NI) as the default of all defaults.";
237            default: return "?";
238          }
239        }
240        public String getDisplay() {
241          switch (this) {
242            case NI: return "NoInformation";
243            case INV: return "invalid";
244            case DER: return "derived";
245            case OTH: return "other";
246            case NINF: return "negative infinity";
247            case PINF: return "positive infinity";
248            case UNC: return "un-encoded";
249            case MSK: return "masked";
250            case NA: return "not applicable";
251            case UNK: return "unknown";
252            case ASKU: return "asked but unknown";
253            case NAV: return "temporarily unavailable";
254            case NASK: return "not asked";
255            case NAVU: return "Not available";
256            case QS: return "Sufficient Quantity";
257            case TRC: return "trace";
258            case NP: return "not present";
259            default: return "?";
260          }
261    }
262
263
264}
265