001package org.hl7.fhir.r5.model.codesystems;
002
003/*
004 * #%L
005 * org.hl7.fhir.r5
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  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Thu, Oct 17, 2019 09:42+1100 for FHIR v4.1.0
053
054
055import org.hl7.fhir.r5.model.EnumFactory;
056
057public class V3EthnicityEnumFactory implements EnumFactory<V3Ethnicity> {
058
059  public V3Ethnicity fromCode(String codeString) throws IllegalArgumentException {
060    if (codeString == null || "".equals(codeString))
061      return null;
062    if ("2135-2".equals(codeString))
063      return V3Ethnicity._21352;
064    if ("2137-8".equals(codeString))
065      return V3Ethnicity._21378;
066    if ("2138-6".equals(codeString))
067      return V3Ethnicity._21386;
068    if ("2139-4".equals(codeString))
069      return V3Ethnicity._21394;
070    if ("2140-2".equals(codeString))
071      return V3Ethnicity._21402;
072    if ("2141-0".equals(codeString))
073      return V3Ethnicity._21410;
074    if ("2142-8".equals(codeString))
075      return V3Ethnicity._21428;
076    if ("2143-6".equals(codeString))
077      return V3Ethnicity._21436;
078    if ("2144-4".equals(codeString))
079      return V3Ethnicity._21444;
080    if ("2145-1".equals(codeString))
081      return V3Ethnicity._21451;
082    if ("2146-9".equals(codeString))
083      return V3Ethnicity._21469;
084    if ("2148-5".equals(codeString))
085      return V3Ethnicity._21485;
086    if ("2149-3".equals(codeString))
087      return V3Ethnicity._21493;
088    if ("2150-1".equals(codeString))
089      return V3Ethnicity._21501;
090    if ("2151-9".equals(codeString))
091      return V3Ethnicity._21519;
092    if ("2152-7".equals(codeString))
093      return V3Ethnicity._21527;
094    if ("2153-5".equals(codeString))
095      return V3Ethnicity._21535;
096    if ("2155-0".equals(codeString))
097      return V3Ethnicity._21550;
098    if ("2156-8".equals(codeString))
099      return V3Ethnicity._21568;
100    if ("2157-6".equals(codeString))
101      return V3Ethnicity._21576;
102    if ("2158-4".equals(codeString))
103      return V3Ethnicity._21584;
104    if ("2159-2".equals(codeString))
105      return V3Ethnicity._21592;
106    if ("2160-0".equals(codeString))
107      return V3Ethnicity._21600;
108    if ("2161-8".equals(codeString))
109      return V3Ethnicity._21618;
110    if ("2162-6".equals(codeString))
111      return V3Ethnicity._21626;
112    if ("2163-4".equals(codeString))
113      return V3Ethnicity._21634;
114    if ("2165-9".equals(codeString))
115      return V3Ethnicity._21659;
116    if ("2166-7".equals(codeString))
117      return V3Ethnicity._21667;
118    if ("2167-5".equals(codeString))
119      return V3Ethnicity._21675;
120    if ("2168-3".equals(codeString))
121      return V3Ethnicity._21683;
122    if ("2169-1".equals(codeString))
123      return V3Ethnicity._21691;
124    if ("2170-9".equals(codeString))
125      return V3Ethnicity._21709;
126    if ("2171-7".equals(codeString))
127      return V3Ethnicity._21717;
128    if ("2172-5".equals(codeString))
129      return V3Ethnicity._21725;
130    if ("2173-3".equals(codeString))
131      return V3Ethnicity._21733;
132    if ("2174-1".equals(codeString))
133      return V3Ethnicity._21741;
134    if ("2175-8".equals(codeString))
135      return V3Ethnicity._21758;
136    if ("2176-6".equals(codeString))
137      return V3Ethnicity._21766;
138    if ("2178-2".equals(codeString))
139      return V3Ethnicity._21782;
140    if ("2180-8".equals(codeString))
141      return V3Ethnicity._21808;
142    if ("2182-4".equals(codeString))
143      return V3Ethnicity._21824;
144    if ("2184-0".equals(codeString))
145      return V3Ethnicity._21840;
146    if ("2186-5".equals(codeString))
147      return V3Ethnicity._21865;
148    throw new IllegalArgumentException("Unknown V3Ethnicity code '"+codeString+"'");
149  }
150
151  public String toCode(V3Ethnicity code) {
152    if (code == V3Ethnicity._21352)
153      return "2135-2";
154    if (code == V3Ethnicity._21378)
155      return "2137-8";
156    if (code == V3Ethnicity._21386)
157      return "2138-6";
158    if (code == V3Ethnicity._21394)
159      return "2139-4";
160    if (code == V3Ethnicity._21402)
161      return "2140-2";
162    if (code == V3Ethnicity._21410)
163      return "2141-0";
164    if (code == V3Ethnicity._21428)
165      return "2142-8";
166    if (code == V3Ethnicity._21436)
167      return "2143-6";
168    if (code == V3Ethnicity._21444)
169      return "2144-4";
170    if (code == V3Ethnicity._21451)
171      return "2145-1";
172    if (code == V3Ethnicity._21469)
173      return "2146-9";
174    if (code == V3Ethnicity._21485)
175      return "2148-5";
176    if (code == V3Ethnicity._21493)
177      return "2149-3";
178    if (code == V3Ethnicity._21501)
179      return "2150-1";
180    if (code == V3Ethnicity._21519)
181      return "2151-9";
182    if (code == V3Ethnicity._21527)
183      return "2152-7";
184    if (code == V3Ethnicity._21535)
185      return "2153-5";
186    if (code == V3Ethnicity._21550)
187      return "2155-0";
188    if (code == V3Ethnicity._21568)
189      return "2156-8";
190    if (code == V3Ethnicity._21576)
191      return "2157-6";
192    if (code == V3Ethnicity._21584)
193      return "2158-4";
194    if (code == V3Ethnicity._21592)
195      return "2159-2";
196    if (code == V3Ethnicity._21600)
197      return "2160-0";
198    if (code == V3Ethnicity._21618)
199      return "2161-8";
200    if (code == V3Ethnicity._21626)
201      return "2162-6";
202    if (code == V3Ethnicity._21634)
203      return "2163-4";
204    if (code == V3Ethnicity._21659)
205      return "2165-9";
206    if (code == V3Ethnicity._21667)
207      return "2166-7";
208    if (code == V3Ethnicity._21675)
209      return "2167-5";
210    if (code == V3Ethnicity._21683)
211      return "2168-3";
212    if (code == V3Ethnicity._21691)
213      return "2169-1";
214    if (code == V3Ethnicity._21709)
215      return "2170-9";
216    if (code == V3Ethnicity._21717)
217      return "2171-7";
218    if (code == V3Ethnicity._21725)
219      return "2172-5";
220    if (code == V3Ethnicity._21733)
221      return "2173-3";
222    if (code == V3Ethnicity._21741)
223      return "2174-1";
224    if (code == V3Ethnicity._21758)
225      return "2175-8";
226    if (code == V3Ethnicity._21766)
227      return "2176-6";
228    if (code == V3Ethnicity._21782)
229      return "2178-2";
230    if (code == V3Ethnicity._21808)
231      return "2180-8";
232    if (code == V3Ethnicity._21824)
233      return "2182-4";
234    if (code == V3Ethnicity._21840)
235      return "2184-0";
236    if (code == V3Ethnicity._21865)
237      return "2186-5";
238    return "?";
239  }
240
241    public String toSystem(V3Ethnicity code) {
242      return code.getSystem();
243      }
244
245}
246