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