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