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 Sun, May 6, 2018 17:51-0400 for FHIR v3.4.0
033
034
035import org.hl7.fhir.exceptions.FHIRException;
036
037public enum V3CalendarCycle {
038
039        /**
040         * CalendarCycleOneLetter
041         */
042        _CALENDARCYCLEONELETTER, 
043        /**
044         * week (continuous)
045         */
046        CW, 
047        /**
048         * year
049         */
050        CY, 
051        /**
052         * day of the month
053         */
054        D, 
055        /**
056         * day of the week (begins with Monday)
057         */
058        DW, 
059        /**
060         * hour of the day
061         */
062        H, 
063        /**
064         * month of the year
065         */
066        M, 
067        /**
068         * minute of the hour
069         */
070        N, 
071        /**
072         * second of the minute
073         */
074        S, 
075        /**
076         * CalendarCycleTwoLetter
077         */
078        _CALENDARCYCLETWOLETTER, 
079        /**
080         * day (continuous)
081         */
082        CD, 
083        /**
084         * hour (continuous)
085         */
086        CH, 
087        /**
088         * month (continuous)
089         */
090        CM, 
091        /**
092         * minute (continuous)
093         */
094        CN, 
095        /**
096         * second (continuous)
097         */
098        CS, 
099        /**
100         * day of the year
101         */
102        DY, 
103        /**
104         * week of the year
105         */
106        WY, 
107        /**
108         * The week with the month's first Thursday in it (analagous to the ISO 8601 definition for week of the year).
109         */
110        WM, 
111        /**
112         * added to help the parsers
113         */
114        NULL;
115        public static V3CalendarCycle fromCode(String codeString) throws FHIRException {
116            if (codeString == null || "".equals(codeString))
117                return null;
118        if ("_CalendarCycleOneLetter".equals(codeString))
119          return _CALENDARCYCLEONELETTER;
120        if ("CW".equals(codeString))
121          return CW;
122        if ("CY".equals(codeString))
123          return CY;
124        if ("D".equals(codeString))
125          return D;
126        if ("DW".equals(codeString))
127          return DW;
128        if ("H".equals(codeString))
129          return H;
130        if ("M".equals(codeString))
131          return M;
132        if ("N".equals(codeString))
133          return N;
134        if ("S".equals(codeString))
135          return S;
136        if ("_CalendarCycleTwoLetter".equals(codeString))
137          return _CALENDARCYCLETWOLETTER;
138        if ("CD".equals(codeString))
139          return CD;
140        if ("CH".equals(codeString))
141          return CH;
142        if ("CM".equals(codeString))
143          return CM;
144        if ("CN".equals(codeString))
145          return CN;
146        if ("CS".equals(codeString))
147          return CS;
148        if ("DY".equals(codeString))
149          return DY;
150        if ("WY".equals(codeString))
151          return WY;
152        if ("WM".equals(codeString))
153          return WM;
154        throw new FHIRException("Unknown V3CalendarCycle code '"+codeString+"'");
155        }
156        public String toCode() {
157          switch (this) {
158            case _CALENDARCYCLEONELETTER: return "_CalendarCycleOneLetter";
159            case CW: return "CW";
160            case CY: return "CY";
161            case D: return "D";
162            case DW: return "DW";
163            case H: return "H";
164            case M: return "M";
165            case N: return "N";
166            case S: return "S";
167            case _CALENDARCYCLETWOLETTER: return "_CalendarCycleTwoLetter";
168            case CD: return "CD";
169            case CH: return "CH";
170            case CM: return "CM";
171            case CN: return "CN";
172            case CS: return "CS";
173            case DY: return "DY";
174            case WY: return "WY";
175            case WM: return "WM";
176            default: return "?";
177          }
178        }
179        public String getSystem() {
180          return "http://hl7.org/fhir/v3/CalendarCycle";
181        }
182        public String getDefinition() {
183          switch (this) {
184            case _CALENDARCYCLEONELETTER: return "CalendarCycleOneLetter";
185            case CW: return "week (continuous)";
186            case CY: return "year";
187            case D: return "day of the month";
188            case DW: return "day of the week (begins with Monday)";
189            case H: return "hour of the day";
190            case M: return "month of the year";
191            case N: return "minute of the hour";
192            case S: return "second of the minute";
193            case _CALENDARCYCLETWOLETTER: return "CalendarCycleTwoLetter";
194            case CD: return "day (continuous)";
195            case CH: return "hour (continuous)";
196            case CM: return "month (continuous)";
197            case CN: return "minute (continuous)";
198            case CS: return "second (continuous)";
199            case DY: return "day of the year";
200            case WY: return "week of the year";
201            case WM: return "The week with the month's first Thursday in it (analagous to the ISO 8601 definition for week of the year).";
202            default: return "?";
203          }
204        }
205        public String getDisplay() {
206          switch (this) {
207            case _CALENDARCYCLEONELETTER: return "CalendarCycleOneLetter";
208            case CW: return "week (continuous)";
209            case CY: return "year";
210            case D: return "day of the month";
211            case DW: return "day of the week (begins with Monday)";
212            case H: return "hour of the day";
213            case M: return "month of the year";
214            case N: return "minute of the hour";
215            case S: return "second of the minute";
216            case _CALENDARCYCLETWOLETTER: return "CalendarCycleTwoLetter";
217            case CD: return "day (continuous)";
218            case CH: return "hour (continuous)";
219            case CM: return "month (continuous)";
220            case CN: return "minute (continuous)";
221            case CS: return "second (continuous)";
222            case DY: return "day of the year";
223            case WY: return "week of the year";
224            case WM: return "week of the month";
225            default: return "?";
226          }
227    }
228
229
230}
231