001package org.hl7.fhir.instance.model.valuesets; 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, Jul 23, 2015 16:50-0400 for FHIR v0.5.0 033 034 035public enum Icd10 { 036 037 /** 038 * DIAG-1 039 */ 040 _123456, 041 /** 042 * DIAG-1a 043 */ 044 _123457, 045 /** 046 * DIAG-2 047 */ 048 _987654, 049 /** 050 * DIAG-3 051 */ 052 _123987, 053 /** 054 * DIAG-4 055 */ 056 _112233, 057 /** 058 * DIAG-5 059 */ 060 _997755, 061 /** 062 * DIAG-6 063 */ 064 _321789, 065 /** 066 * added to help the parsers 067 */ 068 NULL; 069 public static Icd10 fromCode(String codeString) throws Exception { 070 if (codeString == null || "".equals(codeString)) 071 return null; 072 if ("123456".equals(codeString)) 073 return _123456; 074 if ("123457".equals(codeString)) 075 return _123457; 076 if ("987654".equals(codeString)) 077 return _987654; 078 if ("123987".equals(codeString)) 079 return _123987; 080 if ("112233".equals(codeString)) 081 return _112233; 082 if ("997755".equals(codeString)) 083 return _997755; 084 if ("321789".equals(codeString)) 085 return _321789; 086 throw new Exception("Unknown Icd10 code '"+codeString+"'"); 087 } 088 public String toCode() { 089 switch (this) { 090 case _123456: return "123456"; 091 case _123457: return "123457"; 092 case _987654: return "987654"; 093 case _123987: return "123987"; 094 case _112233: return "112233"; 095 case _997755: return "997755"; 096 case _321789: return "321789"; 097 default: return "?"; 098 } 099 } 100 public String getSystem() { 101 return "http://hl7.org/fhir/sid/icd-10"; 102 } 103 public String getDefinition() { 104 switch (this) { 105 case _123456: return "DIAG-1"; 106 case _123457: return "DIAG-1a"; 107 case _987654: return "DIAG-2"; 108 case _123987: return "DIAG-3"; 109 case _112233: return "DIAG-4"; 110 case _997755: return "DIAG-5"; 111 case _321789: return "DIAG-6"; 112 default: return "?"; 113 } 114 } 115 public String getDisplay() { 116 switch (this) { 117 case _123456: return "DIAG-1"; 118 case _123457: return "DIAG-1a"; 119 case _987654: return "DIAG-2"; 120 case _123987: return "DIAG-3"; 121 case _112233: return "DIAG-4"; 122 case _997755: return "DIAG-5"; 123 case _321789: return "DIAG-6"; 124 default: return "?"; 125 } 126 } 127 128 129} 130