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