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