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