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 ChromosomeHumanEnumFactory implements EnumFactory<ChromosomeHuman> {
058
059  public ChromosomeHuman fromCode(String codeString) throws IllegalArgumentException {
060    if (codeString == null || "".equals(codeString))
061      return null;
062    if ("1".equals(codeString))
063      return ChromosomeHuman._1;
064    if ("2".equals(codeString))
065      return ChromosomeHuman._2;
066    if ("3".equals(codeString))
067      return ChromosomeHuman._3;
068    if ("4".equals(codeString))
069      return ChromosomeHuman._4;
070    if ("5".equals(codeString))
071      return ChromosomeHuman._5;
072    if ("6".equals(codeString))
073      return ChromosomeHuman._6;
074    if ("7".equals(codeString))
075      return ChromosomeHuman._7;
076    if ("8".equals(codeString))
077      return ChromosomeHuman._8;
078    if ("9".equals(codeString))
079      return ChromosomeHuman._9;
080    if ("10".equals(codeString))
081      return ChromosomeHuman._10;
082    if ("11".equals(codeString))
083      return ChromosomeHuman._11;
084    if ("12".equals(codeString))
085      return ChromosomeHuman._12;
086    if ("13".equals(codeString))
087      return ChromosomeHuman._13;
088    if ("14".equals(codeString))
089      return ChromosomeHuman._14;
090    if ("15".equals(codeString))
091      return ChromosomeHuman._15;
092    if ("16".equals(codeString))
093      return ChromosomeHuman._16;
094    if ("17".equals(codeString))
095      return ChromosomeHuman._17;
096    if ("18".equals(codeString))
097      return ChromosomeHuman._18;
098    if ("19".equals(codeString))
099      return ChromosomeHuman._19;
100    if ("20".equals(codeString))
101      return ChromosomeHuman._20;
102    if ("21".equals(codeString))
103      return ChromosomeHuman._21;
104    if ("22".equals(codeString))
105      return ChromosomeHuman._22;
106    if ("X".equals(codeString))
107      return ChromosomeHuman.X;
108    if ("Y".equals(codeString))
109      return ChromosomeHuman.Y;
110    throw new IllegalArgumentException("Unknown ChromosomeHuman code '"+codeString+"'");
111  }
112
113  public String toCode(ChromosomeHuman code) {
114    if (code == ChromosomeHuman._1)
115      return "1";
116    if (code == ChromosomeHuman._2)
117      return "2";
118    if (code == ChromosomeHuman._3)
119      return "3";
120    if (code == ChromosomeHuman._4)
121      return "4";
122    if (code == ChromosomeHuman._5)
123      return "5";
124    if (code == ChromosomeHuman._6)
125      return "6";
126    if (code == ChromosomeHuman._7)
127      return "7";
128    if (code == ChromosomeHuman._8)
129      return "8";
130    if (code == ChromosomeHuman._9)
131      return "9";
132    if (code == ChromosomeHuman._10)
133      return "10";
134    if (code == ChromosomeHuman._11)
135      return "11";
136    if (code == ChromosomeHuman._12)
137      return "12";
138    if (code == ChromosomeHuman._13)
139      return "13";
140    if (code == ChromosomeHuman._14)
141      return "14";
142    if (code == ChromosomeHuman._15)
143      return "15";
144    if (code == ChromosomeHuman._16)
145      return "16";
146    if (code == ChromosomeHuman._17)
147      return "17";
148    if (code == ChromosomeHuman._18)
149      return "18";
150    if (code == ChromosomeHuman._19)
151      return "19";
152    if (code == ChromosomeHuman._20)
153      return "20";
154    if (code == ChromosomeHuman._21)
155      return "21";
156    if (code == ChromosomeHuman._22)
157      return "22";
158    if (code == ChromosomeHuman.X)
159      return "X";
160    if (code == ChromosomeHuman.Y)
161      return "Y";
162    return "?";
163  }
164
165    public String toSystem(ChromosomeHuman code) {
166      return code.getSystem();
167      }
168
169}
170