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 Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 033 034import org.hl7.fhir.r4.model.EnumFactory; 035 036public class V3EthnicityEnumFactory implements EnumFactory<V3Ethnicity> { 037 038 public V3Ethnicity fromCode(String codeString) throws IllegalArgumentException { 039 if (codeString == null || "".equals(codeString)) 040 return null; 041 if ("2135-2".equals(codeString)) 042 return V3Ethnicity._21352; 043 if ("2137-8".equals(codeString)) 044 return V3Ethnicity._21378; 045 if ("2138-6".equals(codeString)) 046 return V3Ethnicity._21386; 047 if ("2139-4".equals(codeString)) 048 return V3Ethnicity._21394; 049 if ("2140-2".equals(codeString)) 050 return V3Ethnicity._21402; 051 if ("2141-0".equals(codeString)) 052 return V3Ethnicity._21410; 053 if ("2142-8".equals(codeString)) 054 return V3Ethnicity._21428; 055 if ("2143-6".equals(codeString)) 056 return V3Ethnicity._21436; 057 if ("2144-4".equals(codeString)) 058 return V3Ethnicity._21444; 059 if ("2145-1".equals(codeString)) 060 return V3Ethnicity._21451; 061 if ("2146-9".equals(codeString)) 062 return V3Ethnicity._21469; 063 if ("2148-5".equals(codeString)) 064 return V3Ethnicity._21485; 065 if ("2149-3".equals(codeString)) 066 return V3Ethnicity._21493; 067 if ("2150-1".equals(codeString)) 068 return V3Ethnicity._21501; 069 if ("2151-9".equals(codeString)) 070 return V3Ethnicity._21519; 071 if ("2152-7".equals(codeString)) 072 return V3Ethnicity._21527; 073 if ("2153-5".equals(codeString)) 074 return V3Ethnicity._21535; 075 if ("2155-0".equals(codeString)) 076 return V3Ethnicity._21550; 077 if ("2156-8".equals(codeString)) 078 return V3Ethnicity._21568; 079 if ("2157-6".equals(codeString)) 080 return V3Ethnicity._21576; 081 if ("2158-4".equals(codeString)) 082 return V3Ethnicity._21584; 083 if ("2159-2".equals(codeString)) 084 return V3Ethnicity._21592; 085 if ("2160-0".equals(codeString)) 086 return V3Ethnicity._21600; 087 if ("2161-8".equals(codeString)) 088 return V3Ethnicity._21618; 089 if ("2162-6".equals(codeString)) 090 return V3Ethnicity._21626; 091 if ("2163-4".equals(codeString)) 092 return V3Ethnicity._21634; 093 if ("2165-9".equals(codeString)) 094 return V3Ethnicity._21659; 095 if ("2166-7".equals(codeString)) 096 return V3Ethnicity._21667; 097 if ("2167-5".equals(codeString)) 098 return V3Ethnicity._21675; 099 if ("2168-3".equals(codeString)) 100 return V3Ethnicity._21683; 101 if ("2169-1".equals(codeString)) 102 return V3Ethnicity._21691; 103 if ("2170-9".equals(codeString)) 104 return V3Ethnicity._21709; 105 if ("2171-7".equals(codeString)) 106 return V3Ethnicity._21717; 107 if ("2172-5".equals(codeString)) 108 return V3Ethnicity._21725; 109 if ("2173-3".equals(codeString)) 110 return V3Ethnicity._21733; 111 if ("2174-1".equals(codeString)) 112 return V3Ethnicity._21741; 113 if ("2175-8".equals(codeString)) 114 return V3Ethnicity._21758; 115 if ("2176-6".equals(codeString)) 116 return V3Ethnicity._21766; 117 if ("2178-2".equals(codeString)) 118 return V3Ethnicity._21782; 119 if ("2180-8".equals(codeString)) 120 return V3Ethnicity._21808; 121 if ("2182-4".equals(codeString)) 122 return V3Ethnicity._21824; 123 if ("2184-0".equals(codeString)) 124 return V3Ethnicity._21840; 125 if ("2186-5".equals(codeString)) 126 return V3Ethnicity._21865; 127 throw new IllegalArgumentException("Unknown V3Ethnicity code '" + codeString + "'"); 128 } 129 130 public String toCode(V3Ethnicity code) { 131 if (code == V3Ethnicity.NULL) 132 return null; 133 if (code == V3Ethnicity._21352) 134 return "2135-2"; 135 if (code == V3Ethnicity._21378) 136 return "2137-8"; 137 if (code == V3Ethnicity._21386) 138 return "2138-6"; 139 if (code == V3Ethnicity._21394) 140 return "2139-4"; 141 if (code == V3Ethnicity._21402) 142 return "2140-2"; 143 if (code == V3Ethnicity._21410) 144 return "2141-0"; 145 if (code == V3Ethnicity._21428) 146 return "2142-8"; 147 if (code == V3Ethnicity._21436) 148 return "2143-6"; 149 if (code == V3Ethnicity._21444) 150 return "2144-4"; 151 if (code == V3Ethnicity._21451) 152 return "2145-1"; 153 if (code == V3Ethnicity._21469) 154 return "2146-9"; 155 if (code == V3Ethnicity._21485) 156 return "2148-5"; 157 if (code == V3Ethnicity._21493) 158 return "2149-3"; 159 if (code == V3Ethnicity._21501) 160 return "2150-1"; 161 if (code == V3Ethnicity._21519) 162 return "2151-9"; 163 if (code == V3Ethnicity._21527) 164 return "2152-7"; 165 if (code == V3Ethnicity._21535) 166 return "2153-5"; 167 if (code == V3Ethnicity._21550) 168 return "2155-0"; 169 if (code == V3Ethnicity._21568) 170 return "2156-8"; 171 if (code == V3Ethnicity._21576) 172 return "2157-6"; 173 if (code == V3Ethnicity._21584) 174 return "2158-4"; 175 if (code == V3Ethnicity._21592) 176 return "2159-2"; 177 if (code == V3Ethnicity._21600) 178 return "2160-0"; 179 if (code == V3Ethnicity._21618) 180 return "2161-8"; 181 if (code == V3Ethnicity._21626) 182 return "2162-6"; 183 if (code == V3Ethnicity._21634) 184 return "2163-4"; 185 if (code == V3Ethnicity._21659) 186 return "2165-9"; 187 if (code == V3Ethnicity._21667) 188 return "2166-7"; 189 if (code == V3Ethnicity._21675) 190 return "2167-5"; 191 if (code == V3Ethnicity._21683) 192 return "2168-3"; 193 if (code == V3Ethnicity._21691) 194 return "2169-1"; 195 if (code == V3Ethnicity._21709) 196 return "2170-9"; 197 if (code == V3Ethnicity._21717) 198 return "2171-7"; 199 if (code == V3Ethnicity._21725) 200 return "2172-5"; 201 if (code == V3Ethnicity._21733) 202 return "2173-3"; 203 if (code == V3Ethnicity._21741) 204 return "2174-1"; 205 if (code == V3Ethnicity._21758) 206 return "2175-8"; 207 if (code == V3Ethnicity._21766) 208 return "2176-6"; 209 if (code == V3Ethnicity._21782) 210 return "2178-2"; 211 if (code == V3Ethnicity._21808) 212 return "2180-8"; 213 if (code == V3Ethnicity._21824) 214 return "2182-4"; 215 if (code == V3Ethnicity._21840) 216 return "2184-0"; 217 if (code == V3Ethnicity._21865) 218 return "2186-5"; 219 return "?"; 220 } 221 222 public String toSystem(V3Ethnicity code) { 223 return code.getSystem(); 224 } 225 226}