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