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 V3EntityClassEnumFactory implements EnumFactory<V3EntityClass> { 037 038 public V3EntityClass fromCode(String codeString) throws IllegalArgumentException { 039 if (codeString == null || "".equals(codeString)) 040 return null; 041 if ("ENT".equals(codeString)) 042 return V3EntityClass.ENT; 043 if ("HCE".equals(codeString)) 044 return V3EntityClass.HCE; 045 if ("LIV".equals(codeString)) 046 return V3EntityClass.LIV; 047 if ("NLIV".equals(codeString)) 048 return V3EntityClass.NLIV; 049 if ("ANM".equals(codeString)) 050 return V3EntityClass.ANM; 051 if ("MIC".equals(codeString)) 052 return V3EntityClass.MIC; 053 if ("PLNT".equals(codeString)) 054 return V3EntityClass.PLNT; 055 if ("PSN".equals(codeString)) 056 return V3EntityClass.PSN; 057 if ("MAT".equals(codeString)) 058 return V3EntityClass.MAT; 059 if ("CHEM".equals(codeString)) 060 return V3EntityClass.CHEM; 061 if ("FOOD".equals(codeString)) 062 return V3EntityClass.FOOD; 063 if ("MMAT".equals(codeString)) 064 return V3EntityClass.MMAT; 065 if ("CONT".equals(codeString)) 066 return V3EntityClass.CONT; 067 if ("HOLD".equals(codeString)) 068 return V3EntityClass.HOLD; 069 if ("DEV".equals(codeString)) 070 return V3EntityClass.DEV; 071 if ("CER".equals(codeString)) 072 return V3EntityClass.CER; 073 if ("MODDV".equals(codeString)) 074 return V3EntityClass.MODDV; 075 if ("ORG".equals(codeString)) 076 return V3EntityClass.ORG; 077 if ("PUB".equals(codeString)) 078 return V3EntityClass.PUB; 079 if ("STATE".equals(codeString)) 080 return V3EntityClass.STATE; 081 if ("NAT".equals(codeString)) 082 return V3EntityClass.NAT; 083 if ("PLC".equals(codeString)) 084 return V3EntityClass.PLC; 085 if ("CITY".equals(codeString)) 086 return V3EntityClass.CITY; 087 if ("COUNTRY".equals(codeString)) 088 return V3EntityClass.COUNTRY; 089 if ("COUNTY".equals(codeString)) 090 return V3EntityClass.COUNTY; 091 if ("PROVINCE".equals(codeString)) 092 return V3EntityClass.PROVINCE; 093 if ("RGRP".equals(codeString)) 094 return V3EntityClass.RGRP; 095 throw new IllegalArgumentException("Unknown V3EntityClass code '" + codeString + "'"); 096 } 097 098 public String toCode(V3EntityClass code) { 099 if (code == V3EntityClass.NULL) 100 return null; 101 if (code == V3EntityClass.ENT) 102 return "ENT"; 103 if (code == V3EntityClass.HCE) 104 return "HCE"; 105 if (code == V3EntityClass.LIV) 106 return "LIV"; 107 if (code == V3EntityClass.NLIV) 108 return "NLIV"; 109 if (code == V3EntityClass.ANM) 110 return "ANM"; 111 if (code == V3EntityClass.MIC) 112 return "MIC"; 113 if (code == V3EntityClass.PLNT) 114 return "PLNT"; 115 if (code == V3EntityClass.PSN) 116 return "PSN"; 117 if (code == V3EntityClass.MAT) 118 return "MAT"; 119 if (code == V3EntityClass.CHEM) 120 return "CHEM"; 121 if (code == V3EntityClass.FOOD) 122 return "FOOD"; 123 if (code == V3EntityClass.MMAT) 124 return "MMAT"; 125 if (code == V3EntityClass.CONT) 126 return "CONT"; 127 if (code == V3EntityClass.HOLD) 128 return "HOLD"; 129 if (code == V3EntityClass.DEV) 130 return "DEV"; 131 if (code == V3EntityClass.CER) 132 return "CER"; 133 if (code == V3EntityClass.MODDV) 134 return "MODDV"; 135 if (code == V3EntityClass.ORG) 136 return "ORG"; 137 if (code == V3EntityClass.PUB) 138 return "PUB"; 139 if (code == V3EntityClass.STATE) 140 return "STATE"; 141 if (code == V3EntityClass.NAT) 142 return "NAT"; 143 if (code == V3EntityClass.PLC) 144 return "PLC"; 145 if (code == V3EntityClass.CITY) 146 return "CITY"; 147 if (code == V3EntityClass.COUNTRY) 148 return "COUNTRY"; 149 if (code == V3EntityClass.COUNTY) 150 return "COUNTY"; 151 if (code == V3EntityClass.PROVINCE) 152 return "PROVINCE"; 153 if (code == V3EntityClass.RGRP) 154 return "RGRP"; 155 return "?"; 156 } 157 158 public String toSystem(V3EntityClass code) { 159 return code.getSystem(); 160 } 161 162}