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 ServiceCategoryEnumFactory implements EnumFactory<ServiceCategory> { 037 038 public ServiceCategory fromCode(String codeString) throws IllegalArgumentException { 039 if (codeString == null || "".equals(codeString)) 040 return null; 041 if ("1".equals(codeString)) 042 return ServiceCategory._1; 043 if ("2".equals(codeString)) 044 return ServiceCategory._2; 045 if ("34".equals(codeString)) 046 return ServiceCategory._34; 047 if ("3".equals(codeString)) 048 return ServiceCategory._3; 049 if ("4".equals(codeString)) 050 return ServiceCategory._4; 051 if ("5".equals(codeString)) 052 return ServiceCategory._5; 053 if ("6".equals(codeString)) 054 return ServiceCategory._6; 055 if ("7".equals(codeString)) 056 return ServiceCategory._7; 057 if ("8".equals(codeString)) 058 return ServiceCategory._8; 059 if ("36".equals(codeString)) 060 return ServiceCategory._36; 061 if ("9".equals(codeString)) 062 return ServiceCategory._9; 063 if ("10".equals(codeString)) 064 return ServiceCategory._10; 065 if ("11".equals(codeString)) 066 return ServiceCategory._11; 067 if ("12".equals(codeString)) 068 return ServiceCategory._12; 069 if ("13".equals(codeString)) 070 return ServiceCategory._13; 071 if ("14".equals(codeString)) 072 return ServiceCategory._14; 073 if ("15".equals(codeString)) 074 return ServiceCategory._15; 075 if ("16".equals(codeString)) 076 return ServiceCategory._16; 077 if ("17".equals(codeString)) 078 return ServiceCategory._17; 079 if ("35".equals(codeString)) 080 return ServiceCategory._35; 081 if ("18".equals(codeString)) 082 return ServiceCategory._18; 083 if ("19".equals(codeString)) 084 return ServiceCategory._19; 085 if ("20".equals(codeString)) 086 return ServiceCategory._20; 087 if ("21".equals(codeString)) 088 return ServiceCategory._21; 089 if ("22".equals(codeString)) 090 return ServiceCategory._22; 091 if ("38".equals(codeString)) 092 return ServiceCategory._38; 093 if ("23".equals(codeString)) 094 return ServiceCategory._23; 095 if ("24".equals(codeString)) 096 return ServiceCategory._24; 097 if ("25".equals(codeString)) 098 return ServiceCategory._25; 099 if ("26".equals(codeString)) 100 return ServiceCategory._26; 101 if ("27".equals(codeString)) 102 return ServiceCategory._27; 103 if ("28".equals(codeString)) 104 return ServiceCategory._28; 105 if ("29".equals(codeString)) 106 return ServiceCategory._29; 107 if ("30".equals(codeString)) 108 return ServiceCategory._30; 109 if ("31".equals(codeString)) 110 return ServiceCategory._31; 111 if ("32".equals(codeString)) 112 return ServiceCategory._32; 113 if ("37".equals(codeString)) 114 return ServiceCategory._37; 115 if ("33".equals(codeString)) 116 return ServiceCategory._33; 117 throw new IllegalArgumentException("Unknown ServiceCategory code '" + codeString + "'"); 118 } 119 120 public String toCode(ServiceCategory code) { 121 if (code == ServiceCategory.NULL) 122 return null; 123 if (code == ServiceCategory._1) 124 return "1"; 125 if (code == ServiceCategory._2) 126 return "2"; 127 if (code == ServiceCategory._34) 128 return "34"; 129 if (code == ServiceCategory._3) 130 return "3"; 131 if (code == ServiceCategory._4) 132 return "4"; 133 if (code == ServiceCategory._5) 134 return "5"; 135 if (code == ServiceCategory._6) 136 return "6"; 137 if (code == ServiceCategory._7) 138 return "7"; 139 if (code == ServiceCategory._8) 140 return "8"; 141 if (code == ServiceCategory._36) 142 return "36"; 143 if (code == ServiceCategory._9) 144 return "9"; 145 if (code == ServiceCategory._10) 146 return "10"; 147 if (code == ServiceCategory._11) 148 return "11"; 149 if (code == ServiceCategory._12) 150 return "12"; 151 if (code == ServiceCategory._13) 152 return "13"; 153 if (code == ServiceCategory._14) 154 return "14"; 155 if (code == ServiceCategory._15) 156 return "15"; 157 if (code == ServiceCategory._16) 158 return "16"; 159 if (code == ServiceCategory._17) 160 return "17"; 161 if (code == ServiceCategory._35) 162 return "35"; 163 if (code == ServiceCategory._18) 164 return "18"; 165 if (code == ServiceCategory._19) 166 return "19"; 167 if (code == ServiceCategory._20) 168 return "20"; 169 if (code == ServiceCategory._21) 170 return "21"; 171 if (code == ServiceCategory._22) 172 return "22"; 173 if (code == ServiceCategory._38) 174 return "38"; 175 if (code == ServiceCategory._23) 176 return "23"; 177 if (code == ServiceCategory._24) 178 return "24"; 179 if (code == ServiceCategory._25) 180 return "25"; 181 if (code == ServiceCategory._26) 182 return "26"; 183 if (code == ServiceCategory._27) 184 return "27"; 185 if (code == ServiceCategory._28) 186 return "28"; 187 if (code == ServiceCategory._29) 188 return "29"; 189 if (code == ServiceCategory._30) 190 return "30"; 191 if (code == ServiceCategory._31) 192 return "31"; 193 if (code == ServiceCategory._32) 194 return "32"; 195 if (code == ServiceCategory._37) 196 return "37"; 197 if (code == ServiceCategory._33) 198 return "33"; 199 return "?"; 200 } 201 202 public String toSystem(ServiceCategory code) { 203 return code.getSystem(); 204 } 205 206}