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, Dec 27, 2018 10:06-0500 for FHIR v4.0.0 033 034 035import org.hl7.fhir.r4.model.EnumFactory; 036 037public class MedicationknowledgePackageTypeEnumFactory implements EnumFactory<MedicationknowledgePackageType> { 038 039 public MedicationknowledgePackageType fromCode(String codeString) throws IllegalArgumentException { 040 if (codeString == null || "".equals(codeString)) 041 return null; 042 if ("amp".equals(codeString)) 043 return MedicationknowledgePackageType.AMP; 044 if ("bag".equals(codeString)) 045 return MedicationknowledgePackageType.BAG; 046 if ("blstrpk".equals(codeString)) 047 return MedicationknowledgePackageType.BLSTRPK; 048 if ("bot".equals(codeString)) 049 return MedicationknowledgePackageType.BOT; 050 if ("box".equals(codeString)) 051 return MedicationknowledgePackageType.BOX; 052 if ("can".equals(codeString)) 053 return MedicationknowledgePackageType.CAN; 054 if ("cart".equals(codeString)) 055 return MedicationknowledgePackageType.CART; 056 if ("disk".equals(codeString)) 057 return MedicationknowledgePackageType.DISK; 058 if ("doset".equals(codeString)) 059 return MedicationknowledgePackageType.DOSET; 060 if ("jar".equals(codeString)) 061 return MedicationknowledgePackageType.JAR; 062 if ("jug".equals(codeString)) 063 return MedicationknowledgePackageType.JUG; 064 if ("minim".equals(codeString)) 065 return MedicationknowledgePackageType.MINIM; 066 if ("nebamp".equals(codeString)) 067 return MedicationknowledgePackageType.NEBAMP; 068 if ("ovul".equals(codeString)) 069 return MedicationknowledgePackageType.OVUL; 070 if ("pch".equals(codeString)) 071 return MedicationknowledgePackageType.PCH; 072 if ("pkt".equals(codeString)) 073 return MedicationknowledgePackageType.PKT; 074 if ("sash".equals(codeString)) 075 return MedicationknowledgePackageType.SASH; 076 if ("strip".equals(codeString)) 077 return MedicationknowledgePackageType.STRIP; 078 if ("tin".equals(codeString)) 079 return MedicationknowledgePackageType.TIN; 080 if ("tub".equals(codeString)) 081 return MedicationknowledgePackageType.TUB; 082 if ("tube".equals(codeString)) 083 return MedicationknowledgePackageType.TUBE; 084 if ("vial".equals(codeString)) 085 return MedicationknowledgePackageType.VIAL; 086 throw new IllegalArgumentException("Unknown MedicationknowledgePackageType code '"+codeString+"'"); 087 } 088 089 public String toCode(MedicationknowledgePackageType code) { 090 if (code == MedicationknowledgePackageType.AMP) 091 return "amp"; 092 if (code == MedicationknowledgePackageType.BAG) 093 return "bag"; 094 if (code == MedicationknowledgePackageType.BLSTRPK) 095 return "blstrpk"; 096 if (code == MedicationknowledgePackageType.BOT) 097 return "bot"; 098 if (code == MedicationknowledgePackageType.BOX) 099 return "box"; 100 if (code == MedicationknowledgePackageType.CAN) 101 return "can"; 102 if (code == MedicationknowledgePackageType.CART) 103 return "cart"; 104 if (code == MedicationknowledgePackageType.DISK) 105 return "disk"; 106 if (code == MedicationknowledgePackageType.DOSET) 107 return "doset"; 108 if (code == MedicationknowledgePackageType.JAR) 109 return "jar"; 110 if (code == MedicationknowledgePackageType.JUG) 111 return "jug"; 112 if (code == MedicationknowledgePackageType.MINIM) 113 return "minim"; 114 if (code == MedicationknowledgePackageType.NEBAMP) 115 return "nebamp"; 116 if (code == MedicationknowledgePackageType.OVUL) 117 return "ovul"; 118 if (code == MedicationknowledgePackageType.PCH) 119 return "pch"; 120 if (code == MedicationknowledgePackageType.PKT) 121 return "pkt"; 122 if (code == MedicationknowledgePackageType.SASH) 123 return "sash"; 124 if (code == MedicationknowledgePackageType.STRIP) 125 return "strip"; 126 if (code == MedicationknowledgePackageType.TIN) 127 return "tin"; 128 if (code == MedicationknowledgePackageType.TUB) 129 return "tub"; 130 if (code == MedicationknowledgePackageType.TUBE) 131 return "tube"; 132 if (code == MedicationknowledgePackageType.VIAL) 133 return "vial"; 134 return "?"; 135 } 136 137 public String toSystem(MedicationknowledgePackageType code) { 138 return code.getSystem(); 139 } 140 141} 142