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