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