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 Thu, Sep 13, 2018 09:04-0400 for FHIR v3.5.0
033
034
035import org.hl7.fhir.exceptions.FHIRException;
036
037public enum EventTiming {
038
039        /**
040         * Event occurs during the morning. The exact time is unspecified and established by institution convention or patient interpretation.
041         */
042        MORN, 
043        /**
044         * Event occurs during the early morning. The exact time is unspecified and established by institution convention or patient interpretation.
045         */
046        MORN_EARLY, 
047        /**
048         * Event occurs during the late morning. The exact time is unspecified and established by institution convention or patient interpretation.
049         */
050        MORN_LATE, 
051        /**
052         * Event occurs around 12:00pm. The exact time is unspecified and established by institution convention or patient interpretation.
053         */
054        NOON, 
055        /**
056         * Event occurs during the afternoon. The exact time is unspecified and established by institution convention or patient interpretation.
057         */
058        AFT, 
059        /**
060         * Event occurs during the early afternoon. The exact time is unspecified and established by institution convention or patient interpretation.
061         */
062        AFT_EARLY, 
063        /**
064         * Event occurs during the late afternoon. The exact time is unspecified and established by institution convention or patient interpretation.
065         */
066        AFT_LATE, 
067        /**
068         * Event occurs during the evening. The exact time is unspecified and established by institution convention or patient interpretation.
069         */
070        EVE, 
071        /**
072         * Event occurs during the early evening. The exact time is unspecified and established by institution convention or patient interpretation.
073         */
074        EVE_EARLY, 
075        /**
076         * Event occurs during the late evening. The exact time is unspecified and established by institution convention or patient interpretation.
077         */
078        EVE_LATE, 
079        /**
080         * Event occurs during the night. The exact time is unspecified and established by institution convention or patient interpretation.
081         */
082        NIGHT, 
083        /**
084         * Event occurs [offset] after subject goes to sleep. The exact time is unspecified and established by institution convention or patient interpretation.
085         */
086        PHS, 
087        /**
088         * added to help the parsers
089         */
090        NULL;
091        public static EventTiming fromCode(String codeString) throws FHIRException {
092            if (codeString == null || "".equals(codeString))
093                return null;
094        if ("MORN".equals(codeString))
095          return MORN;
096        if ("MORN.early".equals(codeString))
097          return MORN_EARLY;
098        if ("MORN.late".equals(codeString))
099          return MORN_LATE;
100        if ("NOON".equals(codeString))
101          return NOON;
102        if ("AFT".equals(codeString))
103          return AFT;
104        if ("AFT.early".equals(codeString))
105          return AFT_EARLY;
106        if ("AFT.late".equals(codeString))
107          return AFT_LATE;
108        if ("EVE".equals(codeString))
109          return EVE;
110        if ("EVE.early".equals(codeString))
111          return EVE_EARLY;
112        if ("EVE.late".equals(codeString))
113          return EVE_LATE;
114        if ("NIGHT".equals(codeString))
115          return NIGHT;
116        if ("PHS".equals(codeString))
117          return PHS;
118        throw new FHIRException("Unknown EventTiming code '"+codeString+"'");
119        }
120        public String toCode() {
121          switch (this) {
122            case MORN: return "MORN";
123            case MORN_EARLY: return "MORN.early";
124            case MORN_LATE: return "MORN.late";
125            case NOON: return "NOON";
126            case AFT: return "AFT";
127            case AFT_EARLY: return "AFT.early";
128            case AFT_LATE: return "AFT.late";
129            case EVE: return "EVE";
130            case EVE_EARLY: return "EVE.early";
131            case EVE_LATE: return "EVE.late";
132            case NIGHT: return "NIGHT";
133            case PHS: return "PHS";
134            default: return "?";
135          }
136        }
137        public String getSystem() {
138          return "http://hl7.org/fhir/event-timing";
139        }
140        public String getDefinition() {
141          switch (this) {
142            case MORN: return "Event occurs during the morning. The exact time is unspecified and established by institution convention or patient interpretation.";
143            case MORN_EARLY: return "Event occurs during the early morning. The exact time is unspecified and established by institution convention or patient interpretation.";
144            case MORN_LATE: return "Event occurs during the late morning. The exact time is unspecified and established by institution convention or patient interpretation.";
145            case NOON: return "Event occurs around 12:00pm. The exact time is unspecified and established by institution convention or patient interpretation.";
146            case AFT: return "Event occurs during the afternoon. The exact time is unspecified and established by institution convention or patient interpretation.";
147            case AFT_EARLY: return "Event occurs during the early afternoon. The exact time is unspecified and established by institution convention or patient interpretation.";
148            case AFT_LATE: return "Event occurs during the late afternoon. The exact time is unspecified and established by institution convention or patient interpretation.";
149            case EVE: return "Event occurs during the evening. The exact time is unspecified and established by institution convention or patient interpretation.";
150            case EVE_EARLY: return "Event occurs during the early evening. The exact time is unspecified and established by institution convention or patient interpretation.";
151            case EVE_LATE: return "Event occurs during the late evening. The exact time is unspecified and established by institution convention or patient interpretation.";
152            case NIGHT: return "Event occurs during the night. The exact time is unspecified and established by institution convention or patient interpretation.";
153            case PHS: return "Event occurs [offset] after subject goes to sleep. The exact time is unspecified and established by institution convention or patient interpretation.";
154            default: return "?";
155          }
156        }
157        public String getDisplay() {
158          switch (this) {
159            case MORN: return "Morning";
160            case MORN_EARLY: return "Early Morning";
161            case MORN_LATE: return "Late Morning";
162            case NOON: return "Noon";
163            case AFT: return "Afternoon";
164            case AFT_EARLY: return "Early Afternoon";
165            case AFT_LATE: return "Late Afternoon";
166            case EVE: return "Evening";
167            case EVE_EARLY: return "Early Evening";
168            case EVE_LATE: return "Late Evening";
169            case NIGHT: return "Night";
170            case PHS: return "After Sleep";
171            default: return "?";
172          }
173    }
174
175
176}
177