001package org.hl7.fhir.r4.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 Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0 036 037 038import org.hl7.fhir.exceptions.FHIRException; 039 040public enum ContainerCap { 041 042 /** 043 * red cap. 044 */ 045 RED, 046 /** 047 * yellow cap. 048 */ 049 YELLOW, 050 /** 051 * dark yellow cap. 052 */ 053 DARKYELLOW, 054 /** 055 * grey cap. 056 */ 057 GREY, 058 /** 059 * light blue cap. 060 */ 061 LIGHTBLUE, 062 /** 063 * black cap. 064 */ 065 BLACK, 066 /** 067 * green cap. 068 */ 069 GREEN, 070 /** 071 * light green cap. 072 */ 073 LIGHTGREEN, 074 /** 075 * lavender cap. 076 */ 077 LAVENDER, 078 /** 079 * brown cap. 080 */ 081 BROWN, 082 /** 083 * white cap. 084 */ 085 WHITE, 086 /** 087 * pink cap. 088 */ 089 PINK, 090 /** 091 * added to help the parsers 092 */ 093 NULL; 094 public static ContainerCap fromCode(String codeString) throws FHIRException { 095 if (codeString == null || "".equals(codeString)) 096 return null; 097 if ("red".equals(codeString)) 098 return RED; 099 if ("yellow".equals(codeString)) 100 return YELLOW; 101 if ("dark-yellow".equals(codeString)) 102 return DARKYELLOW; 103 if ("grey".equals(codeString)) 104 return GREY; 105 if ("light-blue".equals(codeString)) 106 return LIGHTBLUE; 107 if ("black".equals(codeString)) 108 return BLACK; 109 if ("green".equals(codeString)) 110 return GREEN; 111 if ("light-green".equals(codeString)) 112 return LIGHTGREEN; 113 if ("lavender".equals(codeString)) 114 return LAVENDER; 115 if ("brown".equals(codeString)) 116 return BROWN; 117 if ("white".equals(codeString)) 118 return WHITE; 119 if ("pink".equals(codeString)) 120 return PINK; 121 throw new FHIRException("Unknown ContainerCap code '"+codeString+"'"); 122 } 123 public String toCode() { 124 switch (this) { 125 case RED: return "red"; 126 case YELLOW: return "yellow"; 127 case DARKYELLOW: return "dark-yellow"; 128 case GREY: return "grey"; 129 case LIGHTBLUE: return "light-blue"; 130 case BLACK: return "black"; 131 case GREEN: return "green"; 132 case LIGHTGREEN: return "light-green"; 133 case LAVENDER: return "lavender"; 134 case BROWN: return "brown"; 135 case WHITE: return "white"; 136 case PINK: return "pink"; 137 case NULL: return null; 138 default: return "?"; 139 } 140 } 141 public String getSystem() { 142 return "http://terminology.hl7.org/CodeSystem/container-cap"; 143 } 144 public String getDefinition() { 145 switch (this) { 146 case RED: return "red cap."; 147 case YELLOW: return "yellow cap."; 148 case DARKYELLOW: return "dark yellow cap."; 149 case GREY: return "grey cap."; 150 case LIGHTBLUE: return "light blue cap."; 151 case BLACK: return "black cap."; 152 case GREEN: return "green cap."; 153 case LIGHTGREEN: return "light green cap."; 154 case LAVENDER: return "lavender cap."; 155 case BROWN: return "brown cap."; 156 case WHITE: return "white cap."; 157 case PINK: return "pink cap."; 158 case NULL: return null; 159 default: return "?"; 160 } 161 } 162 public String getDisplay() { 163 switch (this) { 164 case RED: return "red cap"; 165 case YELLOW: return "yellow cap"; 166 case DARKYELLOW: return "dark yellow cap"; 167 case GREY: return "grey cap"; 168 case LIGHTBLUE: return "light blue cap"; 169 case BLACK: return "black cap"; 170 case GREEN: return "green cap"; 171 case LIGHTGREEN: return "light green cap"; 172 case LAVENDER: return "lavender cap"; 173 case BROWN: return "brown cap"; 174 case WHITE: return "white cap"; 175 case PINK: return "pink cap"; 176 case NULL: return null; 177 default: return "?"; 178 } 179 } 180 181 182}