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 Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0 033 034 035import org.hl7.fhir.r4.model.EnumFactory; 036 037public class ToothEnumFactory implements EnumFactory<Tooth> { 038 039 public Tooth fromCode(String codeString) throws IllegalArgumentException { 040 if (codeString == null || "".equals(codeString)) 041 return null; 042 if ("0".equals(codeString)) 043 return Tooth._0; 044 if ("1".equals(codeString)) 045 return Tooth._1; 046 if ("2".equals(codeString)) 047 return Tooth._2; 048 if ("3".equals(codeString)) 049 return Tooth._3; 050 if ("4".equals(codeString)) 051 return Tooth._4; 052 if ("5".equals(codeString)) 053 return Tooth._5; 054 if ("6".equals(codeString)) 055 return Tooth._6; 056 if ("7".equals(codeString)) 057 return Tooth._7; 058 if ("8".equals(codeString)) 059 return Tooth._8; 060 if ("11".equals(codeString)) 061 return Tooth._11; 062 if ("12".equals(codeString)) 063 return Tooth._12; 064 if ("13".equals(codeString)) 065 return Tooth._13; 066 if ("14".equals(codeString)) 067 return Tooth._14; 068 if ("15".equals(codeString)) 069 return Tooth._15; 070 if ("16".equals(codeString)) 071 return Tooth._16; 072 if ("17".equals(codeString)) 073 return Tooth._17; 074 if ("18".equals(codeString)) 075 return Tooth._18; 076 if ("21".equals(codeString)) 077 return Tooth._21; 078 if ("22".equals(codeString)) 079 return Tooth._22; 080 if ("23".equals(codeString)) 081 return Tooth._23; 082 if ("24".equals(codeString)) 083 return Tooth._24; 084 if ("25".equals(codeString)) 085 return Tooth._25; 086 if ("26".equals(codeString)) 087 return Tooth._26; 088 if ("27".equals(codeString)) 089 return Tooth._27; 090 if ("28".equals(codeString)) 091 return Tooth._28; 092 if ("31".equals(codeString)) 093 return Tooth._31; 094 if ("32".equals(codeString)) 095 return Tooth._32; 096 if ("33".equals(codeString)) 097 return Tooth._33; 098 if ("34".equals(codeString)) 099 return Tooth._34; 100 if ("35".equals(codeString)) 101 return Tooth._35; 102 if ("36".equals(codeString)) 103 return Tooth._36; 104 if ("37".equals(codeString)) 105 return Tooth._37; 106 if ("38".equals(codeString)) 107 return Tooth._38; 108 if ("41".equals(codeString)) 109 return Tooth._41; 110 if ("42".equals(codeString)) 111 return Tooth._42; 112 if ("43".equals(codeString)) 113 return Tooth._43; 114 if ("44".equals(codeString)) 115 return Tooth._44; 116 if ("45".equals(codeString)) 117 return Tooth._45; 118 if ("46".equals(codeString)) 119 return Tooth._46; 120 if ("47".equals(codeString)) 121 return Tooth._47; 122 if ("48".equals(codeString)) 123 return Tooth._48; 124 throw new IllegalArgumentException("Unknown Tooth code '"+codeString+"'"); 125 } 126 127 public String toCode(Tooth code) { 128 if (code == Tooth._0) 129 return "0"; 130 if (code == Tooth._1) 131 return "1"; 132 if (code == Tooth._2) 133 return "2"; 134 if (code == Tooth._3) 135 return "3"; 136 if (code == Tooth._4) 137 return "4"; 138 if (code == Tooth._5) 139 return "5"; 140 if (code == Tooth._6) 141 return "6"; 142 if (code == Tooth._7) 143 return "7"; 144 if (code == Tooth._8) 145 return "8"; 146 if (code == Tooth._11) 147 return "11"; 148 if (code == Tooth._12) 149 return "12"; 150 if (code == Tooth._13) 151 return "13"; 152 if (code == Tooth._14) 153 return "14"; 154 if (code == Tooth._15) 155 return "15"; 156 if (code == Tooth._16) 157 return "16"; 158 if (code == Tooth._17) 159 return "17"; 160 if (code == Tooth._18) 161 return "18"; 162 if (code == Tooth._21) 163 return "21"; 164 if (code == Tooth._22) 165 return "22"; 166 if (code == Tooth._23) 167 return "23"; 168 if (code == Tooth._24) 169 return "24"; 170 if (code == Tooth._25) 171 return "25"; 172 if (code == Tooth._26) 173 return "26"; 174 if (code == Tooth._27) 175 return "27"; 176 if (code == Tooth._28) 177 return "28"; 178 if (code == Tooth._31) 179 return "31"; 180 if (code == Tooth._32) 181 return "32"; 182 if (code == Tooth._33) 183 return "33"; 184 if (code == Tooth._34) 185 return "34"; 186 if (code == Tooth._35) 187 return "35"; 188 if (code == Tooth._36) 189 return "36"; 190 if (code == Tooth._37) 191 return "37"; 192 if (code == Tooth._38) 193 return "38"; 194 if (code == Tooth._41) 195 return "41"; 196 if (code == Tooth._42) 197 return "42"; 198 if (code == Tooth._43) 199 return "43"; 200 if (code == Tooth._44) 201 return "44"; 202 if (code == Tooth._45) 203 return "45"; 204 if (code == Tooth._46) 205 return "46"; 206 if (code == Tooth._47) 207 return "47"; 208 if (code == Tooth._48) 209 return "48"; 210 return "?"; 211 } 212 213 public String toSystem(Tooth code) { 214 return code.getSystem(); 215 } 216 217} 218