001package org.hl7.fhir.dstu3.model.codesystems; 002 003 004 005 006/* 007 Copyright (c) 2011+, HL7, Inc. 008 All rights reserved. 009 010 Redistribution and use in source and binary forms, with or without modification, 011 are permitted provided that the following conditions are met: 012 013 * Redistributions of source code must retain the above copyright notice, this 014 list of conditions and the following disclaimer. 015 * Redistributions in binary form must reproduce the above copyright notice, 016 this list of conditions and the following disclaimer in the documentation 017 and/or other materials provided with the distribution. 018 * Neither the name of HL7 nor the names of its contributors may be used to 019 endorse or promote products derived from this software without specific 020 prior written permission. 021 022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 023 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 024 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 025 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 026 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 027 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 028 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 029 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 030 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 031 POSSIBILITY OF SUCH DAMAGE. 032 033*/ 034 035// Generated on Sat, Mar 25, 2017 21:03-0400 for FHIR v3.0.0 036 037 038import org.hl7.fhir.dstu3.model.EnumFactory; 039 040public class V3EntityNamePartQualifierR2EnumFactory implements EnumFactory<V3EntityNamePartQualifierR2> { 041 042 public V3EntityNamePartQualifierR2 fromCode(String codeString) throws IllegalArgumentException { 043 if (codeString == null || "".equals(codeString)) 044 return null; 045 if ("AD".equals(codeString)) 046 return V3EntityNamePartQualifierR2.AD; 047 if ("SP".equals(codeString)) 048 return V3EntityNamePartQualifierR2.SP; 049 if ("BR".equals(codeString)) 050 return V3EntityNamePartQualifierR2.BR; 051 if ("CL".equals(codeString)) 052 return V3EntityNamePartQualifierR2.CL; 053 if ("IN".equals(codeString)) 054 return V3EntityNamePartQualifierR2.IN; 055 if ("LS".equals(codeString)) 056 return V3EntityNamePartQualifierR2.LS; 057 if ("MID".equals(codeString)) 058 return V3EntityNamePartQualifierR2.MID; 059 if ("PFX".equals(codeString)) 060 return V3EntityNamePartQualifierR2.PFX; 061 if ("PharmaceuticalEntityNamePartQualifiers".equals(codeString)) 062 return V3EntityNamePartQualifierR2.PHARMACEUTICALENTITYNAMEPARTQUALIFIERS; 063 if ("CON".equals(codeString)) 064 return V3EntityNamePartQualifierR2.CON; 065 if ("DEV".equals(codeString)) 066 return V3EntityNamePartQualifierR2.DEV; 067 if ("FLAV".equals(codeString)) 068 return V3EntityNamePartQualifierR2.FLAV; 069 if ("FORMUL".equals(codeString)) 070 return V3EntityNamePartQualifierR2.FORMUL; 071 if ("FRM".equals(codeString)) 072 return V3EntityNamePartQualifierR2.FRM; 073 if ("INV".equals(codeString)) 074 return V3EntityNamePartQualifierR2.INV; 075 if ("POPUL".equals(codeString)) 076 return V3EntityNamePartQualifierR2.POPUL; 077 if ("SCI".equals(codeString)) 078 return V3EntityNamePartQualifierR2.SCI; 079 if ("STR".equals(codeString)) 080 return V3EntityNamePartQualifierR2.STR; 081 if ("TIME".equals(codeString)) 082 return V3EntityNamePartQualifierR2.TIME; 083 if ("TMK".equals(codeString)) 084 return V3EntityNamePartQualifierR2.TMK; 085 if ("USE".equals(codeString)) 086 return V3EntityNamePartQualifierR2.USE; 087 if ("SFX".equals(codeString)) 088 return V3EntityNamePartQualifierR2.SFX; 089 if ("TitleStyles".equals(codeString)) 090 return V3EntityNamePartQualifierR2.TITLESTYLES; 091 if ("AC".equals(codeString)) 092 return V3EntityNamePartQualifierR2.AC; 093 if ("HON".equals(codeString)) 094 return V3EntityNamePartQualifierR2.HON; 095 if ("NB".equals(codeString)) 096 return V3EntityNamePartQualifierR2.NB; 097 if ("PR".equals(codeString)) 098 return V3EntityNamePartQualifierR2.PR; 099 throw new IllegalArgumentException("Unknown V3EntityNamePartQualifierR2 code '"+codeString+"'"); 100 } 101 102 public String toCode(V3EntityNamePartQualifierR2 code) { 103 if (code == V3EntityNamePartQualifierR2.NULL) 104 return null; 105 if (code == V3EntityNamePartQualifierR2.AD) 106 return "AD"; 107 if (code == V3EntityNamePartQualifierR2.SP) 108 return "SP"; 109 if (code == V3EntityNamePartQualifierR2.BR) 110 return "BR"; 111 if (code == V3EntityNamePartQualifierR2.CL) 112 return "CL"; 113 if (code == V3EntityNamePartQualifierR2.IN) 114 return "IN"; 115 if (code == V3EntityNamePartQualifierR2.LS) 116 return "LS"; 117 if (code == V3EntityNamePartQualifierR2.MID) 118 return "MID"; 119 if (code == V3EntityNamePartQualifierR2.PFX) 120 return "PFX"; 121 if (code == V3EntityNamePartQualifierR2.PHARMACEUTICALENTITYNAMEPARTQUALIFIERS) 122 return "PharmaceuticalEntityNamePartQualifiers"; 123 if (code == V3EntityNamePartQualifierR2.CON) 124 return "CON"; 125 if (code == V3EntityNamePartQualifierR2.DEV) 126 return "DEV"; 127 if (code == V3EntityNamePartQualifierR2.FLAV) 128 return "FLAV"; 129 if (code == V3EntityNamePartQualifierR2.FORMUL) 130 return "FORMUL"; 131 if (code == V3EntityNamePartQualifierR2.FRM) 132 return "FRM"; 133 if (code == V3EntityNamePartQualifierR2.INV) 134 return "INV"; 135 if (code == V3EntityNamePartQualifierR2.POPUL) 136 return "POPUL"; 137 if (code == V3EntityNamePartQualifierR2.SCI) 138 return "SCI"; 139 if (code == V3EntityNamePartQualifierR2.STR) 140 return "STR"; 141 if (code == V3EntityNamePartQualifierR2.TIME) 142 return "TIME"; 143 if (code == V3EntityNamePartQualifierR2.TMK) 144 return "TMK"; 145 if (code == V3EntityNamePartQualifierR2.USE) 146 return "USE"; 147 if (code == V3EntityNamePartQualifierR2.SFX) 148 return "SFX"; 149 if (code == V3EntityNamePartQualifierR2.TITLESTYLES) 150 return "TitleStyles"; 151 if (code == V3EntityNamePartQualifierR2.AC) 152 return "AC"; 153 if (code == V3EntityNamePartQualifierR2.HON) 154 return "HON"; 155 if (code == V3EntityNamePartQualifierR2.NB) 156 return "NB"; 157 if (code == V3EntityNamePartQualifierR2.PR) 158 return "PR"; 159 return "?"; 160 } 161 162 public String toSystem(V3EntityNamePartQualifierR2 code) { 163 return code.getSystem(); 164 } 165 166}