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