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 ProgramEnumFactory implements EnumFactory<Program> { 058 059 public Program fromCode(String codeString) throws IllegalArgumentException { 060 if (codeString == null || "".equals(codeString)) 061 return null; 062 if ("1".equals(codeString)) 063 return Program._1; 064 if ("2".equals(codeString)) 065 return Program._2; 066 if ("3".equals(codeString)) 067 return Program._3; 068 if ("4".equals(codeString)) 069 return Program._4; 070 if ("5".equals(codeString)) 071 return Program._5; 072 if ("6".equals(codeString)) 073 return Program._6; 074 if ("7".equals(codeString)) 075 return Program._7; 076 if ("8".equals(codeString)) 077 return Program._8; 078 if ("9".equals(codeString)) 079 return Program._9; 080 if ("10".equals(codeString)) 081 return Program._10; 082 if ("11".equals(codeString)) 083 return Program._11; 084 if ("12".equals(codeString)) 085 return Program._12; 086 if ("13".equals(codeString)) 087 return Program._13; 088 if ("14".equals(codeString)) 089 return Program._14; 090 if ("15".equals(codeString)) 091 return Program._15; 092 if ("16".equals(codeString)) 093 return Program._16; 094 if ("17".equals(codeString)) 095 return Program._17; 096 if ("18".equals(codeString)) 097 return Program._18; 098 if ("19".equals(codeString)) 099 return Program._19; 100 if ("20".equals(codeString)) 101 return Program._20; 102 if ("21".equals(codeString)) 103 return Program._21; 104 if ("22".equals(codeString)) 105 return Program._22; 106 if ("23".equals(codeString)) 107 return Program._23; 108 if ("24".equals(codeString)) 109 return Program._24; 110 if ("25".equals(codeString)) 111 return Program._25; 112 if ("26".equals(codeString)) 113 return Program._26; 114 if ("27".equals(codeString)) 115 return Program._27; 116 if ("28".equals(codeString)) 117 return Program._28; 118 if ("29".equals(codeString)) 119 return Program._29; 120 if ("30".equals(codeString)) 121 return Program._30; 122 if ("31".equals(codeString)) 123 return Program._31; 124 if ("32".equals(codeString)) 125 return Program._32; 126 if ("33".equals(codeString)) 127 return Program._33; 128 if ("34".equals(codeString)) 129 return Program._34; 130 if ("35".equals(codeString)) 131 return Program._35; 132 if ("36".equals(codeString)) 133 return Program._36; 134 if ("37".equals(codeString)) 135 return Program._37; 136 if ("38".equals(codeString)) 137 return Program._38; 138 if ("39".equals(codeString)) 139 return Program._39; 140 if ("40".equals(codeString)) 141 return Program._40; 142 if ("41".equals(codeString)) 143 return Program._41; 144 if ("42".equals(codeString)) 145 return Program._42; 146 if ("43".equals(codeString)) 147 return Program._43; 148 if ("44".equals(codeString)) 149 return Program._44; 150 if ("45".equals(codeString)) 151 return Program._45; 152 throw new IllegalArgumentException("Unknown Program code '"+codeString+"'"); 153 } 154 155 public String toCode(Program code) { 156 if (code == Program._1) 157 return "1"; 158 if (code == Program._2) 159 return "2"; 160 if (code == Program._3) 161 return "3"; 162 if (code == Program._4) 163 return "4"; 164 if (code == Program._5) 165 return "5"; 166 if (code == Program._6) 167 return "6"; 168 if (code == Program._7) 169 return "7"; 170 if (code == Program._8) 171 return "8"; 172 if (code == Program._9) 173 return "9"; 174 if (code == Program._10) 175 return "10"; 176 if (code == Program._11) 177 return "11"; 178 if (code == Program._12) 179 return "12"; 180 if (code == Program._13) 181 return "13"; 182 if (code == Program._14) 183 return "14"; 184 if (code == Program._15) 185 return "15"; 186 if (code == Program._16) 187 return "16"; 188 if (code == Program._17) 189 return "17"; 190 if (code == Program._18) 191 return "18"; 192 if (code == Program._19) 193 return "19"; 194 if (code == Program._20) 195 return "20"; 196 if (code == Program._21) 197 return "21"; 198 if (code == Program._22) 199 return "22"; 200 if (code == Program._23) 201 return "23"; 202 if (code == Program._24) 203 return "24"; 204 if (code == Program._25) 205 return "25"; 206 if (code == Program._26) 207 return "26"; 208 if (code == Program._27) 209 return "27"; 210 if (code == Program._28) 211 return "28"; 212 if (code == Program._29) 213 return "29"; 214 if (code == Program._30) 215 return "30"; 216 if (code == Program._31) 217 return "31"; 218 if (code == Program._32) 219 return "32"; 220 if (code == Program._33) 221 return "33"; 222 if (code == Program._34) 223 return "34"; 224 if (code == Program._35) 225 return "35"; 226 if (code == Program._36) 227 return "36"; 228 if (code == Program._37) 229 return "37"; 230 if (code == Program._38) 231 return "38"; 232 if (code == Program._39) 233 return "39"; 234 if (code == Program._40) 235 return "40"; 236 if (code == Program._41) 237 return "41"; 238 if (code == Program._42) 239 return "42"; 240 if (code == Program._43) 241 return "43"; 242 if (code == Program._44) 243 return "44"; 244 if (code == Program._45) 245 return "45"; 246 return "?"; 247 } 248 249 public String toSystem(Program code) { 250 return code.getSystem(); 251 } 252 253} 254