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.exceptions.FHIRException;
035
036public enum V3Ethnicity {
037
038  /**
039   * Hispanic or Latino
040   */
041  _21352,
042  /**
043   * Spaniard
044   */
045  _21378,
046  /**
047   * Andalusian
048   */
049  _21386,
050  /**
051   * Asturian
052   */
053  _21394,
054  /**
055   * Castillian
056   */
057  _21402,
058  /**
059   * Catalonian
060   */
061  _21410,
062  /**
063   * Belearic Islander
064   */
065  _21428,
066  /**
067   * Gallego
068   */
069  _21436,
070  /**
071   * Valencian
072   */
073  _21444,
074  /**
075   * Canarian
076   */
077  _21451,
078  /**
079   * Spanish Basque
080   */
081  _21469,
082  /**
083   * Mexican
084   */
085  _21485,
086  /**
087   * Mexican American
088   */
089  _21493,
090  /**
091   * Mexicano
092   */
093  _21501,
094  /**
095   * Chicano
096   */
097  _21519,
098  /**
099   * La Raza
100   */
101  _21527,
102  /**
103   * Mexican American Indian
104   */
105  _21535,
106  /**
107   * Central American
108   */
109  _21550,
110  /**
111   * Costa Rican
112   */
113  _21568,
114  /**
115   * Guatemalan
116   */
117  _21576,
118  /**
119   * Honduran
120   */
121  _21584,
122  /**
123   * Nicaraguan
124   */
125  _21592,
126  /**
127   * Panamanian
128   */
129  _21600,
130  /**
131   * Salvadoran
132   */
133  _21618,
134  /**
135   * Central American Indian
136   */
137  _21626,
138  /**
139   * Canal Zone
140   */
141  _21634,
142  /**
143   * South American
144   */
145  _21659,
146  /**
147   * Argentinean
148   */
149  _21667,
150  /**
151   * Bolivian
152   */
153  _21675,
154  /**
155   * Chilean
156   */
157  _21683,
158  /**
159   * Colombian
160   */
161  _21691,
162  /**
163   * Ecuadorian
164   */
165  _21709,
166  /**
167   * Paraguayan
168   */
169  _21717,
170  /**
171   * Peruvian
172   */
173  _21725,
174  /**
175   * Uruguayan
176   */
177  _21733,
178  /**
179   * Venezuelan
180   */
181  _21741,
182  /**
183   * South American Indian
184   */
185  _21758,
186  /**
187   * Criollo
188   */
189  _21766,
190  /**
191   * Latin American
192   */
193  _21782,
194  /**
195   * Puerto Rican
196   */
197  _21808,
198  /**
199   * Cuban
200   */
201  _21824,
202  /**
203   * Dominican
204   */
205  _21840,
206  /**
207   * Note that this term remains in the table for completeness, even though within
208   * HL7, the notion of "not otherwise coded" term is deprecated.
209   */
210  _21865,
211  /**
212   * added to help the parsers
213   */
214  NULL;
215
216  public static V3Ethnicity fromCode(String codeString) throws FHIRException {
217    if (codeString == null || "".equals(codeString))
218      return null;
219    if ("2135-2".equals(codeString))
220      return _21352;
221    if ("2137-8".equals(codeString))
222      return _21378;
223    if ("2138-6".equals(codeString))
224      return _21386;
225    if ("2139-4".equals(codeString))
226      return _21394;
227    if ("2140-2".equals(codeString))
228      return _21402;
229    if ("2141-0".equals(codeString))
230      return _21410;
231    if ("2142-8".equals(codeString))
232      return _21428;
233    if ("2143-6".equals(codeString))
234      return _21436;
235    if ("2144-4".equals(codeString))
236      return _21444;
237    if ("2145-1".equals(codeString))
238      return _21451;
239    if ("2146-9".equals(codeString))
240      return _21469;
241    if ("2148-5".equals(codeString))
242      return _21485;
243    if ("2149-3".equals(codeString))
244      return _21493;
245    if ("2150-1".equals(codeString))
246      return _21501;
247    if ("2151-9".equals(codeString))
248      return _21519;
249    if ("2152-7".equals(codeString))
250      return _21527;
251    if ("2153-5".equals(codeString))
252      return _21535;
253    if ("2155-0".equals(codeString))
254      return _21550;
255    if ("2156-8".equals(codeString))
256      return _21568;
257    if ("2157-6".equals(codeString))
258      return _21576;
259    if ("2158-4".equals(codeString))
260      return _21584;
261    if ("2159-2".equals(codeString))
262      return _21592;
263    if ("2160-0".equals(codeString))
264      return _21600;
265    if ("2161-8".equals(codeString))
266      return _21618;
267    if ("2162-6".equals(codeString))
268      return _21626;
269    if ("2163-4".equals(codeString))
270      return _21634;
271    if ("2165-9".equals(codeString))
272      return _21659;
273    if ("2166-7".equals(codeString))
274      return _21667;
275    if ("2167-5".equals(codeString))
276      return _21675;
277    if ("2168-3".equals(codeString))
278      return _21683;
279    if ("2169-1".equals(codeString))
280      return _21691;
281    if ("2170-9".equals(codeString))
282      return _21709;
283    if ("2171-7".equals(codeString))
284      return _21717;
285    if ("2172-5".equals(codeString))
286      return _21725;
287    if ("2173-3".equals(codeString))
288      return _21733;
289    if ("2174-1".equals(codeString))
290      return _21741;
291    if ("2175-8".equals(codeString))
292      return _21758;
293    if ("2176-6".equals(codeString))
294      return _21766;
295    if ("2178-2".equals(codeString))
296      return _21782;
297    if ("2180-8".equals(codeString))
298      return _21808;
299    if ("2182-4".equals(codeString))
300      return _21824;
301    if ("2184-0".equals(codeString))
302      return _21840;
303    if ("2186-5".equals(codeString))
304      return _21865;
305    throw new FHIRException("Unknown V3Ethnicity code '" + codeString + "'");
306  }
307
308  public String toCode() {
309    switch (this) {
310    case _21352:
311      return "2135-2";
312    case _21378:
313      return "2137-8";
314    case _21386:
315      return "2138-6";
316    case _21394:
317      return "2139-4";
318    case _21402:
319      return "2140-2";
320    case _21410:
321      return "2141-0";
322    case _21428:
323      return "2142-8";
324    case _21436:
325      return "2143-6";
326    case _21444:
327      return "2144-4";
328    case _21451:
329      return "2145-1";
330    case _21469:
331      return "2146-9";
332    case _21485:
333      return "2148-5";
334    case _21493:
335      return "2149-3";
336    case _21501:
337      return "2150-1";
338    case _21519:
339      return "2151-9";
340    case _21527:
341      return "2152-7";
342    case _21535:
343      return "2153-5";
344    case _21550:
345      return "2155-0";
346    case _21568:
347      return "2156-8";
348    case _21576:
349      return "2157-6";
350    case _21584:
351      return "2158-4";
352    case _21592:
353      return "2159-2";
354    case _21600:
355      return "2160-0";
356    case _21618:
357      return "2161-8";
358    case _21626:
359      return "2162-6";
360    case _21634:
361      return "2163-4";
362    case _21659:
363      return "2165-9";
364    case _21667:
365      return "2166-7";
366    case _21675:
367      return "2167-5";
368    case _21683:
369      return "2168-3";
370    case _21691:
371      return "2169-1";
372    case _21709:
373      return "2170-9";
374    case _21717:
375      return "2171-7";
376    case _21725:
377      return "2172-5";
378    case _21733:
379      return "2173-3";
380    case _21741:
381      return "2174-1";
382    case _21758:
383      return "2175-8";
384    case _21766:
385      return "2176-6";
386    case _21782:
387      return "2178-2";
388    case _21808:
389      return "2180-8";
390    case _21824:
391      return "2182-4";
392    case _21840:
393      return "2184-0";
394    case _21865:
395      return "2186-5";
396    case NULL:
397      return null;
398    default:
399      return "?";
400    }
401  }
402
403  public String getSystem() {
404    return "http://terminology.hl7.org/CodeSystem/v3-Ethnicity";
405  }
406
407  public String getDefinition() {
408    switch (this) {
409    case _21352:
410      return "Hispanic or Latino";
411    case _21378:
412      return "Spaniard";
413    case _21386:
414      return "Andalusian";
415    case _21394:
416      return "Asturian";
417    case _21402:
418      return "Castillian";
419    case _21410:
420      return "Catalonian";
421    case _21428:
422      return "Belearic Islander";
423    case _21436:
424      return "Gallego";
425    case _21444:
426      return "Valencian";
427    case _21451:
428      return "Canarian";
429    case _21469:
430      return "Spanish Basque";
431    case _21485:
432      return "Mexican";
433    case _21493:
434      return "Mexican American";
435    case _21501:
436      return "Mexicano";
437    case _21519:
438      return "Chicano";
439    case _21527:
440      return "La Raza";
441    case _21535:
442      return "Mexican American Indian";
443    case _21550:
444      return "Central American";
445    case _21568:
446      return "Costa Rican";
447    case _21576:
448      return "Guatemalan";
449    case _21584:
450      return "Honduran";
451    case _21592:
452      return "Nicaraguan";
453    case _21600:
454      return "Panamanian";
455    case _21618:
456      return "Salvadoran";
457    case _21626:
458      return "Central American Indian";
459    case _21634:
460      return "Canal Zone";
461    case _21659:
462      return "South American";
463    case _21667:
464      return "Argentinean";
465    case _21675:
466      return "Bolivian";
467    case _21683:
468      return "Chilean";
469    case _21691:
470      return "Colombian";
471    case _21709:
472      return "Ecuadorian";
473    case _21717:
474      return "Paraguayan";
475    case _21725:
476      return "Peruvian";
477    case _21733:
478      return "Uruguayan";
479    case _21741:
480      return "Venezuelan";
481    case _21758:
482      return "South American Indian";
483    case _21766:
484      return "Criollo";
485    case _21782:
486      return "Latin American";
487    case _21808:
488      return "Puerto Rican";
489    case _21824:
490      return "Cuban";
491    case _21840:
492      return "Dominican";
493    case _21865:
494      return "Note that this term remains in the table for completeness, even though within HL7, the notion of \"not otherwise coded\" term is deprecated.";
495    case NULL:
496      return null;
497    default:
498      return "?";
499    }
500  }
501
502  public String getDisplay() {
503    switch (this) {
504    case _21352:
505      return "Hispanic or Latino";
506    case _21378:
507      return "Spaniard";
508    case _21386:
509      return "Andalusian";
510    case _21394:
511      return "Asturian";
512    case _21402:
513      return "Castillian";
514    case _21410:
515      return "Catalonian";
516    case _21428:
517      return "Belearic Islander";
518    case _21436:
519      return "Gallego";
520    case _21444:
521      return "Valencian";
522    case _21451:
523      return "Canarian";
524    case _21469:
525      return "Spanish Basque";
526    case _21485:
527      return "Mexican";
528    case _21493:
529      return "Mexican American";
530    case _21501:
531      return "Mexicano";
532    case _21519:
533      return "Chicano";
534    case _21527:
535      return "La Raza";
536    case _21535:
537      return "Mexican American Indian";
538    case _21550:
539      return "Central American";
540    case _21568:
541      return "Costa Rican";
542    case _21576:
543      return "Guatemalan";
544    case _21584:
545      return "Honduran";
546    case _21592:
547      return "Nicaraguan";
548    case _21600:
549      return "Panamanian";
550    case _21618:
551      return "Salvadoran";
552    case _21626:
553      return "Central American Indian";
554    case _21634:
555      return "Canal Zone";
556    case _21659:
557      return "South American";
558    case _21667:
559      return "Argentinean";
560    case _21675:
561      return "Bolivian";
562    case _21683:
563      return "Chilean";
564    case _21691:
565      return "Colombian";
566    case _21709:
567      return "Ecuadorian";
568    case _21717:
569      return "Paraguayan";
570    case _21725:
571      return "Peruvian";
572    case _21733:
573      return "Uruguayan";
574    case _21741:
575      return "Venezuelan";
576    case _21758:
577      return "South American Indian";
578    case _21766:
579      return "Criollo";
580    case _21782:
581      return "Latin American";
582    case _21808:
583      return "Puerto Rican";
584    case _21824:
585      return "Cuban";
586    case _21840:
587      return "Dominican";
588    case _21865:
589      return "Not Hispanic or Latino";
590    case NULL:
591      return null;
592    default:
593      return "?";
594    }
595  }
596
597}