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 V3Charset { 038 039 /** 040 * HL7 is indifferent to the use of this Charset. 041 */ 042 EBCDIC, 043 /** 044 * Deprecated for HL7 use. 045 */ 046 ISO10646UCS2, 047 /** 048 * Deprecated for HL7 use. 049 */ 050 ISO10646UCS4, 051 /** 052 * HL7 is indifferent to the use of this Charset. 053 */ 054 ISO88591, 055 /** 056 * HL7 is indifferent to the use of this Charset. 057 */ 058 ISO88592, 059 /** 060 * HL7 is indifferent to the use of this Charset. 061 */ 062 ISO88595, 063 /** 064 * HL7 is indifferent to the use of this Charset. 065 */ 066 JIS2022JP, 067 /** 068 * Required for HL7 use. 069 */ 070 USASCII, 071 /** 072 * HL7 is indifferent to the use of this Charset. 073 */ 074 UTF7, 075 /** 076 * Required for Unicode support. 077 */ 078 UTF8, 079 /** 080 * added to help the parsers 081 */ 082 NULL; 083 public static V3Charset fromCode(String codeString) throws FHIRException { 084 if (codeString == null || "".equals(codeString)) 085 return null; 086 if ("EBCDIC".equals(codeString)) 087 return EBCDIC; 088 if ("ISO-10646-UCS-2".equals(codeString)) 089 return ISO10646UCS2; 090 if ("ISO-10646-UCS-4".equals(codeString)) 091 return ISO10646UCS4; 092 if ("ISO-8859-1".equals(codeString)) 093 return ISO88591; 094 if ("ISO-8859-2".equals(codeString)) 095 return ISO88592; 096 if ("ISO-8859-5".equals(codeString)) 097 return ISO88595; 098 if ("JIS-2022-JP".equals(codeString)) 099 return JIS2022JP; 100 if ("US-ASCII".equals(codeString)) 101 return USASCII; 102 if ("UTF-7".equals(codeString)) 103 return UTF7; 104 if ("UTF-8".equals(codeString)) 105 return UTF8; 106 throw new FHIRException("Unknown V3Charset code '"+codeString+"'"); 107 } 108 public String toCode() { 109 switch (this) { 110 case EBCDIC: return "EBCDIC"; 111 case ISO10646UCS2: return "ISO-10646-UCS-2"; 112 case ISO10646UCS4: return "ISO-10646-UCS-4"; 113 case ISO88591: return "ISO-8859-1"; 114 case ISO88592: return "ISO-8859-2"; 115 case ISO88595: return "ISO-8859-5"; 116 case JIS2022JP: return "JIS-2022-JP"; 117 case USASCII: return "US-ASCII"; 118 case UTF7: return "UTF-7"; 119 case UTF8: return "UTF-8"; 120 default: return "?"; 121 } 122 } 123 public String getSystem() { 124 return "http://hl7.org/fhir/v3/Charset"; 125 } 126 public String getDefinition() { 127 switch (this) { 128 case EBCDIC: return "HL7 is indifferent to the use of this Charset."; 129 case ISO10646UCS2: return "Deprecated for HL7 use."; 130 case ISO10646UCS4: return "Deprecated for HL7 use."; 131 case ISO88591: return "HL7 is indifferent to the use of this Charset."; 132 case ISO88592: return "HL7 is indifferent to the use of this Charset."; 133 case ISO88595: return "HL7 is indifferent to the use of this Charset."; 134 case JIS2022JP: return "HL7 is indifferent to the use of this Charset."; 135 case USASCII: return "Required for HL7 use."; 136 case UTF7: return "HL7 is indifferent to the use of this Charset."; 137 case UTF8: return "Required for Unicode support."; 138 default: return "?"; 139 } 140 } 141 public String getDisplay() { 142 switch (this) { 143 case EBCDIC: return "EBCDIC"; 144 case ISO10646UCS2: return "ISO-10646-UCS-2"; 145 case ISO10646UCS4: return "ISO-10646-UCS-4"; 146 case ISO88591: return "ISO-8859-1"; 147 case ISO88592: return "ISO-8859-2"; 148 case ISO88595: return "ISO-8859-5"; 149 case JIS2022JP: return "JIS-2022-JP"; 150 case USASCII: return "US-ASCII"; 151 case UTF7: return "UTF-7"; 152 case UTF8: return "UTF-8"; 153 default: return "?"; 154 } 155 } 156 157 158} 159