001package org.hl7.fhir.r5.model.codesystems;
002
003/*
004 * #%L
005 * org.hl7.fhir.r5
006 * %%
007 * Copyright (C) 2014 - 2019 Health Level 7
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023/*
024  Copyright (c) 2011+, HL7, Inc.
025  All rights reserved.
026  
027  Redistribution and use in source and binary forms, with or without modification, 
028  are permitted provided that the following conditions are met:
029  
030   * Redistributions of source code must retain the above copyright notice, this 
031     list of conditions and the following disclaimer.
032   * Redistributions in binary form must reproduce the above copyright notice, 
033     this list of conditions and the following disclaimer in the documentation 
034     and/or other materials provided with the distribution.
035   * Neither the name of HL7 nor the names of its contributors may be used to 
036     endorse or promote products derived from this software without specific 
037     prior written permission.
038  
039  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
040  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
041  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
042  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
043  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
044  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
045  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
046  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
047  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
048  POSSIBILITY OF SUCH DAMAGE.
049  
050*/
051
052// Generated on Thu, Oct 17, 2019 09:42+1100 for FHIR v4.1.0
053
054
055import org.hl7.fhir.exceptions.FHIRException;
056
057public enum V3CalendarCycle {
058
059        /**
060         * CalendarCycleOneLetter
061         */
062        _CALENDARCYCLEONELETTER, 
063        /**
064         * week (continuous)
065         */
066        CW, 
067        /**
068         * year
069         */
070        CY, 
071        /**
072         * day of the month
073         */
074        D, 
075        /**
076         * day of the week (begins with Monday)
077         */
078        DW, 
079        /**
080         * hour of the day
081         */
082        H, 
083        /**
084         * month of the year
085         */
086        M, 
087        /**
088         * minute of the hour
089         */
090        N, 
091        /**
092         * second of the minute
093         */
094        S, 
095        /**
096         * CalendarCycleTwoLetter
097         */
098        _CALENDARCYCLETWOLETTER, 
099        /**
100         * day (continuous)
101         */
102        CD, 
103        /**
104         * hour (continuous)
105         */
106        CH, 
107        /**
108         * month (continuous)
109         */
110        CM, 
111        /**
112         * minute (continuous)
113         */
114        CN, 
115        /**
116         * second (continuous)
117         */
118        CS, 
119        /**
120         * day of the year
121         */
122        DY, 
123        /**
124         * week of the year
125         */
126        WY, 
127        /**
128         * The week with the month's first Thursday in it (analagous to the ISO 8601 definition for week of the year).
129         */
130        WM, 
131        /**
132         * added to help the parsers
133         */
134        NULL;
135        public static V3CalendarCycle fromCode(String codeString) throws FHIRException {
136            if (codeString == null || "".equals(codeString))
137                return null;
138        if ("_CalendarCycleOneLetter".equals(codeString))
139          return _CALENDARCYCLEONELETTER;
140        if ("CW".equals(codeString))
141          return CW;
142        if ("CY".equals(codeString))
143          return CY;
144        if ("D".equals(codeString))
145          return D;
146        if ("DW".equals(codeString))
147          return DW;
148        if ("H".equals(codeString))
149          return H;
150        if ("M".equals(codeString))
151          return M;
152        if ("N".equals(codeString))
153          return N;
154        if ("S".equals(codeString))
155          return S;
156        if ("_CalendarCycleTwoLetter".equals(codeString))
157          return _CALENDARCYCLETWOLETTER;
158        if ("CD".equals(codeString))
159          return CD;
160        if ("CH".equals(codeString))
161          return CH;
162        if ("CM".equals(codeString))
163          return CM;
164        if ("CN".equals(codeString))
165          return CN;
166        if ("CS".equals(codeString))
167          return CS;
168        if ("DY".equals(codeString))
169          return DY;
170        if ("WY".equals(codeString))
171          return WY;
172        if ("WM".equals(codeString))
173          return WM;
174        throw new FHIRException("Unknown V3CalendarCycle code '"+codeString+"'");
175        }
176        public String toCode() {
177          switch (this) {
178            case _CALENDARCYCLEONELETTER: return "_CalendarCycleOneLetter";
179            case CW: return "CW";
180            case CY: return "CY";
181            case D: return "D";
182            case DW: return "DW";
183            case H: return "H";
184            case M: return "M";
185            case N: return "N";
186            case S: return "S";
187            case _CALENDARCYCLETWOLETTER: return "_CalendarCycleTwoLetter";
188            case CD: return "CD";
189            case CH: return "CH";
190            case CM: return "CM";
191            case CN: return "CN";
192            case CS: return "CS";
193            case DY: return "DY";
194            case WY: return "WY";
195            case WM: return "WM";
196            default: return "?";
197          }
198        }
199        public String getSystem() {
200          return "http://terminology.hl7.org/CodeSystem/v3-CalendarCycle";
201        }
202        public String getDefinition() {
203          switch (this) {
204            case _CALENDARCYCLEONELETTER: return "CalendarCycleOneLetter";
205            case CW: return "week (continuous)";
206            case CY: return "year";
207            case D: return "day of the month";
208            case DW: return "day of the week (begins with Monday)";
209            case H: return "hour of the day";
210            case M: return "month of the year";
211            case N: return "minute of the hour";
212            case S: return "second of the minute";
213            case _CALENDARCYCLETWOLETTER: return "CalendarCycleTwoLetter";
214            case CD: return "day (continuous)";
215            case CH: return "hour (continuous)";
216            case CM: return "month (continuous)";
217            case CN: return "minute (continuous)";
218            case CS: return "second (continuous)";
219            case DY: return "day of the year";
220            case WY: return "week of the year";
221            case WM: return "The week with the month's first Thursday in it (analagous to the ISO 8601 definition for week of the year).";
222            default: return "?";
223          }
224        }
225        public String getDisplay() {
226          switch (this) {
227            case _CALENDARCYCLEONELETTER: return "CalendarCycleOneLetter";
228            case CW: return "week (continuous)";
229            case CY: return "year";
230            case D: return "day of the month";
231            case DW: return "day of the week (begins with Monday)";
232            case H: return "hour of the day";
233            case M: return "month of the year";
234            case N: return "minute of the hour";
235            case S: return "second of the minute";
236            case _CALENDARCYCLETWOLETTER: return "CalendarCycleTwoLetter";
237            case CD: return "day (continuous)";
238            case CH: return "hour (continuous)";
239            case CM: return "month (continuous)";
240            case CN: return "minute (continuous)";
241            case CS: return "second (continuous)";
242            case DY: return "day of the year";
243            case WY: return "week of the year";
244            case WM: return "week of the month";
245            default: return "?";
246          }
247    }
248
249
250}
251