001package org.hl7.fhir.r4.model.codesystems;
002
003/*-
004 * #%L
005 * org.hl7.fhir.r4
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/*
025  Copyright (c) 2011+, HL7, Inc.
026  All rights reserved.
027  
028  Redistribution and use in source and binary forms, with or without modification, 
029  are permitted provided that the following conditions are met:
030  
031   * Redistributions of source code must retain the above copyright notice, this 
032     list of conditions and the following disclaimer.
033   * Redistributions in binary form must reproduce the above copyright notice, 
034     this list of conditions and the following disclaimer in the documentation 
035     and/or other materials provided with the distribution.
036   * Neither the name of HL7 nor the names of its contributors may be used to 
037     endorse or promote products derived from this software without specific 
038     prior written permission.
039  
040  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
041  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
042  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
043  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
044  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
045  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
046  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
047  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
048  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
049  POSSIBILITY OF SUCH DAMAGE.
050  
051*/
052
053// Generated on Wed, Jan 30, 2019 16:19-0500 for FHIR v4.0.0
054
055
056import org.hl7.fhir.exceptions.FHIRException;
057
058public enum EventTiming {
059
060        /**
061         * Event occurs during the morning. The exact time is unspecified and established by institution convention or patient interpretation.
062         */
063        MORN, 
064        /**
065         * Event occurs during the early morning. The exact time is unspecified and established by institution convention or patient interpretation.
066         */
067        MORN_EARLY, 
068        /**
069         * Event occurs during the late morning. The exact time is unspecified and established by institution convention or patient interpretation.
070         */
071        MORN_LATE, 
072        /**
073         * Event occurs around 12:00pm. The exact time is unspecified and established by institution convention or patient interpretation.
074         */
075        NOON, 
076        /**
077         * Event occurs during the afternoon. The exact time is unspecified and established by institution convention or patient interpretation.
078         */
079        AFT, 
080        /**
081         * Event occurs during the early afternoon. The exact time is unspecified and established by institution convention or patient interpretation.
082         */
083        AFT_EARLY, 
084        /**
085         * Event occurs during the late afternoon. The exact time is unspecified and established by institution convention or patient interpretation.
086         */
087        AFT_LATE, 
088        /**
089         * Event occurs during the evening. The exact time is unspecified and established by institution convention or patient interpretation.
090         */
091        EVE, 
092        /**
093         * Event occurs during the early evening. The exact time is unspecified and established by institution convention or patient interpretation.
094         */
095        EVE_EARLY, 
096        /**
097         * Event occurs during the late evening. The exact time is unspecified and established by institution convention or patient interpretation.
098         */
099        EVE_LATE, 
100        /**
101         * Event occurs during the night. The exact time is unspecified and established by institution convention or patient interpretation.
102         */
103        NIGHT, 
104        /**
105         * Event occurs [offset] after subject goes to sleep. The exact time is unspecified and established by institution convention or patient interpretation.
106         */
107        PHS, 
108        /**
109         * added to help the parsers
110         */
111        NULL;
112        public static EventTiming fromCode(String codeString) throws FHIRException {
113            if (codeString == null || "".equals(codeString))
114                return null;
115        if ("MORN".equals(codeString))
116          return MORN;
117        if ("MORN.early".equals(codeString))
118          return MORN_EARLY;
119        if ("MORN.late".equals(codeString))
120          return MORN_LATE;
121        if ("NOON".equals(codeString))
122          return NOON;
123        if ("AFT".equals(codeString))
124          return AFT;
125        if ("AFT.early".equals(codeString))
126          return AFT_EARLY;
127        if ("AFT.late".equals(codeString))
128          return AFT_LATE;
129        if ("EVE".equals(codeString))
130          return EVE;
131        if ("EVE.early".equals(codeString))
132          return EVE_EARLY;
133        if ("EVE.late".equals(codeString))
134          return EVE_LATE;
135        if ("NIGHT".equals(codeString))
136          return NIGHT;
137        if ("PHS".equals(codeString))
138          return PHS;
139        throw new FHIRException("Unknown EventTiming code '"+codeString+"'");
140        }
141        public String toCode() {
142          switch (this) {
143            case MORN: return "MORN";
144            case MORN_EARLY: return "MORN.early";
145            case MORN_LATE: return "MORN.late";
146            case NOON: return "NOON";
147            case AFT: return "AFT";
148            case AFT_EARLY: return "AFT.early";
149            case AFT_LATE: return "AFT.late";
150            case EVE: return "EVE";
151            case EVE_EARLY: return "EVE.early";
152            case EVE_LATE: return "EVE.late";
153            case NIGHT: return "NIGHT";
154            case PHS: return "PHS";
155            default: return "?";
156          }
157        }
158        public String getSystem() {
159          return "http://hl7.org/fhir/event-timing";
160        }
161        public String getDefinition() {
162          switch (this) {
163            case MORN: return "Event occurs during the morning. The exact time is unspecified and established by institution convention or patient interpretation.";
164            case MORN_EARLY: return "Event occurs during the early morning. The exact time is unspecified and established by institution convention or patient interpretation.";
165            case MORN_LATE: return "Event occurs during the late morning. The exact time is unspecified and established by institution convention or patient interpretation.";
166            case NOON: return "Event occurs around 12:00pm. The exact time is unspecified and established by institution convention or patient interpretation.";
167            case AFT: return "Event occurs during the afternoon. The exact time is unspecified and established by institution convention or patient interpretation.";
168            case AFT_EARLY: return "Event occurs during the early afternoon. The exact time is unspecified and established by institution convention or patient interpretation.";
169            case AFT_LATE: return "Event occurs during the late afternoon. The exact time is unspecified and established by institution convention or patient interpretation.";
170            case EVE: return "Event occurs during the evening. The exact time is unspecified and established by institution convention or patient interpretation.";
171            case EVE_EARLY: return "Event occurs during the early evening. The exact time is unspecified and established by institution convention or patient interpretation.";
172            case EVE_LATE: return "Event occurs during the late evening. The exact time is unspecified and established by institution convention or patient interpretation.";
173            case NIGHT: return "Event occurs during the night. The exact time is unspecified and established by institution convention or patient interpretation.";
174            case PHS: return "Event occurs [offset] after subject goes to sleep. The exact time is unspecified and established by institution convention or patient interpretation.";
175            default: return "?";
176          }
177        }
178        public String getDisplay() {
179          switch (this) {
180            case MORN: return "Morning";
181            case MORN_EARLY: return "Early Morning";
182            case MORN_LATE: return "Late Morning";
183            case NOON: return "Noon";
184            case AFT: return "Afternoon";
185            case AFT_EARLY: return "Early Afternoon";
186            case AFT_LATE: return "Late Afternoon";
187            case EVE: return "Evening";
188            case EVE_EARLY: return "Early Evening";
189            case EVE_LATE: return "Late Evening";
190            case NIGHT: return "Night";
191            case PHS: return "After Sleep";
192            default: return "?";
193          }
194    }
195
196
197}
198