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