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.exceptions.FHIRException; 035 036public enum InsuranceplanType { 037 038 /** 039 * null 040 */ 041 MEDICAL, 042 /** 043 * null 044 */ 045 DENTAL, 046 /** 047 * null 048 */ 049 MENTAL, 050 /** 051 * null 052 */ 053 SUBSTAB, 054 /** 055 * null 056 */ 057 VISION, 058 /** 059 * null 060 */ 061 DRUG, 062 /** 063 * null 064 */ 065 SHORTTERM, 066 /** 067 * null 068 */ 069 LONGTERM, 070 /** 071 * null 072 */ 073 HOSPICE, 074 /** 075 * null 076 */ 077 HOME, 078 /** 079 * added to help the parsers 080 */ 081 NULL; 082 083 public static InsuranceplanType fromCode(String codeString) throws FHIRException { 084 if (codeString == null || "".equals(codeString)) 085 return null; 086 if ("medical".equals(codeString)) 087 return MEDICAL; 088 if ("dental".equals(codeString)) 089 return DENTAL; 090 if ("mental".equals(codeString)) 091 return MENTAL; 092 if ("subst-ab".equals(codeString)) 093 return SUBSTAB; 094 if ("vision".equals(codeString)) 095 return VISION; 096 if ("Drug".equals(codeString)) 097 return DRUG; 098 if ("short-term".equals(codeString)) 099 return SHORTTERM; 100 if ("long-term".equals(codeString)) 101 return LONGTERM; 102 if ("hospice".equals(codeString)) 103 return HOSPICE; 104 if ("home".equals(codeString)) 105 return HOME; 106 throw new FHIRException("Unknown InsuranceplanType code '" + codeString + "'"); 107 } 108 109 public String toCode() { 110 switch (this) { 111 case MEDICAL: 112 return "medical"; 113 case DENTAL: 114 return "dental"; 115 case MENTAL: 116 return "mental"; 117 case SUBSTAB: 118 return "subst-ab"; 119 case VISION: 120 return "vision"; 121 case DRUG: 122 return "Drug"; 123 case SHORTTERM: 124 return "short-term"; 125 case LONGTERM: 126 return "long-term"; 127 case HOSPICE: 128 return "hospice"; 129 case HOME: 130 return "home"; 131 case NULL: 132 return null; 133 default: 134 return "?"; 135 } 136 } 137 138 public String getSystem() { 139 return "http://terminology.hl7.org/CodeSystem/insurance-plan-type"; 140 } 141 142 public String getDefinition() { 143 switch (this) { 144 case MEDICAL: 145 return ""; 146 case DENTAL: 147 return ""; 148 case MENTAL: 149 return ""; 150 case SUBSTAB: 151 return ""; 152 case VISION: 153 return ""; 154 case DRUG: 155 return ""; 156 case SHORTTERM: 157 return ""; 158 case LONGTERM: 159 return ""; 160 case HOSPICE: 161 return ""; 162 case HOME: 163 return ""; 164 case NULL: 165 return null; 166 default: 167 return "?"; 168 } 169 } 170 171 public String getDisplay() { 172 switch (this) { 173 case MEDICAL: 174 return "Medical"; 175 case DENTAL: 176 return "Dental"; 177 case MENTAL: 178 return "Mental Health"; 179 case SUBSTAB: 180 return "Substance Abuse"; 181 case VISION: 182 return "Vision"; 183 case DRUG: 184 return "Drug"; 185 case SHORTTERM: 186 return "Short Term"; 187 case LONGTERM: 188 return "Long Term Care"; 189 case HOSPICE: 190 return "Hospice"; 191 case HOME: 192 return "Home Health"; 193 case NULL: 194 return null; 195 default: 196 return "?"; 197 } 198 } 199 200}