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 FHIRVersion { 059 060 /** 061 * Oldest archived version of FHIR. 062 */ 063 _0_01, 064 /** 065 * 1st Draft for Comment (Sept 2012 Ballot). 066 */ 067 _0_05, 068 /** 069 * 2nd Draft for Comment (January 2013 Ballot). 070 */ 071 _0_06, 072 /** 073 * DSTU 1 Ballot version. 074 */ 075 _0_11, 076 /** 077 * DSTU 1 Official version. 078 */ 079 _0_0_80, 080 /** 081 * DSTU 1 Official version Technical Errata #1. 082 */ 083 _0_0_81, 084 /** 085 * DSTU 1 Official version Technical Errata #2. 086 */ 087 _0_0_82, 088 /** 089 * Draft For Comment (January 2015 Ballot). 090 */ 091 _0_4_0, 092 /** 093 * DSTU 2 Ballot version (May 2015 Ballot). 094 */ 095 _0_5_0, 096 /** 097 * DSTU 2 QA Preview + CQIF Ballot (Sep 2015). 098 */ 099 _1_0_0, 100 /** 101 * DSTU 2 (Official version). 102 */ 103 _1_0_1, 104 /** 105 * DSTU 2 (Official version) with 1 technical errata. 106 */ 107 _1_0_2, 108 /** 109 * GAO Ballot + draft changes to main FHIR standard. 110 */ 111 _1_1_0, 112 /** 113 * CQF on FHIR Ballot + Connectathon 12 (Montreal). 114 */ 115 _1_4_0, 116 /** 117 * FHIR STU3 Ballot + Connectathon 13 (Baltimore). 118 */ 119 _1_6_0, 120 /** 121 * FHIR STU3 Candidate + Connectathon 14 (San Antonio). 122 */ 123 _1_8_0, 124 /** 125 * FHIR Release 3 (STU). 126 */ 127 _3_0_0, 128 /** 129 * FHIR Release 3 (STU) with 1 technical errata. 130 */ 131 _3_0_1, 132 /** 133 * R4 Ballot #1. 134 */ 135 _3_3_0, 136 /** 137 * R4 Ballot #2. 138 */ 139 _3_5_0, 140 /** 141 * FHIR Release 4 (Normative + STU). 142 */ 143 _4_0_0, 144 /** 145 * added to help the parsers 146 */ 147 NULL; 148 public static FHIRVersion fromCode(String codeString) throws FHIRException { 149 if (codeString == null || "".equals(codeString)) 150 return null; 151 if ("0.01".equals(codeString)) 152 return _0_01; 153 if ("0.05".equals(codeString)) 154 return _0_05; 155 if ("0.06".equals(codeString)) 156 return _0_06; 157 if ("0.11".equals(codeString)) 158 return _0_11; 159 if ("0.0.80".equals(codeString)) 160 return _0_0_80; 161 if ("0.0.81".equals(codeString)) 162 return _0_0_81; 163 if ("0.0.82".equals(codeString)) 164 return _0_0_82; 165 if ("0.4.0".equals(codeString)) 166 return _0_4_0; 167 if ("0.5.0".equals(codeString)) 168 return _0_5_0; 169 if ("1.0.0".equals(codeString)) 170 return _1_0_0; 171 if ("1.0.1".equals(codeString)) 172 return _1_0_1; 173 if ("1.0.2".equals(codeString)) 174 return _1_0_2; 175 if ("1.1.0".equals(codeString)) 176 return _1_1_0; 177 if ("1.4.0".equals(codeString)) 178 return _1_4_0; 179 if ("1.6.0".equals(codeString)) 180 return _1_6_0; 181 if ("1.8.0".equals(codeString)) 182 return _1_8_0; 183 if ("3.0.0".equals(codeString)) 184 return _3_0_0; 185 if ("3.0.1".equals(codeString)) 186 return _3_0_1; 187 if ("3.3.0".equals(codeString)) 188 return _3_3_0; 189 if ("3.5.0".equals(codeString)) 190 return _3_5_0; 191 if ("4.0.0".equals(codeString)) 192 return _4_0_0; 193 throw new FHIRException("Unknown FHIRVersion code '"+codeString+"'"); 194 } 195 public String toCode() { 196 switch (this) { 197 case _0_01: return "0.01"; 198 case _0_05: return "0.05"; 199 case _0_06: return "0.06"; 200 case _0_11: return "0.11"; 201 case _0_0_80: return "0.0.80"; 202 case _0_0_81: return "0.0.81"; 203 case _0_0_82: return "0.0.82"; 204 case _0_4_0: return "0.4.0"; 205 case _0_5_0: return "0.5.0"; 206 case _1_0_0: return "1.0.0"; 207 case _1_0_1: return "1.0.1"; 208 case _1_0_2: return "1.0.2"; 209 case _1_1_0: return "1.1.0"; 210 case _1_4_0: return "1.4.0"; 211 case _1_6_0: return "1.6.0"; 212 case _1_8_0: return "1.8.0"; 213 case _3_0_0: return "3.0.0"; 214 case _3_0_1: return "3.0.1"; 215 case _3_3_0: return "3.3.0"; 216 case _3_5_0: return "3.5.0"; 217 case _4_0_0: return "4.0.0"; 218 default: return "?"; 219 } 220 } 221 public String getSystem() { 222 return "http://hl7.org/fhir/FHIR-version"; 223 } 224 public String getDefinition() { 225 switch (this) { 226 case _0_01: return "Oldest archived version of FHIR."; 227 case _0_05: return "1st Draft for Comment (Sept 2012 Ballot)."; 228 case _0_06: return "2nd Draft for Comment (January 2013 Ballot)."; 229 case _0_11: return "DSTU 1 Ballot version."; 230 case _0_0_80: return "DSTU 1 Official version."; 231 case _0_0_81: return "DSTU 1 Official version Technical Errata #1."; 232 case _0_0_82: return "DSTU 1 Official version Technical Errata #2."; 233 case _0_4_0: return "Draft For Comment (January 2015 Ballot)."; 234 case _0_5_0: return "DSTU 2 Ballot version (May 2015 Ballot)."; 235 case _1_0_0: return "DSTU 2 QA Preview + CQIF Ballot (Sep 2015)."; 236 case _1_0_1: return "DSTU 2 (Official version)."; 237 case _1_0_2: return "DSTU 2 (Official version) with 1 technical errata."; 238 case _1_1_0: return "GAO Ballot + draft changes to main FHIR standard."; 239 case _1_4_0: return "CQF on FHIR Ballot + Connectathon 12 (Montreal)."; 240 case _1_6_0: return "FHIR STU3 Ballot + Connectathon 13 (Baltimore)."; 241 case _1_8_0: return "FHIR STU3 Candidate + Connectathon 14 (San Antonio)."; 242 case _3_0_0: return "FHIR Release 3 (STU)."; 243 case _3_0_1: return "FHIR Release 3 (STU) with 1 technical errata."; 244 case _3_3_0: return "R4 Ballot #1."; 245 case _3_5_0: return "R4 Ballot #2."; 246 case _4_0_0: return "FHIR Release 4 (Normative + STU)."; 247 default: return "?"; 248 } 249 } 250 public String getDisplay() { 251 switch (this) { 252 case _0_01: return "0.01"; 253 case _0_05: return "0.05"; 254 case _0_06: return "0.06"; 255 case _0_11: return "0.11"; 256 case _0_0_80: return "0.0.80"; 257 case _0_0_81: return "0.0.81"; 258 case _0_0_82: return "0.0.82"; 259 case _0_4_0: return "0.4.0"; 260 case _0_5_0: return "0.5.0"; 261 case _1_0_0: return "1.0.0"; 262 case _1_0_1: return "1.0.1"; 263 case _1_0_2: return "1.0.2"; 264 case _1_1_0: return "1.1.0"; 265 case _1_4_0: return "1.4.0"; 266 case _1_6_0: return "1.6.0"; 267 case _1_8_0: return "1.8.0"; 268 case _3_0_0: return "3.0.0"; 269 case _3_0_1: return "3.0.1"; 270 case _3_3_0: return "3.3.0"; 271 case _3_5_0: return "3.5.0"; 272 case _4_0_0: return "4.0.0"; 273 default: return "?"; 274 } 275 } 276 277 278} 279