001package org.hl7.fhir.r4.model.codesystems; 002 003/*- 004 * #%L 005 * org.hl7.fhir.r4 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/* 025 Copyright (c) 2011+, HL7, Inc. 026 All rights reserved. 027 028 Redistribution and use in source and binary forms, with or without modification, 029 are permitted provided that the following conditions are met: 030 031 * Redistributions of source code must retain the above copyright notice, this 032 list of conditions and the following disclaimer. 033 * Redistributions in binary form must reproduce the above copyright notice, 034 this list of conditions and the following disclaimer in the documentation 035 and/or other materials provided with the distribution. 036 * Neither the name of HL7 nor the names of its contributors may be used to 037 endorse or promote products derived from this software without specific 038 prior written permission. 039 040 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 041 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 042 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 043 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 044 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 045 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 046 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 047 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 048 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 049 POSSIBILITY OF SUCH DAMAGE. 050 051*/ 052 053// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 054 055 056import org.hl7.fhir.exceptions.FHIRException; 057 058public enum MedicationknowledgePackageType { 059 060 /** 061 * null 062 */ 063 AMP, 064 /** 065 * null 066 */ 067 BAG, 068 /** 069 * null 070 */ 071 BLSTRPK, 072 /** 073 * null 074 */ 075 BOT, 076 /** 077 * null 078 */ 079 BOX, 080 /** 081 * null 082 */ 083 CAN, 084 /** 085 * null 086 */ 087 CART, 088 /** 089 * null 090 */ 091 DISK, 092 /** 093 * null 094 */ 095 DOSET, 096 /** 097 * null 098 */ 099 JAR, 100 /** 101 * null 102 */ 103 JUG, 104 /** 105 * null 106 */ 107 MINIM, 108 /** 109 * null 110 */ 111 NEBAMP, 112 /** 113 * null 114 */ 115 OVUL, 116 /** 117 * null 118 */ 119 PCH, 120 /** 121 * null 122 */ 123 PKT, 124 /** 125 * null 126 */ 127 SASH, 128 /** 129 * null 130 */ 131 STRIP, 132 /** 133 * null 134 */ 135 TIN, 136 /** 137 * null 138 */ 139 TUB, 140 /** 141 * null 142 */ 143 TUBE, 144 /** 145 * null 146 */ 147 VIAL, 148 /** 149 * added to help the parsers 150 */ 151 NULL; 152 public static MedicationknowledgePackageType fromCode(String codeString) throws FHIRException { 153 if (codeString == null || "".equals(codeString)) 154 return null; 155 if ("amp".equals(codeString)) 156 return AMP; 157 if ("bag".equals(codeString)) 158 return BAG; 159 if ("blstrpk".equals(codeString)) 160 return BLSTRPK; 161 if ("bot".equals(codeString)) 162 return BOT; 163 if ("box".equals(codeString)) 164 return BOX; 165 if ("can".equals(codeString)) 166 return CAN; 167 if ("cart".equals(codeString)) 168 return CART; 169 if ("disk".equals(codeString)) 170 return DISK; 171 if ("doset".equals(codeString)) 172 return DOSET; 173 if ("jar".equals(codeString)) 174 return JAR; 175 if ("jug".equals(codeString)) 176 return JUG; 177 if ("minim".equals(codeString)) 178 return MINIM; 179 if ("nebamp".equals(codeString)) 180 return NEBAMP; 181 if ("ovul".equals(codeString)) 182 return OVUL; 183 if ("pch".equals(codeString)) 184 return PCH; 185 if ("pkt".equals(codeString)) 186 return PKT; 187 if ("sash".equals(codeString)) 188 return SASH; 189 if ("strip".equals(codeString)) 190 return STRIP; 191 if ("tin".equals(codeString)) 192 return TIN; 193 if ("tub".equals(codeString)) 194 return TUB; 195 if ("tube".equals(codeString)) 196 return TUBE; 197 if ("vial".equals(codeString)) 198 return VIAL; 199 throw new FHIRException("Unknown MedicationknowledgePackageType code '"+codeString+"'"); 200 } 201 public String toCode() { 202 switch (this) { 203 case AMP: return "amp"; 204 case BAG: return "bag"; 205 case BLSTRPK: return "blstrpk"; 206 case BOT: return "bot"; 207 case BOX: return "box"; 208 case CAN: return "can"; 209 case CART: return "cart"; 210 case DISK: return "disk"; 211 case DOSET: return "doset"; 212 case JAR: return "jar"; 213 case JUG: return "jug"; 214 case MINIM: return "minim"; 215 case NEBAMP: return "nebamp"; 216 case OVUL: return "ovul"; 217 case PCH: return "pch"; 218 case PKT: return "pkt"; 219 case SASH: return "sash"; 220 case STRIP: return "strip"; 221 case TIN: return "tin"; 222 case TUB: return "tub"; 223 case TUBE: return "tube"; 224 case VIAL: return "vial"; 225 default: return "?"; 226 } 227 } 228 public String getSystem() { 229 return "http://terminology.hl7.org/CodeSystem/medicationknowledge-package-type"; 230 } 231 public String getDefinition() { 232 switch (this) { 233 case AMP: return ""; 234 case BAG: return ""; 235 case BLSTRPK: return ""; 236 case BOT: return ""; 237 case BOX: return ""; 238 case CAN: return ""; 239 case CART: return ""; 240 case DISK: return ""; 241 case DOSET: return ""; 242 case JAR: return ""; 243 case JUG: return ""; 244 case MINIM: return ""; 245 case NEBAMP: return ""; 246 case OVUL: return ""; 247 case PCH: return ""; 248 case PKT: return ""; 249 case SASH: return ""; 250 case STRIP: return ""; 251 case TIN: return ""; 252 case TUB: return ""; 253 case TUBE: return ""; 254 case VIAL: return ""; 255 default: return "?"; 256 } 257 } 258 public String getDisplay() { 259 switch (this) { 260 case AMP: return "Ampule"; 261 case BAG: return "Bag"; 262 case BLSTRPK: return "Blister Pack"; 263 case BOT: return "Bottle"; 264 case BOX: return "Box"; 265 case CAN: return "Can"; 266 case CART: return "Cartridge"; 267 case DISK: return "Disk"; 268 case DOSET: return "Dosette"; 269 case JAR: return "Jar"; 270 case JUG: return "Jug"; 271 case MINIM: return "Minim"; 272 case NEBAMP: return "Nebule Amp"; 273 case OVUL: return "Ovule"; 274 case PCH: return "Pouch"; 275 case PKT: return "Packet"; 276 case SASH: return "Sashet"; 277 case STRIP: return "Strip"; 278 case TIN: return "Tin"; 279 case TUB: return "Tub"; 280 case TUBE: return "Tube"; 281 case VIAL: return "Vial"; 282 default: return "?"; 283 } 284 } 285 286 287} 288