001package org.hl7.fhir.dstu3.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 Sat, Mar 25, 2017 21:03-0400 for FHIR v3.0.0 036 037 038import org.hl7.fhir.exceptions.FHIRException; 039 040public enum V3PersonDisabilityType { 041 042 /** 043 * Vision impaired 044 */ 045 _1, 046 /** 047 * Hearing impaired 048 */ 049 _2, 050 /** 051 * Speech impaired 052 */ 053 _3, 054 /** 055 * Mentally impaired 056 */ 057 _4, 058 /** 059 * Mobility impaired 060 */ 061 _5, 062 /** 063 * A crib is required to move the person 064 */ 065 CB, 066 /** 067 * Person requires crutches to ambulate 068 */ 069 CR, 070 /** 071 * A gurney is required to move the person 072 */ 073 G, 074 /** 075 * Person requires a wheelchair to be ambulatory 076 */ 077 WC, 078 /** 079 * Person requires a walker to ambulate 080 */ 081 WK, 082 /** 083 * added to help the parsers 084 */ 085 NULL; 086 public static V3PersonDisabilityType fromCode(String codeString) throws FHIRException { 087 if (codeString == null || "".equals(codeString)) 088 return null; 089 if ("1".equals(codeString)) 090 return _1; 091 if ("2".equals(codeString)) 092 return _2; 093 if ("3".equals(codeString)) 094 return _3; 095 if ("4".equals(codeString)) 096 return _4; 097 if ("5".equals(codeString)) 098 return _5; 099 if ("CB".equals(codeString)) 100 return CB; 101 if ("CR".equals(codeString)) 102 return CR; 103 if ("G".equals(codeString)) 104 return G; 105 if ("WC".equals(codeString)) 106 return WC; 107 if ("WK".equals(codeString)) 108 return WK; 109 throw new FHIRException("Unknown V3PersonDisabilityType code '"+codeString+"'"); 110 } 111 public String toCode() { 112 switch (this) { 113 case _1: return "1"; 114 case _2: return "2"; 115 case _3: return "3"; 116 case _4: return "4"; 117 case _5: return "5"; 118 case CB: return "CB"; 119 case CR: return "CR"; 120 case G: return "G"; 121 case WC: return "WC"; 122 case WK: return "WK"; 123 case NULL: return null; 124 default: return "?"; 125 } 126 } 127 public String getSystem() { 128 return "http://hl7.org/fhir/v3/PersonDisabilityType"; 129 } 130 public String getDefinition() { 131 switch (this) { 132 case _1: return "Vision impaired"; 133 case _2: return "Hearing impaired"; 134 case _3: return "Speech impaired"; 135 case _4: return "Mentally impaired"; 136 case _5: return "Mobility impaired"; 137 case CB: return "A crib is required to move the person"; 138 case CR: return "Person requires crutches to ambulate"; 139 case G: return "A gurney is required to move the person"; 140 case WC: return "Person requires a wheelchair to be ambulatory"; 141 case WK: return "Person requires a walker to ambulate"; 142 case NULL: return null; 143 default: return "?"; 144 } 145 } 146 public String getDisplay() { 147 switch (this) { 148 case _1: return "Vision impaired"; 149 case _2: return "Hearing impaired"; 150 case _3: return "Speech impaired"; 151 case _4: return "Mentally impaired"; 152 case _5: return "Mobility impaired"; 153 case CB: return "Requires crib"; 154 case CR: return "Requires crutches"; 155 case G: return "Requires gurney"; 156 case WC: return "Requires wheelchair"; 157 case WK: return "Requires walker"; 158 case NULL: return null; 159 default: return "?"; 160 } 161 } 162 163 164}